Why Agent Sandboxes Are Moving to MicroVMs

Picture the kind of agent demo that does the rounds online, with a quiet horror baked in. The agent runs rm, curl or pip install straight on the presenter's laptop, next to their SSH keys and a .env file full of API tokens. Everyone claps. I'd wince. Agent sandboxes exist because "it probably won't do anything weird" is not a security model, and the industry is settling on microVMs as the default box.
What agent sandboxes need to be
A good agent sandbox has three jobs. Keep the agent away from your real machine. Start fast enough that you can give every session its own box. And let you undo mistakes. Containers do the first job less well than people assume, because they share the host kernel. Full virtual machines do it well but traditionally boot slowly and eat memory.
Firecracker sits in the middle. AWS built it to run Lambda functions, open-sourced it under Apache 2.0, and wrote it in Rust. It cuts the virtual hardware down to five emulated devices, which shrinks the attack surface, and the project quotes boot times under 125 milliseconds with under 5 MiB of memory overhead per microVM. That is VM-grade isolation at something close to container prices.
E2B: a whole computer per session
E2B is the clearest example of where this goes for agents. Its open-source runtime gives every agent session one Firecracker microVM, in its own cgroup and network namespace, with an egress firewall that can allow or deny domains. The clever part is that "creating" a sandbox actually means restoring a snapshot of a pre-booted machine. Memory pages load lazily as the sandbox touches them, so new boxes feel instant.
Snapshots also give you time travel. E2B's fork call pauses a running sandbox, captures its files, memory and running processes, and boots copies from that exact moment. The SDKs let you ask for up to 20 forks in one call.
A quick example
Say your coding agent has spent ten minutes installing dependencies and loading a big dataset. Now you want it to try three different fixes for a flaky test. Instead of repeating the setup three times, you fork the sandbox into three copies and let each attempt run in parallel. The loser gets thrown away. If one of them runs a destructive migration, who cares? It was a copy.
The AgentBox name tangle
While researching this I ran into two different open-source projects called AgentBox, which is a fun way to lose an afternoon.
One, by Travis Burmaster, is a security-first wrapper built on OpenClaw, the self-hosted agent framework. It encrypts secrets at rest with age, restricts outbound traffic to an allowlist, and supports VM snapshots for rollback. Its recommended setup is Docker, with full VMs through UTM, VirtualBox or QEMU. It is not Firecracker-based, and its secrets are decrypted in memory inside the box, so the agent's environment can still reach them. Keeping keys entirely outside the box is a different pattern, which I cover in my post on credential proxies.
The other AgentBox, from the GitHub user madarco, launches Claude Code, Codex or OpenCode in a dedicated VM with one command, on your machine or on providers including E2B, Daytona and Hetzner. It keeps your git credentials on your laptop and asks permission before pushing.
My take is simple: if an agent can run shell commands, it gets its own machine, and the machine should be cheap enough to throw away. Firecracker made that affordable for Lambda first. Here is the surprising bit: Firecracker began from crosvm, the virtual machine monitor in Chromium OS. What would you let your agent try if you knew every mistake was one fork away from undo?