Where Agents Act: Sandboxes, Micro-VMs and Cloud Browsers
When an agent runs code, installs packages, edits files or clicks through a website, it needs a computer, and that computer must not be yours. A coding agent may run code it wrote seconds ago, downloaded from the internet, or was tricked into writing by a malicious web page. Sandboxes give every task a disposable, isolated machine. This part explains the isolation options from containers to micro-VMs, how two leading coding agents sandbox their work, how network rules stop data from leaking out, and the fleet maths of running millions of short-lived machines.
1. Case file
2. Why agents need sandboxes
rm -rf, a runaway loop, a dependency that fills the disk. In a sandbox the damage ends when the machine is thrown away.Our earlier explainer, Sandboxing AI Agents, covers the security principles. This part covers the infrastructure that delivers them at scale.
3. The isolation ladder
Five ways to fence in code
Tap a rung. Stronger isolation generally costs more start-up time or overhead. Our simplified comparison.
4. Inside a micro-VM
Amazon built Firecracker to run AWS Lambda and Fargate: a minimal virtual machine monitor that uses the Linux kernel's hardware virtualisation (KVM) but leaves out almost every device a normal VM emulates. Each micro-VM gets its own guest kernel, so a bug in the agent's code would have to break out through hardware virtualisation, a far smaller attack surface than the shared kernel of a container. As reported from the team's NSDI 2020 paper, a guest reaches its init process in about 125 ms, each VM adds under 5 MiB of host memory overhead, and a host can create up to about 150 micro-VMs per second. Firecracker also runs each VM inside a "jailer" process with seccomp filters, so even the monitor is boxed in. Many agent-sandbox companies build on it; third-party comparisons quote end-to-end starts around 150โ200 ms โ ๏ธ.
gVisor, from Google, takes a different route: a user-space kernel (the "Sentry", written in Go) that intercepts the program's system calls and implements most of them itself, passing only a filtered subset to the real kernel. It starts like a container but costs speed on system-call-heavy work; a 2019 study measured 2โ11ร slower system calls, though newer gVisor platforms improve on that.
5. Two coding agents
The common pattern: isolate the filesystem, cut or allowlist the network, strip secrets before the agent runs, and ask a human only for actions that leave the box. That last rule is what turns a sandbox into a productivity feature, not just a safety one.
6. Network egress: the door that matters most
What gets out?
Choose a policy; see which of an agent's attempted connections succeed. Our illustration.
A sandbox that can reach any host on the internet can leak anything it can read. That is why default-deny egress with an allowlist (package registries, the code host, the documented API) is becoming standard, with every blocked attempt logged for review (Part 7).
7. Cloud browsers
Agents that use websites need a real browser: one that runs JavaScript, keeps sessions and can be watched. Running thousands of headless browsers is its own infrastructure business; Browserbase reported a $40M Series B at a $300M valuation in June 2025 โ ๏ธ. Browser sandboxes add problems of their own: logins and cookies (identity, Part 5), anti-bot defences that block automated traffic, and untrusted page content that may carry prompt injections. Computer-use agents that operate a full desktop extend the same idea to a whole virtual machine with a screen.
8. Fleet maths
How many hosts does an agent product need?
Our model: concurrent sandboxes = tasks per hour ร minutes per task รท 60; hosts = concurrent รท sandboxes per host.
These are CPU servers, not GPUs: the model runs on the inference fleet, while sandboxes do the cheap but numerous work around it. On our AI factory site plan, they sit in Data Hall B beside the inference racks.
9. The series
Inside the Agent Layer: eight parts
10. Reading the numbers
- Primary / widely confirmed
- Codex cloud: per-task containers, setup vs agent phase, agent internet off by default, secrets removed (OpenAI docs and Codex system card). Claude Code native sandbox: bubblewrap / Seatbelt, filesystem and network isolation, 84% fewer prompts internally (Anthropic engineering, Oct 2025). gVisor design (gVisor project).
- Reported โ ๏ธ
- Firecracker 125 ms, <5 MiB, ~150 VMs/s (secondary summaries of the NSDI 2020 paper). gVisor 2โ11ร syscall overhead (2019 study, possibly outdated). Vendor start times (~150โ200 ms) and session limits. Browserbase funding.
- Our illustrations
- Isolation ladder ratings, egress simulator, fleet calculator.