git, gh, and npm) has a much smaller pod-to-host escape surface than a normal container.
On LangWatch Cloud the pod always runs under gVisor. Self-hosted, the chart runs the pod on the node’s normal runtime by default (runtimeClassName: ""), so it starts on any cluster. To harden, set runtimeClassName: "gvisor" and acceptUnsandboxedRuntime: false; on a cluster without that RuntimeClass, Kubernetes then rejects the pod at admission rather than silently dropping it to the node’s runtime. Any sandboxed RuntimeClass works (a Kata class on AKS, for example). See Setup.
The default pair, runtimeClassName: "" plus acceptUnsandboxedRuntime: true, runs unsandboxed: there is no pod-to-host boundary beyond a normal container, only the in-pod walls below. With acceptUnsandboxedRuntime: false, the chart’s render-time fail guard refuses an empty runtimeClassName, so a hardened install cannot lose its sandbox by accident.
Isolation layers
Langy is isolated at several layers, from the pod boundary down to the walls between two conversations sharing one pod. Weakest to strongest:
The manager process runs as root in the container, because assigning a distinct UID per worker needs
CAP_SETUID, CAP_SETGID, and CAP_CHOWN.
To keep the blast radius small, the container drops all capabilities and adds back only five: CHOWN, DAC_OVERRIDE, FOWNER, SETUID, and SETGID. It also sets allowPrivilegeEscalation: false and readOnlyRootFilesystem: true.
It omits fsGroup, since sharing it would reopen the cross-worker file boundary, and sets automountServiceAccountToken: false because the manager makes no Kubernetes API calls.
Why egress is enforced at L7, not with iptables
gVisor’s network stack supports only part ofiptables and nftables, so Langy does not rely on kernel firewall rules such as an iptables OWNER-match DROP or a REDIRECT to a local proxy. Egress control has to work the same way with and without the sandbox.
That is why Langy enforces egress at the application layer instead: a per-worker CONNECT proxy (ADR-076) that the worker’s HTTPS_PROXY points at. It checks TLS, checks the destination against the allow-list, and cross-checks the TLS SNI against the CONNECT authority to block domain fronting.
The earlier iptables-based rule and its NET_ADMIN capability were removed because they did not work under gVisor.
The defence-in-depth mitigations that are shipped today:
- CGNAT egress deny. The
100.64.0.0/10range is blocked at L3/L4, so a worker cannot reach the node-local link addresses that some managed Kubernetes networking uses. - Dropped default service-account token.
automountServiceAccountToken: false; a worker that reached the Kubernetes API would have no token to present. - Public-subnet node placement (opt-in). You can schedule the agent pod on a node group that has no route to your private data tier, so a full escape lands somewhere with no path to your databases.
For a self-hosted install, egress is denied by default:
networkPolicy.allowExternalHttps is
false, so Langy cannot reach the internet at all until you enable it. Turning it on for GitHub
is covered in Networking and egress and the GitHub
App setup.What the sandbox can and cannot reach
- Can reach (when configured): the LangWatch API (through the per-session
langwatchCLI credentials), the LangWatch AI Gateway for LLM traffic, andgithub.com/api.github.com/codeload.github.comwhen external HTTPS is enabled. - Cannot reach: RFC 1918 private ranges, CGNAT, and the cloud metadata endpoint. These are blocked at L3/L4 to prevent SSRF and IMDS credential theft, so the block holds regardless of what the worker attempts.
- Reaches only through the adapter, by cooperation: any other external host goes through the L7 egress adapter, which enforces the project allow-list and the operator floor. In the stock pod that path is cooperative, not mandatory: a worker that ignores
HTTPS_PROXYand dials a public address on:443directly is monitored rather than blocked, per the limits above. - Does not keep at rest: the worker writes only to disposable storage. The manager wipes the sessions root on boot, and the idle reaper deletes a worker’s home once it has been idle for 10 minutes, so clones and injected credentials do not survive.