The short version Three ways to wall off code
"Sandbox" sounds like one thing, but under the hood a sandbox is a choice of boundary. The question is always the same: when your code misbehaves, where does the damage stop? The answer depends on which of three isolation models you are standing on, with gVisor as a fourth option in the middle.
The one axis every sandbox sits on
Picture a single dial from thin and fast to thick and slower. A V8 isolate sits at the thin end: your code runs in a shared process and the boundary is the language runtime, so it starts in about 50ms but leans on a lot of shared machinery. A microVM sits at the thick end: your code gets its own kernel on virtual hardware, a real wall, and still boots in roughly 150 to 400ms. A container lands in between at about 90ms, and gVisor adds a user-space kernel that trades some speed for a smaller shared surface.
Where an escape actually stops
The differences look academic until code breaks out. A container and an isolate both share the one host kernel, so a successful escape puts an attacker next to every other workload on that machine. gVisor shrinks that risk by handling most system calls in user space, so fewer calls touch the host kernel at all. A microVM removes the shared kernel entirely: each run has its own, so a breakout stays inside a disposable guest. For code an AI agent just wrote, that is exactly the property you want, which is why microVMs are the default across the AI sandbox pillar.
Why the microVM tax is smaller than you think
The reflex is "a VM per run must be slow and heavy." That was true of full virtual machines, not of microVMs. Firecracker and its peers strip the virtual hardware down to almost nothing, so a fresh guest boots in the low hundreds of milliseconds with only a few MiB of overhead. The strongest wall is now within a rounding error of the weaker ones on start-up, which is why the whole market moved this way.
Live from our vendor data, verified and dated on each vendor page. Start times mix cold boots, warm resumes and isolate starts, see the benchmark for the method.
Frequently asked
What's the real difference between a microVM and a container?
A container shares the host's kernel and draws its boundary with namespaces and cgroups, so one kernel bug can reach the host. A microVM boots its own guest kernel through hardware virtualization, so a breakout stays inside the guest. That extra kernel is the whole difference, and it is why microVMs are the default for untrusted code.
Is gVisor a container or a VM?
Neither, exactly. gVisor runs a small kernel in user space that intercepts the workload's system calls and handles most of them itself, so far fewer calls ever reach the host kernel. It is lighter than a full microVM but a thicker wall than a plain container. Modal uses it, and it starts in roughly 800ms in our data.
Which isolation is safest for untrusted or AI-generated code?
A microVM. Because each run gets its own kernel, generated code that deletes files, opens sockets or loops forever only touches the disposable guest. E2B, Vercel Sandbox and Fly Machines all take this route.
Are V8 isolates safe for untrusted code?
They are a thin boundary built for trusted, short-lived JavaScript, and they start in about 50ms (Cloudflare). For arbitrary untrusted code they are the weakest of the four, since the isolate shares a process and the host kernel with everything else. Great for speed, not for code you do not trust.
If microVMs are so isolated, why are they no longer slow?
Modern microVMs like Firecracker strip the virtual hardware down to the minimum, so they boot in about 150ms with only a few MiB of overhead. The old "VMs are slow" intuition came from full virtual machines, not from these.
Which sandboxes use which model?
In our dataset: Cloudflare pairs a V8 isolate with a container (about 50ms), Daytona is a Docker container (about 90ms), Modal runs on gVisor (about 800ms), and E2B, Vercel Sandbox and Fly Machines are microVMs (about 150 to 400ms).
The Sandbox Brief What moved in the sandbox world, every Friday.
Pricing changes, new entrants, benchmark refreshes and one sharp take from Eve Harper. Read by engineers choosing where their agents and apps run. No fluff. Read the archive.