Est.

Isolated VM Requirements for Reliable Agent Execution

Untrusted agent code requires VM-level isolation, not just containers.

· 10 min read · Updated
Cover illustration for “Isolated VM Requirements for Reliable Agent Execution”
Cloud Agent Environments · October 12, 2026 · 10 min read · 2,282 words

An AI agent that writes and runs its own code needs a different kind of infrastructure than a human developer does, because nobody reads the code before it runs. When an agent acts, the code executes as part of its own reasoning, often dozens of steps deep, before anyone sees what happened. A single agent session can chain together hundreds of file writes, package installs, API calls, and browser actions, and each step builds on the last, so a bad decision made early in the chain compounds through everything that follows it.

The agent inherits the full authority of the user or service account that launched it, because that's how operating systems have always assigned permissions to running code. A prompt injection attack doesn't need to break anything, because the agent itself can be tricked into acting as a confused deputy, using its own excess authority on the attacker's behalf.

Why containers alone do not close the isolation gap for agent workloads

Most engineering teams already run containers, and for a large share of workloads that's the right call. A trusted, single-tenant service with known code doesn't need more than a standard container runtime provides. The trouble starts when the code running inside that container wasn't written by anyone on the team, wasn't reviewed before execution, and might be actively hostile. Containers isolate the filesystem and the process tree, but every container on a host still shares one kernel, and that shared kernel is exactly the boundary that matters when the code inside is untrusted.

If an agent triggers a kernel privilege escalation, whether through a deliberately crafted prompt injection or an unlucky dependency vulnerability, the exploit can carry it straight out of the container and onto the host. In practice this means one compromised agent session can reach not just the host node but other workloads running on it, which collapses tenant isolation at the exact layer most platforms assumed was solid.

Teams that have already invested in self-hosted Kubernetes fleets often assume that separate pods give them the separation they need. These are two separate problems that get treated as one. Locking down the agent process itself is a different job from sandboxing the code that process produces. A tightly restricted agent that then hands its generated code full filesystem or network access has simply moved the unsolved exposure one layer deeper. It has just moved it one layer deeper.

The isolation technology options, and why microVMs are the production standard for agent code

Three isolation approaches cover most of the agent execution landscape today, and picking between them comes down to the threat model and the shape of the workload. For multi-tenant production agent execution specifically, microVMs have become the reference point most teams build around.

gVisor intercepts system calls through a userspace kernel, which cuts down sharply on how much of the syscall surface ever touches the real host kernel. For compute-heavy AI workloads that don't need full VM isolation, it's a sound middle ground.

Firecracker, the open-source microVM technology AWS released, boots a dedicated Linux kernel for every sandbox. Because each workload gets its own kernel, an exploit that compromises the guest kernel stays contained inside that one VM. Firecracker supports only a minimal set of device types, which cuts the attack surface down sharply compared to a general-purpose hypervisor like QEMU, and it boots in around 125 milliseconds. It's the same foundation that has powered AWS Lambda since 2018, and it has become the industry's go-to for high-security agent sandboxing.

Kata Containers takes a different path to a similar destination: it orchestrates virtual machine monitors, including Firecracker, Cloud Hypervisor, and QEMU, to deliver the same hardware-level isolation through standard container interfaces. Boot times run around 150 to 300 milliseconds depending on the VMM and configuration chosen.

The consensus among practitioners heading into 2026 treats microVMs or gVisor as the actual isolation boundary, with hardened containers layered inside as a second line of defense. Teams building serverless or multi-tenant agent platforms from scratch tend to reach for Firecracker directly, given its track record underpinning Lambda since 2018.

Per-session isolation as a functional requirement, not just a security posture

Per-session isolation, where every agent session runs inside its own dedicated VM boundary, tends to get framed as a security feature. It's better understood as the requirement that makes every other control on this list actually mean something. Without a hard boundary around each session, there's no way to enforce resource limits, network policy, or audit attribution against any one session specifically, because there's no reliable way to tell which session did what.

The security framing also undersells the reliability cost of getting this wrong. The affected session is now building its next step on data or context that doesn't belong to it, which produces wrong answers even when nothing has been stolen or damaged.

This is where deterministic teardown matters. A properly isolated sandbox can be destroyed completely at the end of a session, with no state left behind for the next task to accidentally inherit. That kind of teardown only means something when each session already has its own boundary; in a shared environment, there's no clean line to tear down along. MicroVMs with suspend and resume support let agents hold onto state within a single session, pausing and restoring a VM without weakening the boundary around it or bleeding into another tenant's session.

Scoped networking: why default-deny egress is the single most consequential network control

Agents need to reach the outside world to do useful work: package registries, external APIs, MCP servers. That same outbound path is also the most direct route for a compromised agent to exfiltrate data, so the goal isn't to cut off network access, it's to shape it precisely. The right standard is default-deny egress: block every outbound connection unless it's been explicitly allowed. That single control closes off most of the exfiltration surface without forcing a team to build a complete allowlist before an agent can do anything useful.

The fix follows a clear hierarchy. Default-deny egress forms the base layer. Put together, this is capability scoping applied to the network: the same fine-grained control over what's reachable that a well-built sandbox already applies to the filesystem, extended to cover outbound traffic as well.

Resource limits as the control that keeps one runaway agent from degrading every other session

Isolation stops one session from reaching into another's data or state, but it does nothing to stop one session from consuming every CPU cycle and megabyte of memory on a shared host. That's a separate failure mode, and it needs a separate control: hard per-session limits on CPU, memory, and I/O. Without them, a single runaway agent, whether from an infinite loop, a recursive tool call spiraling out of control, or a package install that balloons far past expectations, can degrade or outright kill every other session sharing that host.

This failure doesn't require anything adversarial. Resource limits, covering CPU, memory, network, and time, sit alongside isolation and auditability as the named properties of a sandbox built for this kind of work. Time limits deserve their own mention here: a hard time-to-live on a session prevents a stuck or looping agent from running forever, and it's what separates a legitimately long engineering task from a runaway process that needs to be killed.

The strongest version of this control lives at the hypervisor layer, where microVMs enforce it outside the reach of anything running inside the guest. Code inside the sandbox cannot talk its way around a limit set below it. And once resource consumption is tracked per session rather than pooled across a shared host, it becomes possible to attribute cost accurately to a specific task, which is the first building block of the cost and performance analytics teams eventually want to build on top of their agent platforms.

Fast provisioning as a requirement for agents that deploy, retry, and branch at machine cadence

Provisioning speed that feels perfectly fine for a human deploying code becomes a real tax once an agent is the one spinning environments up and tearing them down. A human who kicks off a 30-second environment spin-up can take a sip of coffee and move on. An agent doesn't have that luxury: provisioning happens on every task and every retry, and an agent sitting idle while infrastructure boots is an agent burning through context window and API budget while producing nothing.

The bar for 2026 production systems sits under one second for cold start, with the strongest implementations booting in 125 to 150 milliseconds using Firecracker. The gap between that and a microVM boot of roughly 125 to 200 milliseconds isn't a minor performance difference. For agentic workflows that deploy, retry, and branch constantly, it's the line between a workable system and one that can't keep up with how the agent actually operates. Copy-on-write snapshots push this further: a pre-warmed VM image with dependencies already installed can restore in a fraction of the time a cold boot takes, letting an agent start from a known-good state without paying full initialization cost on every single task.

Slow infrastructure doesn't just waste time: it creates the incentive that breaks the isolation boundary the rest of this piece has been building toward.

Audit logging as the mechanism that turns agent execution from a black box into an attributable record

The first four requirements all work to prevent something bad from happening. Audit logging works differently: it doesn't stop a failure, it makes every action the agent took observable and attributable after the fact. Every action inside the sandbox, from a file write to an API call, should be logged as a matter of course, alongside isolation and deterministic teardown as a defining property of a sandbox built for this kind of work.

This is not the same thing as application logging. What an agent's code writes to stdout tells a team what the code thought it was doing. Infrastructure-layer audit logging captures what actually happened at the execution environment: what ran, what it produced, what resources it consumed, which external endpoints it reached, and exactly when each step occurred. A log that only records whether a session succeeded or failed can't answer the question that actually matters when something goes wrong.

That question usually involves tracing backward through a chain of steps. Because agent sessions are multi-step and stateful, a failure that surfaces at step 40 may trace back to a decision made at step 5, and only a log built with step-level traceability can recover that chain. Taken further, attribution down to the specific harness, model, and credential behind every minute of agent runtime turns logging into something closer to engineering analytics: a way to see which harnesses and task types actually produce reliable work, and which ones quietly burn the most resources doing it.

How the five requirements interact

None of these five requirements, isolation, networking, resource limits, provisioning, and logging, stands on its own. Each one enables or depends on at least one of the others. A platform that satisfies four of the five doesn't deliver four-fifths of the reliability a team needs. It delivers one specific, identifiable gap, and that gap tends to undermine everything else around it.

Strip out per-session isolation, and resource limits, network scoping, and audit logs lose the ability to attach to a specific session with any confidence; every other control degrades at once. The environment works, but nobody can manage it at scale.

The question that matters is whether all five are enforced at the same layer, the hypervisor or VM boundary, so that none of them can be bypassed by code running inside the guest.

Criteria for evaluating VM environments for agent workloads

Testing a platform's claims against what it actually enforces at runtime is the only way to find where production failures are likely to originate, and that testing should run against each of the five requirements in turn. On provisioning, cold-start time needs to be measured under concurrent load rather than in a single isolated benchmark, since teams running several agent tasks in parallel need boot times that hold steady under real concurrency, not just in a clean one-off test.

On networking, the test is whether default-deny egress is actually the baseline rather than an optional setting, and whether allowlists are scoped per session rather than shared platform-wide; changing an allowlist for one session should have zero effect on any other session running at the same time. On audit logging, review what gets captured for each session, including the action taken, the output produced, the resources consumed, and the external endpoints contacted, and confirm that every entry can be traced to a specific task, harness, model, and credential.

Teams planning to self-host should weigh which isolation technology fits their existing stack, Kata Containers with the kata-clh RuntimeClass for teams already standardized on Kubernetes, Firecracker for teams building serverless-style platforms from the ground up, and confirm that whichever one they choose enforces all five requirements at the hypervisor boundary rather than scattering them across layers that untrusted code might find a way around. That choice also comes with real operational weight: maintaining a library of VM snapshots, managing network policy across sessions, and aggregating logs at scale are each their own ongoing responsibility, not a one-time setup cost, and any evaluation that skips over that maintenance burden hasn't actually tested the platform. Teams that would rather hand that operational layer to someone else have managed options to consider, such as Replicas, a cloud platform that runs coding agents in isolated VMs pre-loaded with a team's codebase, triggered from GitHub, Linear, or Slack and returned as pull requests ready for review.

More in Cloud Agent Environments