Designing AI Agents

The Persistent VM Pattern Every Scaled Multi-Tenant Agent Platform Converges On

Snapshot-resumed micro-VMs give each tenant isolation and state without idle compute bills.

· 8 min read · Updated
Cover illustration for “The Persistent VM Pattern Every Scaled Multi-Tenant Agent Platform Converges On”
Persistent Agents · November 19, 2026 · 8 min read · 1,894 words

Persistent AI agent infrastructure is a fit for sessions that need to keep their memory, files, and browser state while they are idle. Stateless serverless functions fit disposable requests. For multi-tenant platforms running untrusted agent code, snapshot-driven persistent micro-VMs bring three needs together, which are durable execution state, kernel-level tenant isolation, and no compute charges while the machine sleeps.

Why agents break the stateless request model that containers were designed for

A typical API endpoint receives a request, executes, and discards its runtime state. The container can then be replaced without consequence. An agent session instead accumulates open file handles, in-memory tool state, partially written artifacts, signed-in browser sessions, and credentials needed midway through a task. Killing that process can lose work or corrupt state.

Waiting makes that mismatch harder to manage. Agents spend much of their lifecycle with the CPU idle, waiting for LLM responses, external APIs, or human input. Yet their environment must still be there when the next response arrives. A request-oriented design treats the environment as disposable, while an agent treats it as a computer it can return to.

The three forcing functions that every growing multi-tenant agent platform hits together

Stateful execution requires a session to resume with memory and disk intact. A cold restart is not an equivalent recovery. Tenant isolation adds a separate constraint because agents run tools, write files, call APIs, and manage credentials on behalf of different users. Idle-cost pressure is the third, because keeping every waiting session provisioned makes spending depend on how many tenants there are, even when they do little work.

Each requirement looks manageable on its own. A dedicated VM can preserve state and separate tenants, but it bills while its agent waits. Shared compute can cut spending while agents are idle, but a shared kernel puts the tenants’ processes in the same operating system. Stateless restarts release resources, but discard the live context the agent needs. The architecture has to satisfy all three together, rather than treating one as a problem to fix after growth.

Why shared-kernel containers fail the isolation requirement as soon as agents run untrusted code

Docker/runc containers share the host kernel, even when their processes occupy separate namespaces. That is the boundary an attacker can target. A container escape or kernel-level exploit from one tenant can reach other tenants on the host. Namespaces and role-based access control help set who can access what, but they do not give each tenant a separate kernel.

When agents write code, it is harder to keep this exposure in check through review. The runtime executes what the model writes, including code beyond what the platform developer approved beforehand. SANDBOXESCAPEBENCH, published as arXiv:2603.02277, measures frontier LLM agents’ ability to escape Docker/OCI container sandboxes. It establishes sandbox escape as an adversarial capability to plan against.

For these workloads, the isolation requirement reaches below the process namespace to a tenant’s kernel, root filesystem, and network boundary. There are different ways to strengthen that boundary. gVisor supplies a user-space kernel and satisfies the kernel-isolation requirement for many workloads, with persistent storage available through bind mounts and disk-backed overlays. Firecracker instead supplies a hardware-virtualization boundary and a hardware-enforced VM disk boundary. That is a performance-versus-isolation choice.

Why always-on VMs fail the idle-cost requirement as tenant count grows

A dedicated, always-on VM gives the tenant a separate kernel and keeps the agent’s live state. Its billing model creates a different bind. Provisioned compute keeps costing money while the agent waits for an LLM, an API payload, or a person.

A prototype may run one long task without a pause, while a production platform serves many users who work in short bursts with pauses between them. Thousands of tenants can thus leave thousands of machines idle most of the time. The cost follows the tenant count, which makes the model a poor fit for consumer or SMB per-user pricing.

Destroying idle machines would stop that compute spend, but would also destroy the live sessions. Keeping only their files does not preserve their memory. The missing capability is a way to release compute without discarding execution state. Snapshot-driven suspend and resume fills that gap by separating the lifetime of the agent’s environment from the time its CPU and memory remain allocated.

How Firecracker micro-VMs resolve all three constraints through snapshot-driven suspend and resume

Firecracker restores a snapshot by memory-mapping the snapshot file, loading CPU state, and resuming execution where it stopped. From the restored execution state, the VM does not know it was stopped. Open file handles and in-memory tool state remain part of the session, with disk contents preserved, so the agent does not need to reconstruct its work from a fresh process.

Each tenant has its own kernel, root filesystem, disk volume, and network boundary. Suspension then removes the need to keep that environment running. A sleeping micro-VM consumes no vCPU or memory on the host, leaving storage as the idle cost. When the platform’s billing follows that lifecycle, compute charges stop at suspension and restart on wake.

Firecracker’s native API supports full snapshots containing complete resumable state and diff snapshots containing only memory dirtied since the previous snapshot. A diff must be merged into a full snapshot before use. AWS’s Lambda MicroVM sample repository describes the resulting platform shape as one Firecracker VM per tenant, snapshot resume, automatic lifecycle management, and state persisted in a managed file system.

What production multi-tenant platforms look like when they implement this pattern

The shared component is the control plane. Identity, scheduling, provisioning, billing, and audit can run centrally. The data plane contains the tenant machines, each with assigned CPU, memory, disk, and networking. With those planes on separate kernels, the platform can share the services that manage it while keeping the agent environments on separate operating systems. Maritime, a cloud computer platform for AI agents, runs each agent in its own Firecracker micro-VM that sleeps when idle and keeps its filesystem and credentials.

AWS Lambda MicroVMs, generally available on June 22, 2026, give each user or agent session a Firecracker micro-VM that starts from a snapshot. It suspends when idle and resumes with memory and disk intact within its session window. The platform manages that lifecycle, including the hard session time limit. The OpenClaw serverless stack on AWS uses per-session kernel isolation with dedicated CPU, memory, and filesystem, then terminates the micro-VM and cleans memory when the session times out.

Northflank provides another implementation of workload-level isolation within a shared control plane. Its primary option is Kata Containers with Cloud Hypervisor, with Firecracker and gVisor selectable by workload type. The same platform also has persistent services, databases, and background workers. The isolation choice can therefore vary by workload without requiring each tenant to operate a separate administrative stack. These implementations separate the shared management layer from the environments that execute tenant code.

Where the pattern reaches its limits and how platforms extend it for workloads that exceed an 8-hour session

AWS Bedrock AgentCore launched with an 8-hour micro-VM execution limit. Some workloads need a different compute tier. Long-running jobs, GPU-heavy tasks, and closely collaborating agents can exceed what that default session model provides. Sessions can stretch from 8 hours toward 14 days, well beyond the time needed for a response that is just a little slower.

AWS’s AgentCore Runtime Instances announcement adds persistent EC2-backed sessions, shared filesystems, GPU-accelerated instance types, and multi-agent collaboration on a shared host. The packaging model does not have to change. Frameworks including CrewAI, LangGraph, LlamaIndex, and Strands can use that tier. The reason to add it is duration, hardware access, or sustained work, with tenant isolation maintained.

The pricing trade-off changes with that workload profile. Runtime instances cost the standard EC2 rates plus a management fee based on the On-Demand rate, and Savings Plans and Reserved Instances can cover the compute part of the bill. Before commitment discounts, the break-even point is roughly a quarter of sustained CPU utilization, with micro-VMs cheaper below it and instances cheaper above it. The design should keep micro-VMs as the default for waiting agents and send work that runs for a long time or keeps utilization high to the second tier.

What the data plane boundary means for per-tenant storage and credential isolation

With a separate kernel, shared data access can still be a problem. Archil identifies the failure mode as tenant scope disappearing when work passes through tools, queues, caches, artifacts, credentials, and logs. A tenant_id in a prompt provides only a statement of intent. Once agents can generate code, write files, and call tools autonomously, the application interface is no longer the fence around tenant data.

Storage isolation therefore has to be structural. Each tenant needs a separate volume that another tenant’s micro-VM cannot reach through path traversal. Credentials need the same treatment, either inside the tenant’s machine boundary or in a secret store scoped to that tenant’s identity. A shared environment variable or a secrets namespace accessible to every tenant defeats the separation established at the compute layer. The OpenClaw GCP architecture applies this boundary through tenant-specific filesystems, persistent volumes, network tap interfaces, resource allocations, and runtime configuration.

Logs belong inside the same isolation model. Records of each operation must show which agent accessed which data, what it did, and who approved the workflow, while keeping each tenant’s activity separate. A mixed stream without tenant boundaries undermines auditability and regulatory requirements. The practical test is whether a bug in one tenant’s agent could read, write, or corrupt another tenant’s files, credentials, or logs. If it could, the data plane boundary is incomplete.

How should a real platform choose machine type and lifecycle for persistent agents versus serverless functions?

The first decision is whether the workload needs continuity. An agent that retains a signed-in browser, partially completed tasks, or user-specific configuration needs a persistent machine that snapshots and resumes. A bounded task with no carryover state is better served by a throwaway sandbox deleted with its disk when the task ends. Those are distinct lifecycle contracts, and mixing them in the same pool is an antipattern.

Sleep policy has to match response latency, because idle savings only appear when machines actually sleep. A short idle period followed by a wake in under a second can be invisible to the user, whereas an immediate suspension followed by minutes of restoration is not. Snapshot cadence should reflect how often state changes and the acceptable recovery window. Session time limits should fit the typical workload, with the long tail routed to the complementary tier.

Billing should follow that machine lifecycle as closely as possible. Per-second metering with no minimums and no idle compute charges matches intermittent agent use, while flat monthly per-seat pricing can recreate the always-on cost burden for the buyer. Where an operator must take over an agent’s desktop, the persistent machine also needs a live display. For regulated workflows requiring that form of human review, takeover is an architectural requirement.

The evaluation comes back to three concrete tests. Does the platform provide kernel-level tenant isolation, preserve state across idle gaps without charging for idle compute, and resume quickly enough for the task to continue seamlessly? Storage charges should be clear, even when the platform claims that persistence is free. If any of those tests fails, the platform has left one of the original constraints unresolved, and growth will force that trade-off back into the design.

Sources

  1. Deep Dive Architectural Design of a Multi-Tenant Serverless OpenClaw Agent Platform Using Amazon Bedrock AgentCore, Lambda MicroVMs, and LiteLLM Budget Gates

More in Persistent Agents