Runtime Isolation Cost Tradeoffs for Untrusted AI Agents in Production
Choosing AI agent isolation means balancing security against boot time and memory costs.

With Firecracker micro-VM isolation, each AI agent has its own guest kernel behind a hardware-enforced boundary. For untrusted agent code in production, the engineering decision is to choose the least costly isolation tier that removes the actual threat surface. That requires pricing boot latency, CPU overhead, memory, idle storage, and operational complexity together.
Why runtime isolation for AI agents is an engineering economics problem, not a security checkbox
A prompt-injected agent inside a shared-kernel container can read exposed host credentials and send them through an outbound HTTP call if filesystem and network controls permit it. No kernel exploit is necessary for that attack. If arbitrary code also finds a privilege-escalation path through the shared kernel, the compromise can extend to the host. These are different failures, and an isolation decision must distinguish them before comparing costs.
ARYA Labs’ Unfireable Safety Kernel paper describes the underlying inversion in the security model. Classical security architecture protects software from malicious users, while agent architecture must protect the operating environment from the agent. The agent itself can become the adversary. A prompt-injected, misaligned, or simply incorrect agent can reach controls inside its own address space, so containment cannot rely on the agent behaving as it should.
The economic comparison therefore has five axes, which are boot latency, steady-state CPU overhead, per-sandbox memory overhead, idle storage cost, and engineering complexity. Buying stronger isolation than the workload needs consumes resources without removing a relevant threat. Buying less leaves a known exposure unresolved. As autonomy grows from drafting and summarizing to actions with financial or regulatory consequences, both the boundary and its operating cost need reassessment.
What runtime isolation options exist for running untrusted AI agents in production?
Tier 1 consists of OS process sandboxes, including Seatbelt on macOS and bubblewrap on Linux. They constrain filesystem and syscall access at the process level but do not provide kernel separation. Their scope is deliberately narrower than a VM’s. This tier fits trusted code written in-house and is too limited for arbitrary LLM-generated or user-supplied programs.
Tier 2 introduces a user-space kernel, as gVisor does, between sandboxed code and host kernel syscalls. That mediation adds a useful layer of isolation without the need for a full VM. It also introduces syscall latency, with a sharper penalty for syscall-heavy workloads, and incomplete syscall emulation can cause Linux software compatibility problems. The host kernel remains shared through mediation, so this tier does not provide hardware-enforced separation.
Tier 3 uses microVMs, including Firecracker and Kata Containers, to give workloads their own kernels through KVM hardware virtualization. A guest kernel exploit must also defeat the hypervisor to reach the host or another VM. That is a substantially different exploit requirement. This tier is the production baseline for multi-tenant platforms executing LLM-generated or user-supplied code.
Tier 4, represented by Microsoft LiteBox, links an application against a minimal OS library exposing only a handful of controlled primitives. The aim is to make the attack surface smaller, at least in theory. Tier 5 controls who can see the data through confidential computing, including AMD SEV-SNP and Intel TDX. Hardware-encrypted memory prevents even the hypervisor from reading sandbox data, which is relevant to regulated workloads but not a default requirement.
The ladder is not a universal product ranking. Sandlock illustrates an active research alternative, splitting static, input-independent policy into kernel-enforced rules while reserving runtime-dependent decisions for a narrow supervisor. It enforces filesystem, network, IPC, and syscall policies without root, cgroups, images, or mandatory namespaces, with roughly 5ms startup overhead. This adds another choice, though its boundary differs from that of a private guest kernel.
Why shared-kernel containers fail the threat model for untrusted agent code
Containers assume the host kernel is a trusted boundary. Hostile code still runs against that shared kernel, so a successful kernel privilege escalation can turn a sandbox compromise into a host compromise. Process restrictions and resource isolation do not remove that dependency.
The relevant exposures include out-of-scope filesystem reads, arbitrary network egress, host kernel syscall access, cross-tenant leakage, and secret exfiltration through /proc. Shared-kernel containers do not adequately resolve the last three for hostile code. Yet kernel separation is not the whole answer. An agent allowed to read credentials and contact arbitrary domains can exfiltrate those credentials without escaping anything, so filesystem and network policy remain necessary around the execution boundary.
The Unfireable Safety Kernel paper describes how a Python guardrail can be replaced through a sys.modules assignment and how a function-level check can be monkey-patched. A moderation API call can also be skipped when tool capabilities remain accessible outside its mediation. These failures arise because the controlled program can reach the control.
The Open Agent Passport paper distinguishes pre-action authorization, sandboxed execution, and model-based screening as complementary architectures. Authorization governs whether an action may begin, while sandboxing limits what execution can reach. Neither replaces the other’s function. For the core multi-tenant threat, gVisor’s mediated kernel remains insufficient, while a microVM removes direct dependence on a shared guest kernel.
The measurable overhead of microVM isolation and where it actually lands in production
The cold-start figures span quite different execution models. Standard containers are approximately 1.2s, raw Firecracker approximately 125ms, and full VMs 8–15s. Docker Sandboxes, wrapping Firecracker and listed as generally available in September 2026, has a 180ms cold-start figure. These figures describe the distinct implementations measured.
For a typical agent task, startup is only one part of elapsed time. The 125–500ms Firecracker range sits beside LLM inference measured in seconds, as well as network I/O and tool-call latency. The boundary often adds little visible delay. Its relative cost nevertheless depends on both the boot number and how much work follows startup.
Steady-state CPU performance requires the same workload distinction. Firecracker achieves a high fraction of bare-metal performance for compute-bound work, while Kata shows substantially greater overhead on syscall-heavy tasks. Boot time cannot predict that difference.
Memory is the cost that compounds most visibly across a fleet. Firecracker adds under 5MB of hypervisor overhead, but guest RAM is additional, with a 128MB default. Kata’s added per-pod memory figures vary across the supplied comparisons, from 60–120MB to roughly 100–180MB above a bare container. The under-5MB figure leaves out part of the memory each agent needs. The comparison must also count the memory given to the guest and used by the surrounding runtime, especially when many sandboxes stay resident.
How snapshot-restore economics make persistent microVM agents cheap at idle
A resident sandbox consumes resources even while its agent waits for another request. Snapshot-restore changes which resource must remain allocated during that wait. The idle agent is suspended to disk, incurs snapshot storage cost, and resumes in under a second when work returns. Compute no longer has to remain active merely to preserve the agent’s state.
For conversational and task-oriented workloads, those waiting periods reshape fleet economics. An agent active briefly and suspended for hours pays for a short compute interval and a longer storage interval. Less active tenants deepen that advantage. A mostly dormant fleet therefore becomes a storage obligation instead of an always-on compute fleet, directly because suspension preserves state outside the running VM.
Copy-on-write storage further reduces the cost of separate tenant environments. A shared base image is stored once, while each tenant adds only the chunks it writes. Memory snapshots follow the same principle. A sandbox that dirties only part of its allocated memory adds that fraction to shared base memory, rather than requiring a separate full copy of every allocated page.
Suspension is not free, however, because each cycle adds snapshot I/O. The maximum-idle threshold should be tuned to avoid suspending a chatty tenant every few minutes. Excessive cycling erodes the storage advantage. For genuinely continuous activity, a container-based or serverless approach can win on cost, though cost alone does not make its isolation sufficient. Durable execution saves on idle costs at the orchestration layer in the same way, by suspending waiting work and freeing the threads it would hold open.
Make-versus-buy: when to self-host isolation infrastructure versus rent it
Vercel Sandbox and Blaxel both provide managed Firecracker-backed execution, but their reported timings and billing units differ. Vercel reports approximately 400ms cold starts and active billing per vCPU-hour. The comparison turns on how much active capacity a workload consumes and which infrastructure duties the provider absorbs.
A self-hosted fleet managed through Cluster API that runs Firecracker or Kata pools has cold starts in the 125–300ms range plus image-pull time. With snapshot restoration or pool-warming, the fleet can be ready in 25–90ms. Owning that path requires substantial infrastructure work. The team must build and operate scheduling, snapshot management, and fleet provisioning rather than treating the hypervisor as the finished service.
The breakeven depends on sustained slot utilization. When enough of the capacity stays in active use, owning it can cost less than renting it, while managed execution costs less when use is low. Most early-stage agent products sit below that threshold. There is no universal utilization percentage in these comparisons, so a precise crossover cannot be inferred from cold-start performance or billing units alone.
Self-hosting pays off only when the team can support the scheduler and snapshot layer as well as the compute fleet. Otherwise, the managed charge covers CPU time and the operation of the isolation boundary. Per-user microVMs become viable when sleep removes most idle compute expense, but the system that coordinates sleep still has to be built or bought.
Choosing the minimum sufficient tier: mapping isolation to a concrete threat model
The practical decision begins with code provenance, tenancy, autonomy, and compliance constraints. Internally authored code that passed CI/CD presents a different exposure from user-supplied binaries or LLM-generated Python. Multi-tenancy adds the risk of cross-tenant leakage. Higher autonomy adds consequences beyond the sandbox, while regulated PII or financial data can create a requirement for confidential computing regardless of the otherwise sufficient tier.
For trusted internal logic with no user input in a single-tenant deployment, an OS process sandbox or container is sufficient. For single-tenant execution of LLM-generated code, gVisor or a microVM is the appropriate map. Multi-tenant execution of generated or user-supplied code requires a microVM as the minimum acceptable tier, while regulated multi-tenant data calls for a confidential computing layer as well.
Authorization must then govern the capabilities available inside that boundary. Low-autonomy drafting and analysis without write-back can tolerate lighter controls than actions with financial, regulatory, or customer impact. The Open Agent Passport paper reports that a strict pre-action policy stopped social-engineering attacks that often worked when the policy was more permissive.
For intermittent multi-tenant agents, one persistent microVM per tenant aligns the security boundary with the economic unit. Each VM sleeps when idle, wakes in under a second, and retains files, credentials, and session identity across suspension. The agent remains a persistent resident rather than a stateless function. That arrangement supports retained disk state, installed packages, and browser sessions while making dormant tenants a storage cost. Its fit depends on the combination of untrusted execution, separate tenants, and substantial idle time, rather than on hardware isolation being universally preferable.


