Container Isolation vs Micro-VM Isolation for Agent Sandboxing
Kernel boundaries matter more than startup speed when sandboxing untrusted agent-generated code.

An autonomous agent can write and execute code faster than any human can review it, and that single fact is what makes the kernel boundary the only isolation question worth asking. Containers and microVMs differ on one structural point: containers share the host kernel, while microVMs give each workload its own guest kernel enforced by hardware virtualization, and Vercel's August 2026 guide states directly that every other difference in startup time, density, and blast radius follows from that split. For reviewed, first-party code, this distinction has long been academic. For code generated in response to a user's prompt, it is the entire security model.
The kernel boundary as the central isolation question for agents
The reason this matters specifically for agents comes down to a problem security engineers call the confused deputy: an agent process inherits ambient authority, including database credentials, filesystem permissions, and network access, and a prompt injection does not need to resemble a hack at all. It only needs to ask the authorized deputy, politely, to run a destructive command. Cosmonic's sandbox guide lays out the attack patterns that follow from this directly: tool poisoning through malicious MCP servers that inherit an agent's permissions, prompt injection that walks a summarization task into exfiltrating SSH keys, credential theft through compromised MCP tool discovery, and lateral movement from the agent process into an internal network via inherited service mesh credentials. None of these require a vulnerability in the traditional sense. They require only that the agent do what it is told, by whoever manages to tell it something.
This changes what isolation is for. With first-party code, the review process is the control, and the sandbox is a backstop. With agent-generated code, there is no review process operating at the speed the agent runs, so the sandbox becomes the only control that exists. That reframes the choice between containers and microVMs from an operations question, concerned with density and cost, into a security architecture question, concerned with what a successful exploit can actually reach. Everything that follows, startup latency, packing density, billing models, vendor design choices, is a consequence of deciding where that kernel boundary sits.
How containers enforce their boundary
A container's isolation is built entirely in software. Linux namespaces partition what a process can see, cgroups cap what it can consume, capabilities split apart privileged operations that used to be all-or-nothing, and seccomp-bpf filters restrict which syscalls a process is even allowed to make. All of these controls, however sophisticated, are enforced by the same kernel instance that serves the host machine and every other container running alongside it. Namespaces change what a process can see, but they do not create a second kernel, and a syscall that is permitted by policy but happens to exercise a kernel vulnerability crosses directly into a kernel shared with the host and every neighboring workload, as Vercel's guide states.
This is not a hypothetical risk reserved for security conference talks. Runc flaws disclosed in 2024 and 2025 allowed container escapes to the host, and the tools most teams reach for by default were not built with LLM-generated untrusted code as the threat model. Even the hardened variants of container isolation sit on the same structural limit. Rootless Podman carries its own documented CVEs, and gVisor interposes a user-space kernel that intercepts syscalls before they reach the host kernel, which narrows the surface considerably but still ultimately runs on that host. The boundary it improves is still the same shared kernel.
None of this makes containers the wrong tool. For reviewed first-party code, for homogeneous workloads operating under a single trust model, or for platform services running inside a cluster where provenance is known and trusted, containers remain the right answer, and they pack far more densely than that other approach. There is also a legitimate edge case where teams accept the weaker boundary by necessity rather than preference: some production deployments use containers because both the user and the agent need GPU access, and VM passthrough is too friction-heavy, so teams choose the shared-kernel tradeoff deliberately. It is a conscious acceptance of risk, with the two boundaries offering different levels of security.
Firecracker's implementation of the microVM boundary
A microVM moves the first line of enforcement out of software and into the CPU itself. Each workload boots its own guest kernel behind hardware virtualization through KVM, so the guest kernel absorbs the workload entirely before the host kernel becomes reachable at all, which is a structural difference from namespace isolation rather than a more aggressive version of it. Firecracker, the implementation that has become dominant for agent sandboxing, makes this concrete through a handful of specific design choices. Its virtual machine monitor exposes only five virtual device types, compared with the hundreds that QEMU supports, cutting out decades of legacy device emulation code that accounts for most of the attack surface in traditional hypervisors. One VMM process runs per microVM, rather than a single daemon managing all VMs on the host, so a compromised guest process cannot reach sibling workloads through a shared management plane. And because the guest kernel only needs to support what the workload actually does, teams can strip it down further still, shrinking the host-facing surface beyond what the default configuration already offers.
The latency cost of this design has fallen further than most engineers expect. Firecracker boots a dedicated Linux kernel per sandbox in approximately 125 milliseconds, and with prewarmed snapshot pools, cold start collapses to under 50 milliseconds, so the startup gap that was the canonical objection to VMs has largely closed as a practical matter. The Firecracker design paper, cited in Vercel's guide, frames the underlying philosophy precisely: move the security-critical interface from the OS boundary to one supported by hardware and by comparatively simpler software, and keep the VMM itself inside the trust base rather than treating it as an afterthought.
None of this makes a microVM a complete security solution, and no credible account of the technology claims otherwise. Network egress remains a live risk in any sandbox that permits outbound connections. Side-channel and microarchitectural attacks are not addressed by hardware virtualization. A compromised system prompt still executes with whatever permissions the sandbox grants it, regardless of what kernel is underneath. Digital Applied's May 2026 guide states the goal of sandboxing directly: it exists to constrain the blast radius, not to make agents trustworthy. A microVM changes what a successful attack can reach. It does not change whether an attack succeeds.
Which threats each boundary defeats: a direct mapping
The useful question for a team shipping an agent product is not which isolation model is generically superior, but which specific threats each boundary actually defeats, since the answer changes by threat category and the deciding variable in every case is the provenance of the code being run. Drawing on Digital Applied's threat matrix alongside Vercel's guide, a few categories make this concrete. Filesystem access outside an agent's intended scope is addressed at a basic policy level even by OS process sandboxes, and containers with seccomp profiles narrow this further, though they still rely on the same underlying kernel that a microVM removes from the equation entirely. Network egress to arbitrary external domains is a harder case: microVMs add network namespace isolation that strengthens the guarantee, but no sandbox tier fully defeats exfiltration if outbound connections are permitted. This risk persists regardless of which boundary a team chooses. Exposure of the host kernel's syscall surface splits cleanly along the line this piece has been drawing: containers share that surface outright, hardened runtimes narrow it without eliminating it, gVisor interposes a user-space kernel so agent code never touches host syscalls directly, and Firecracker's dedicated per-sandbox kernel makes the host kernel unreachable through the guest altogether. Container namespace isolation handles cross-tenant data leakage in multi-tenant deployments adequately for low-risk workloads, but Digital Applied states that microVMs are the industry standard once the deployment is compliance-sensitive. Secret exfiltration through environment variables or procfs inspection is a risk containers inherit directly from the shared process environment, while microVM isolation keeps the guest environment separate from the host by default. Prompt injection that leads to privileged command execution is defeated by no sandbox tier: every boundary described here reduces the blast radius of a successful injection, not the likelihood of the injection succeeding.
From this mapping, a clear decision rule follows, and Vercel's guide states it directly: reviewed first-party code operating in a known trust model is well served by hardened containers, which pack more densely and cost less to run, while agent-generated or tenant-supplied code whose behavior cannot be known in advance calls for a per-workload kernel as the appropriate boundary. Teams running both kinds of workload side by side do not need to choose one architecture for an entire cluster.
Latency and density in production once the boundary is chosen
The two practical objections to choosing a microVM boundary are latency and density, and both turn out to be smaller problems in production than they appear on a spec sheet. On latency, the relevant comparison is not a fresh container against a freshly booted VM. Agent tasks run on the order of seconds to minutes, and snapshot restore changes the comparison from "container versus cold-boot VM" into "warm container versus restored memory image," which is a far narrower gap. The honest latency comparison measures a warm container against a restored microVM from request to runnable environment, since no production system serving latency-sensitive traffic boots a fresh guest kernel on the hot path. Celesto AI's April 2026 benchmark of SmolVM, a Firecracker-backed runtime, found a boot time of approximately 500 milliseconds on an AMD Ryzen 7 7800X3D, about 400 milliseconds slower than a cold Docker start, but with prewarmed snapshot pools, both SmolVM and Firecracker collapse to under 50 milliseconds cold start. That single named benchmark should be read as a data point about SmolVM specifically.
Density follows a similar correction. The tradeoff is real, but it is usually framed around the wrong unit: the question a production system actually needs answered is how many isolated executions a host sustains at the trust boundary the product requires, not how many bare processes the host can hold. Memory overhead per Firecracker instance runs 128 megabytes or more, against 50 to 200 megabytes for a typical container, yet Firecracker can spin up many VMs per second on a single host with very low per-VM overhead. Once snapshot-restore enters the picture, the entire comparison shifts again: pausing and resuming a microVM preserves its full state, memory and filesystem included, so the same instance resumes exactly where it stopped. That capability is what makes per-user agent deployment viable both economically and in terms of latency, because an agent that sits idle most of the time stops paying for compute it is not using and pays for storage instead.
The idle-billing model for multi-tenant agent fleets at scale
The architecture decision made above has a direct economic consequence, visible in how sandbox providers bill for idle time rather than in their headline per-hour rate. A benchmark run against realistic agent workloads found that cost spread between providers was driven largely by whether a provider bills wall-clock time for the entire life of a sandbox or only for active CPU usage, and that suspend and auto-pause behavior turned out to be the single most powerful lever for controlling cost. The same benchmark found Vercel's active-CPU metering came in cheapest for its reference workload, while providers billing by wall-clock time landed meaningfully higher for the same work. Enabling auto-pause changes those numbers substantially: cost per thousand executions drops sharply once idle sandboxes stop accruing charges, a pattern the same research cites as consistent across providers using comparable auto-pause economics.
The cause of this is specific to how microVMs handle state. Snapshot-and-restore lets an idle agent pay for storage rather than compute: the guest's memory image gets written to disk, the VMM process terminates, and the agent resumes from that snapshot the next time it is invoked. This is the identical mechanism underlying AWS Lambda, which runs on Firecracker and handles trillions of function invocations a month using exactly this pause-and-resume design. What makes this more than an efficiency footnote is the shift toward per-user agent architectures. Production systems today run roughly three tenancy models: organization-as-tenant, agent-as-tenant, and user-as-tenant, where every individual end user gets their own fully isolated microVM. User-as-tenant is the highest-isolation model and was, until snapshot-restore scheduling matured, also the most expensive to run at any real scale. Turning idle time into a storage cost rather than a compute cost is what makes consumer-scale, per-user microVM deployment financially workable rather than a theoretical best practice nobody can afford.
How leading sandbox platforms implement these tradeoffs in 2026
Every major sandbox platform operating in 2026 turns the architectural choices described above into visible product decisions. Isolation type, standby behavior, billing model, and compliance posture are not independent marketing features; they are downstream consequences of where each platform drew its kernel boundary, and they are worth reading that way. One prominent open-source platform runs Firecracker microVMs under an Apache 2.0 license and has grown quickly enough to run 850,000 sandboxes a day as of May 2026. It has added MCP support giving agents access to more than 200 tools drawn from the Docker MCP Catalog, though it currently has no GPU path available.
Vercel's own Sandbox product reached general availability on January 30, 2026, running Firecracker microVMs on Amazon infrastructure. Its active-CPU billing model, discussed in the previous section as the cheapest option in an August 2026 benchmark, is a direct product expression of the idle-cost argument this piece has traced from the kernel boundary all the way through to the billing line. That alignment, architectural choice shaping latency, shaping density, shaping cost, is the throughline that matters most for any team evaluating these platforms: the kernel boundary a provider chose on day one still explains the invoice a customer receives.