The Production Readiness Gap Between Serverless Functions and Persistent Agent VMs
Agents need persistent, isolated VMs that sleep cheaply and wake fast.

Persistent AI agent infrastructure differs from serverless functions in what survives between calls. Serverless suits short, stateless work, while stateful, long-running agents need persistent execution environments, real filesystems, fast resume, and hardware isolation. Snapshot-scheduled persistent VMs provide the architecture agents need for production without using compute for every agent while it is idle.
Why the serverless execution model was never designed for what agents actually do
An agent that worked on a developer’s machine reaches its first real user and cold-starts into a multi-second delay or loses its context between steps. The code may be unchanged. The execution contract is not, because production infrastructure decides what survives after a request ends, rather than leaving that decision to the developer’s environment.
Serverless functions were engineered for short, stateless, request-response cycles. Their contract is to allocate compute on demand, execute, and tear down, which makes disposable web requests efficient. Agents instead accumulate context, install dependencies, and return to unfinished tasks across extended periods. AWS Lambda enforces a maximum execution time of 15 minutes, so an uninterrupted agent loop cannot simply continue until its work is complete.
The four concrete ways serverless breaks agent workloads in production

When reasoning or a multi-step tool chain runs past the platform’s time limit, execution stops mid-task. Even with a longer timeout, execution must stop at the platform’s limit. Continuing the task requires restructuring execution across invocations, which changes how the agent preserves progress and recovers from interruption.
State loss creates a separate reconstruction burden. Serverless execution environments can reset between invocations and lose their in-memory context, loaded models, and intermediate results. An environment that happens to remain warm is not a persistence guarantee. External storage can preserve selected data, but serialization and round-trip latency turn access to that data from a local operation into a network call.
Cold starts compound across sequential tool calls. A one-shot API request may be able to wait for initialization, but an agent may have to wait again each time a later invocation reaches a cold instance. Not every invocation incurs that penalty. However, user-facing flows targeting a Time to First Token under roughly 1.5 seconds have little room for container initialization and model hydration before responsiveness deteriorates.
Shared-kernel environments introduce a fourth failure mode for untrusted code. Standard container deployments share the host kernel, so tenants have a different security boundary than they would with separate guest kernels. CVE-2023-2163 and CVE-2024-21626 document container escape risks. This distinction concerns isolation rather than billing or invocation style, because a serverless service can itself use micro-VMs without exposing a persistent session to the application.
Why patching serverless with external state stores does not close the gap
Externalizing state is a reasonable response to disposable execution. Session context can live in Redis, files in object storage, and credentials in a secrets manager. For stateless agents, that division can work well. Document classification or single-turn analysis can stop the running environment after returning a result, so there is less to rebuild with serverless.
The trade-off changes when each step depends on a substantial working context. That context must be serialized before execution ends and deserialized when it resumes, adding latency as it grows. The operational surface also expands. Availability, latency, and consistency now depend on several services, while function-scoped logs cannot by themselves reconstruct the full sequence of agent activity.
Distributed tracing can connect those hops, and durable workflow orchestration can preserve progress across pauses. Neither automatically preserves the agent’s running environment. Expressing execution as a step-function graph can also require restructuring logic that does not naturally fit that model. The missing primitive is a first-class persistent, isolated session, rather than another location in which to store selected pieces of it.
What agents actually need from their runtime, stated as requirements
The first requirement is persistence across the full session lifecycle. Files, installed packages, running processes, and in-memory context must survive sleep and wake, with continuity maintained through redeploy. This includes a real working filesystem. Saving conversation history alone does not preserve the environment in which an agent installed dependencies or left a process running.
The second requirement is hardware-enforced isolation for each tenant. Agents executing untrusted or LLM-generated code need a hypervisor boundary instead of relying only on namespaces within a shared kernel. Separate guest kernels remove the shared-kernel escape path between workloads. That requirement does not disappear because an agent’s normal instructions appear benign.
The runtime also needs sub-second wake latency and near-zero idle compute cost. A user-facing agent must bring back warm context in under a second, while an idle agent should be able to keep its session without keeping compute running. These requirements work together. Fast resume without persistence still leaves the environment to be rebuilt, while persistence without suspension makes long pauses costly.
How Firecracker micro-VMs satisfy each requirement by design
Firecracker provides a separate disk, kernel, and process table for each micro-VM. Keeping that VM across agent steps preserves installed packages, cloned repositories, running daemons, and browser sessions without externalizing each component. Persistence follows from retaining the execution environment. Snapshot-based lifecycle management then extends that continuity across suspension.
The hypervisor supplies a different isolation boundary from shared-kernel containers. Each guest runs its own kernel, so a vulnerability in that kernel does not provide the same direct path into neighboring workloads through a shared host kernel. This is structural separation with limits to its protection. Firecracker boots in roughly 125ms with roughly 5MB of memory overhead per VM, so it offers VM-level isolation while using about as few resources as containers.
AWS reports that Firecracker powers more than 15 trillion Lambda function invocations monthly. That scale establishes the underlying technology’s production use, but it also clarifies the distinction between a micro-VM and the service contract above it. Ordinary function execution can remain ephemeral on VM infrastructure. AWS Lambda MicroVMs, launched June 22, 2026, expose near-instant snapshot boot with per-session state persisting for hours, signaling support for a session-oriented model.
Snapshot restore addresses responsiveness without repeating a fresh boot. Restoring a sleeping micro-VM takes tens to low hundreds of milliseconds, while snapshot-and-suspend releases its compute allocation until activity resumes. Storage remains billable during the pause. AWS’s reference architecture for a small VM with a short active window and a long suspended window places a thousand dormant tenants at only a few dollars per month total.
How snapshot-restore scheduling makes per-user agent deployment economically viable

Google’s sandbox research increased a node’s capacity from 88 to 274 concurrent agents through lifecycle management, snapshotting idle agents to disk and freeing their memory. An idle agent became a stored execution environment with its compute allocation released. That distinction makes persistence compatible with a large population of intermittently active users.
A snapshot scheduler provides a third option between always-on execution and cold creation. When an agent waits on a user or pauses between task bursts, its working directory, installed dependencies, running processes, and warm page cache are frozen, and compute is released. Restoration resumes that environment. The scheduler therefore preserves the session without charging for continuous execution throughout the wait.
Copy-on-write memory reduces the cost of restoring many guests from a common template. Restored guests read shared template pages, and a private physical page is allocated only when a guest writes to it. Memory demand therefore reflects the shared image plus pages each guest has dirtied, rather than the full template multiplied by tenant count.
When active work exceeds a majority of a 24-hour cycle, dedicated always-on VMs become more economical than on-demand compute. Below that crossover, snapshot-restore scheduling favors intermittent work. The practical decision rule is to distinguish agents that spend most of their elapsed lifetime waiting from those that are genuinely compute-saturated.
What the per-user agent pattern looks like in a multi-tenant fleet
Firecracker’s one-VMM-per-microVM design maps directly to one isolated VM per tenant, with the tenant’s identity injected at runtime. Each user receives a separate execution environment. The kernel boundary keeps workloads apart without relying on namespace policy alone, and keeping the environment lets the agent pick up where it left off between calls. Coding assistants, autonomous research tools, and long-running task agents can each keep their own workspace.
Hardware isolation does not replace network policy. A VM that can reach the public internet, internal metadata services, private APIs, or arbitrary DNS can still provide routes for data exfiltration or lateral movement. A production fleet needs to limit egress to an explicit allowlist and keep networking off by default when agents do not need external access.
Snapshot scheduling makes this per-user pattern economically distinct from allocating an always-on machine to every account. Each agent keeps its own space, memory, and session, but releases compute while it is dormant.
Where observability and developer tooling break down at the serverless-to-VM transition
Persistent VMs change the unit of observation from an invocation to a session. A long-lived process can run through many tool calls, model responses, and state mutations, so function-scoped logs no longer cover the stretch of execution that needs to be tracked. The agent loop needs explicit instrumentation. OpenTelemetry can connect activity across a session, while session duration, idle time ratio, snapshot frequency, and per-user compute utilization become more informative than invocation count and cold-start frequency.
Developer tooling also needs to fit the agent’s work. CLI-first tooling offers a token-efficient path for common workflows, while MCP servers can justify their overhead when per-user authentication or dynamic tool discovery is required. Neither is a universal choice. The desired deployment workflow remains a single push from code to a live API endpoint, with VM provisioning, snapshot scheduling, and network policy absorbed by the platform.
How to decide when serverless is still the right choice and when to move to persistent VMs
Serverless remains appropriate when an agent is stateless by design, finishes comfortably within execution limits, and never needs to resume a paused environment. Document classification, data extraction, and single-turn analysis can work this way. Bursty traffic strengthens the case for scale-to-zero execution. For these workloads, keeping a process or filesystem between requests may cost more without keeping anything the next request needs.
Datadog recommends building a workload execution profile before provisioning persistent compute. That profile records trigger pattern, peak concurrency, active compute time versus total elapsed time, and response-time objectives. A goal that remains open for a long time does not necessarily require continuously allocated compute, or even a persistent environment, if its steps are independently resumable.
Persistent VMs are the right runtime when the agent needs to keep installed packages, a working filesystem, browser sessions, or context across many steps. Hardware isolation is also required for untrusted code in a multi-tenant product. Sub-second resume adds another constraint on the execution model. When those needs coincide with long idle periods, snapshot scheduling preserves the environment without paying for an always-on allocation.
For teams already using serverless, the practical path is incremental migration. Teams can move one step at a time to persistent compute when production data shows that it fails to meet state or latency requirements. This limits over-provisioning and ties the change to measured needs. The decisive boundary is whether execution can remain disposable or whether the agent must resume the same isolated working environment.


