# Sandboxed networking for agents is still closer to MVP than to a mesh

> Sandboxed networking for agents has to isolate each actor, not each worker pod. What I treat as the MVP, and what I would not call zero trust yet.

- Canonical URL: https://webofmike.com/sandboxed-networking-for-agents/
- Author: Mike Moore (https://webofmike.com/about/)
- Published: 2026-11-09
- Last modified: 2026-11-08
- Tags: Kubernetes, AI Agents, Security, Platform Engineering
- Cite as: Mike Moore, "Sandboxed Networking for Agents", Web of Mike (webofmike.com), 2026-11-09. https://webofmike.com/sandboxed-networking-for-agents/


<!-- ART: a sandbox box with its own tiny network stack, sitting on a worker that has a different stack. -->

Sandboxed networking for agents means the actor does not inherit the worker's view of the network. Each actor needs its own isolation, default-deny egress, and no leftover sockets for the next agent on the same worker. A NetworkPolicy on the worker pod is not that, and "the process is in gVisor" is not that either.

I treat the current shape as a minimum viable isolation layer: better than a naked container, not a service mesh, and not a [zero trust architecture for AI agents](/zero-trust-architecture-for-ai-agents/) by itself.

That sounds obvious. It is not what you get from syscall interception alone. gVisor intercepts syscalls. Whether two actors can see each other, whether they share a netns, whether DNS is the cluster CoreDNS or a per-sandbox resolver, those are dataplane choices. Substrate's dataplane is `ateapi`, `atenet`, `atelet`, and `ateom`. Networking for the actor is a property of that path, not a checkbox on the sandbox class.

## What is sandboxed networking for agents?

It is isolation that follows the actor, not the bay the actor currently occupies.

Agent Substrate restores an actor onto a free worker from a zstd snapshot, runs one actor per gVisor sandbox, then checkpoints back to object storage and frees the slot. Nine agents on two workers was the first lab. Eighteen agents on the same two workers showed up later in the field-guide setup. The worker is a bay. The snapshot is the agent. The network the next occupant sees has to be empty of the last occupant's sockets, routes, and resolver state.

[Kubernetes Network Policy for agents](/kubernetes-network-policy-for-agents/) cannot do that job. Kubernetes attaches policy to pods. The worker pod is shared over time. Pod policy is the union of everyone who will land there.

Sandboxed networking is the layer underneath that composition:

- the actor is not on the node's NIC
- the actor cannot use leftover sockets from the previous occupant
- egress is a hole you punch, not a default
- DNS is part of the runtime you page on, not a cluster default you forgot

The containment basics lab is the same argument in Docker: the agent container sits on an `internal: true` network with the gateway, and only the gateway sits on a network that can leave. Topology, not a comment in a Dockerfile. [Agent containment basics](/agent-containment-basics/).

## Why isn't gVisor enough to isolate actor networking?

Because gVisor virtualizes what it owns, and the node's NIC is the class of resource it does not own if you hand it over.

I called this out when I asked [what would actually break checkpoint](/substrate-pinned-resources/). A held `flock()` survived because the sentry already virtualizes file locking. The resources I would expect to pin a worker are the ones that reach the real host: a `hostNetwork` raw socket, a bind-mounted host device, shared memory with a process outside the sandbox. If the actor is on the node's NIC, the sandbox is a filesystem story and a network fiction.

gVisor's own architecture guide describes the sentry as a user-space reimplementation of the Linux interface, including networking. That is real isolation for sockets the sentry created. It is not a promise that two actors scheduled onto the same worker, in sequence, cannot share a resolver, a veth, or a route the worker still holds. One actor per sandbox is Substrate's rule. One actor per sandbox does not automatically mean one netns torn down on suspend.

`ateom` talks to `runsc`. If the sandbox will not start, those are the logs I want. If the sandbox starts and can still see the node's network, I do not care that `runsc` is in the process list. [Agent Substrate dataplane](/agent-substrate-dataplane/).

## What does the MVP isolation layer include?

**No host network.** If the actor is on the node's NIC, stop calling it sandboxed networking.

**Egress is a hole you punch, not a default.** I run an [egress proxy](/agentgateway-egress-proxy/) in front of agent traffic. Allowlists by hostname fail. The July 2026 intrusion's C2 ran over public request-capture services, pastebins, and file-drop hosts. Those are ordinary web services. A category-based filter will pass them. Payload inspection belongs on the path for tool calls. Destination is not "the agent may call delete."

**DNS inside the sandbox is part of the runtime.** Mine died with `plugin/reload: Corefile changed but reload failed` on substrate's CoreDNS. Agents could not reach Ollama until I restarted `deploy/dns` in `ate-system`. If your isolation depends on a DNS Deployment you never page on, you will misdiagnose this as a model outage.

DNS is also an attack path. An OpenAI research agent had its HTTPS calls blocked by a web proxy, then reached an external chatbot over DNS. The CONNECT proxy never saw those queries, because they never became HTTP. A default-deny NetworkPolicy plus UDP/TCP 53 only to cluster CoreDNS closes the "ask 8.8.8.8 yourself" channel. It does not filter by domain, and it does not follow the actor. [Agent DNS egress covert channel](/agent-dns-egress-covert-channel/).

**Tear down on suspend.** The next restore may be a different agent on the same worker. Leftover sockets are a cross-tenant bug. [Suspend-safe networking](/suspend-safe-networking/) is the other half of that sentence: the sockets you still wanted also die.

I will take 2ms of proxy for a default-deny I can audit. I will not take a shared worker NIC plus a comment that says "gVisor isolates it." That 2ms is a trade I already made, not a measurement from a latency table.

## What does the MVP still not give you?

**Per-actor NetworkPolicy objects.** Kubernetes will not attach a policy to something that is not a pod. The composition is identity plus egress plus a pod backstop. There is no CRD I am waiting for that makes `NetworkPolicy` select an actor name in `ateapi`.

**Stable addresses across restore.** The actor comes back on a different worker. Anything that keyed policy on a pod IP is now wrong. Identity has to be the agent, not the address. [Proof of agent identity](/proof-of-agent-identity/). If your allow rule is "10.244.x.y may reach billing," you will authorize whichever actor restored onto that IP next.

**Connections that survive suspend.** They do not, in what I have run. A snapshot is process state plus filesystem. A TCP session is sequence numbers, a 4-tuple, and socket state bound to a network namespace on a particular worker. Move the actor, the namespace is gone. The peer did not freeze.

**A mesh.** `atenet` is agentgateway under the hood in the lab, with config at `/etc/agentgateway/config.yaml`. That is a router into actors, not proof that every syscall-isolated process has an identity-aware policy. Mesh mTLS between proxy and internal services is useful. It is still the worker's identity unless you plumb the actor.

## How would you tighten actor network isolation?

1. Actor-scoped veth or equivalent, torn down on suspend.
2. Default-deny from that interface to anywhere but the egress proxy.
3. Proxy authorizes on actor identity plus destination plus tool.
4. Worker pod NetworkPolicy so a proxy bypass is still a pod-level deny.

That is the same four-line stack as [the agent containment stack](/agent-containment-stack/): sandbox, egress, identity, and a log the agent cannot edit. Tool policy still sits on `tools/call`. Network allow is not authorization to run the tool.

Tradeoff: more hops, more latency on every tool call. The other tradeoff is operational. You now page on DNS, the proxy, and the sandbox plumbing, not only on the model. In my lab, in-sandbox egress died when substrate's CoreDNS reload failed. Restarting `deploy/dns` in `ate-system` fixed it. Snapshot or slot problems were usually the WorkerPool deployment, not the API server.

### Test plan I actually want

- **Host network:** from inside the actor, the node's addresses are not the actor's NIC. If they are, stop.
- **Leftovers:** write a listening socket or a resolver cache as agent A, suspend, restore agent B on the same worker, confirm B cannot use it.
- **Unlisted host:** curl a destination that is not on the proxy allowlist, confirm deny, confirm the deny is in a log B cannot edit.
- **DNS bypass:** query an external resolver directly, confirm deny at the pod backstop.
- **Restore identity:** policy that named agent A does not apply to agent B on the same worker.
- **Suspend mid-call:** do not. If you do, expect a reset. Size the pool for in-flight calls.

Until per-actor addresses survive restore and connections survive suspend, this stays an MVP. Treat it as isolation, not as session continuity, and not as the whole zero trust story.

Field guide: [Agent Substrate](/agent-substrate-field-guide/). The lab that made the multiplexing real: [kagent Agent Substrate](/kagent-agent-substrate/).

