Infrastructure Review Stack

KVM-Based Microvm Isolation vs Container Isolation

Isolating untrusted AI agents requires choosing whether workloads share the host kernel.

· 10 min read
Cover illustration for “KVM-Based Microvm Isolation vs Container Isolation”
Secure Isolation Primitives · October 4, 2026 · 10 min read · 2,275 words

A prompt injection buried in a scraped webpage tells an AI agent to read /etc/passwd and exfiltrate a database credential over the network, and nothing in the agent's code stops it, because the agent is just a Linux process and that process shares a kernel with everything else on the box. The question that decides whether this scenario is a shrug or a five-alarm incident is simple to state: does the workload share the host kernel? Every other property people argue about when they pick a sandbox for untrusted code, how fast it starts, how many you can pack on one machine, how much blood is lost if one goes bad, falls out of the answer to that single question.

The kernel boundary as the only architectural question that matters for untrusted code

AI agents write files, run shell commands, and call tools faster than any human reviewer could read the diff, which turns the isolation boundary from an operations detail into a decision made at design time. The familiar threat vectors, prompt injection, tool poisoning, credential theft through MCP servers, aren't new in kind. What's new is the speed and autonomy with which an LLM can act on them, and what's constant is what happens the instant that execution lands on a kernel shared with other tenants: a nuisance becomes a breach.

A confused deputy, a compromised agent that still presents valid credentials, causes most of these incidents. A compromised agent with valid credentials looks, to an RBAC system, exactly like an uncompromised one.

So the question reduces to something precise and answerable: when untrusted code runs, does it execute against the same kernel instance as everything else on that machine, or against its own? Blast radius, startup cost, density, and how state is handled all follow from that answer. That is why the rest of this piece treats each of them as a consequence rather than a separate topic.

How containers draw their boundary

A container is a Linux process that the kernel has been told to lie to. Namespaces change what the process can see, cgroups cap what it can consume, capabilities trim what privileged operations it can attempt, and seccomp-bpf filters which syscalls it's allowed to make. None of these mechanisms create a second kernel. No matter how many containers run on a node, every one of them executes against the exact same kernel instance as the host and every other container sharing that machine.

That means the isolation boundary a container relies on is the Linux syscall interface itself, a large, decades-old surface that has a long history of exploitable bugs. Every time code inside a container makes a call, it reaches the real host kernel through that interface. If a permitted syscall touches a kernel vulnerability, the process has crossed into territory the host and every neighboring container also occupy. A container escape is never contained to one tenant, because there was only ever one kernel underneath all of them.

The kernel is free to decline that suggestion, and when a kernel bug lets it, the namespace and cgroup walls that looked solid a moment earlier turn out to have been drawn in chalk.

None of that makes containers a poor technology. But the trade turns bad if the code running inside wasn't written, reviewed, or trusted by whoever owns the host, and that's exactly the situation an AI agent creates by default when it executes generated commands.

MicroVMs and hardware virtualization

A microVM answers the exact weakness the previous section describes: it gives the workload its own guest kernel. Strip a virtual machine down to what one workload actually needs, a dedicated guest kernel, a minimal virtual device model, and a hardware-enforced wall between that guest and the host, and the result is a microVM. It carries the same isolation property that separates two physical servers sitting in different racks, but at a cost that is much closer to a container's than to a traditional VM's.

The mechanism runs through the CPU itself. A syscall made inside the guest hits the guest's own kernel first; the host kernel is never reachable unless something breaks out of that guest kernel. Firecracker, the microVM technology AWS built and that underpins the production examples discussed later in this piece, was designed around a specific goal: move the security-critical boundary away from the general-purpose OS interface and onto one backed by hardware and a much smaller software layer, while keeping the virtual machine monitor itself inside that trust boundary. Even the hypervisor is boxed in.

The device model matters just as much as the kernel split. Fewer emulated devices means a smaller surface facing the host, which narrows what a guest could exploit to reach the host even in the event the guest kernel itself were compromised.

Traditional full VMs built on KVM and QEMU, or on VMware, offer this same hardware-level wall, but they carry a heavier device model: emulated BIOS, virtual PCI buses, a virtual GPU, the trappings of a full general-purpose machine. A microVM keeps the hardware boundary and throws out the bulk that boundary never actually required. PandaStack frames the result as VM-grade isolation at a cost much closer to containers than to full VMs, and its introduction calls the microVM "the third thing that didn't widely exist a decade ago": a stripped-down VM with its own guest kernel and a tiny device model.

Once untrusted code, whether AI-generated or supplied by an unrelated tenant, needs to run at any real scale, you have to answer this kernel-boundary question. Purpose-built sandbox infrastructure such as Daytona builds on hardware-enforced microVM isolation specifically so that a confused-deputy failure or a stolen credential cannot travel past the single workload that produced it, treating the kernel boundary as a starting requirement for the architecture rather than something bolted on after an incident.

Practical trade-offs that follow from the kernel split: blast radius, startup, density, state

Diagram: One Kernel Question, Four Consequences. Visualizes: Visualize how the single architectural decision — shared kernel (container) vs.

Once the kernel question is answered for a given workload, five engineering dimensions resolve in a predictable direction: blast radius, startup time, memory overhead, density, and how state gets handled.

Blast radius is the most direct consequence. In a container, a permitted syscall that reaches a kernel bug reaches a kernel the host and every other container also depend on, so a single escape is a multi-tenant event by construction. In a microVM, a guest OS and CPU-enforced privilege separation stand in front of the host kernel, so an escape has to break the hypervisor boundary itself, a far smaller and far more heavily scrutinized surface than the entire Linux syscall interface. DigitalApplied's isolation pattern guide names microVMs as the industry standard specifically for the cross-tenant data-leakage threat class: multi-tenant platforms carrying compliance-sensitive workloads.

Startup time looks, at first glance, like it should favor containers outright, and for a narrow comparison it does: a warm container with its image already pulled starts in milliseconds, because there's no guest kernel to boot. But if a microVM cold boots, VMM start plus guest kernel boot, that isn't automatically slower in practice. The comparison that actually means something measures a warm container against a restored microVM, both from request to runnable environment, because benchmarks that fold in image pulls and orchestration overhead measure the platform around the runtime, not the runtime itself.

Memory overhead and density work the same way, just pointed in the other direction. A microVM adds a VMM process and its own configured guest RAM for every instance, so the real comparison isn't raw process count, it's how many isolated executions a given host can sustain at the trust boundary the product actually requires. Firecracker's stripped device model keeps that per-guest overhead in the single-digit megabytes for kernel and device model combined, well under the hundreds of megabytes to multiple gigabytes that a full VM adds per instance.

State handling draws the sharpest line between the two models. MicroVMs support snapshotting the entire machine mid-task: working directory, installed dependencies, running processes, and warm page cache, all frozen to disk exactly as they stood, then resumed later without the guest ever seeing what looks like a reboot. The pattern that has emerged for long-running agents is a single durable microVM per run that hibernates when idle, snapshotting the moment the agent hands control back to the model, so idle cost rounds to zero and execution resumes from precisely where it paused. The same snapshots double as crash-recovery checkpoints: restore the last one instead of restarting an entire run, and the worst-case loss is bounded to whatever work happened since the last checkpoint.

Containers still do density and startup speed well for trusted, first-party workloads, so they remain the standard choice for internal services.

Where the microVM boundary falls short

A microVM's hardware-enforced wall and separate guest kernel are the right primitive for genuinely hostile code, but the honest caveat is that the VMM is software and KVM is software, and both have shipped real bugs. The boundary a microVM provides is narrower and far more scrutinized than the full Linux syscall interface a container relies on, which is a meaningfully different claim than saying it can't be broken.

KVM itself has had guest-to-host escape CVEs over the years, and Google runs a bug bounty program, kvmCTF, that pays out specifically for finding new ones, which only makes sense because they exist and keep being found. A guest with root privileges, which describes any compromised AI workload running arbitrary generated commands, could in principle crash the VMM process or, in the worst case, execute code on the host itself. AWS patched a Firecracker vulnerability of exactly this type; no AWS services were affected by it, but the vulnerability class it belonged to is real and worth taking seriously rather than dismissing because that one instance was caught in time.

gVisor offers a different answer to the same problem. Rather than running a full guest kernel inside a hardware-fenced VM, gVisor intercepts syscalls in user space through an application kernel written in Go, so agent code never touches the host kernel's syscalls directly. That design removes the VMM attack surface from the picture entirely, at the cost of blocking direct GPU passthrough and slowing down workloads that make heavy, repeated syscalls. DigitalApplied's sandboxing guide calls gVisor a pragmatic middle ground for multi-tenant container platforms where the risk of a kernel escape is real but a full microVM costs too much, and it treats that as a genuine engineering choice, not a fallback for teams that couldn't afford the real thing. Its own interception layer has had vulnerabilities of its own, so the stronger theoretical wall it places between a workload and the host kernel comes with its own surface to patch and watch.

None of these three options, a plain OS-level process sandbox, gVisor, or a microVM, ranks the others out of existence. They map to different threat models, and the practitioner's job is matching the tier to the workload rather than reaching for whichever one sounds strongest on paper.

The industry's convergence on microVMs for production AI agent workloads

Diagram: Industry Convergence on Dedicated Kernel Isolation. Visualizes: Visualize the timeline of major platform commitments to hardware-enforced kernel isolation for AI agent workloads, each mapped to its specific technical mechanism.

The shift away from retrofitted containers and toward purpose-built microVM runtimes is visible in the choices major platforms have made since early 2026, and each of those choices traces back to the same kernel-boundary logic laid out above. AWS Lambda MicroVMs reached general availability on June 22, 2026, turning what had been an internal isolation primitive into a new serverless compute type with its own API: a dedicated, hardware-isolated, stateful virtual machine per user, per session, or per job, launched from a snapshot in near-real time, built for the workload of running code the platform's own developers didn't write, whether that code came from an end user or from an LLM. AWS Bedrock AgentCore applies the same logic at the session level, provisioning a dedicated Firecracker microVM, the identical technology underlying Lambda, for each Code Interpreter or Browser session, with no execution state, filesystem artifacts, or memory contents carrying over between sessions, positioned as the execution layer for agents that clone repositories, install dependencies, and run test suites on code nobody has reviewed yet. Deno Sandbox entered beta on February 3, 2026, as Deno's own managed service for running untrusted or AI-generated code, with each sandbox running as a dedicated Firecracker microVM inside Deno Deploy's infrastructure.

Not every hyperscaler has converged on the identical mechanism, and the variation still confirms the same underlying principle: Cloudflare's Sandboxes product uses V8 isolate-based isolation rather than containers, Google's GKE Agent Sandbox runs gVisor as a cloud-native primitive, and Azure Container Apps dynamic sessions rely on Hyper-V microVMs with hardware-level isolation. Each of these is a different technical route to the same place: put a boundary stronger than a shared Linux kernel between untrusted code and the host, because the threat model untrusted AI-generated code presents demands it.

What makes AWS's move notable is the packaging, not just the technology choice. Turning microVM isolation into a named, independently purchasable primitive, rather than leaving it as an internal implementation detail inside Lambda or AgentCore, signals that this kind of isolation has moved out of the infrastructure layer and become a product category that buyers now evaluate and choose on its own terms. For engineers building agent infrastructure today, platforms in this space, Daytona among them, compete specifically on how well they deliver that hardware-backed boundary: sub-second provisioning paired with the kind of process isolation that used to require a full, slow-booting virtual machine to obtain. You get speed without sacrificing the kernel-level wall, and that combination is why the microVM has become the default answer for running code nobody on the receiving end actually wrote.

Sources

  1. Daytona - Secure Infrastructure for Running AI-Generated Code

More in Secure Isolation Primitives