What a Persistent VM Holds Between Browser Agent Steps That Serverless Architectures Cannot Lease
Browser agents need live sessions and workspaces that functions can't keep.

A persistent VM retains the browser profile, installed dependencies, files, and, while running, processes and connections that a browser agent needs to continue. Classic serverless functions do not promise to keep these in place, so longer timeouts and external state stores alone cannot give the agent what it needs between steps.
Why browser agents fail on serverless functions
A browser agent clones a repo, installs dependencies, opens a browser, navigates pages, writes intermediate files, and pauses for approval. Its next step consumes what earlier steps produced. It is a loop that observes, reasons, acts, and repeats inside an environment that changes as work proceeds.
Serverless functions follow a different contract. Code handles an invocation, after which the platform can freeze or discard its environment and start fresh for another request. This fits HTTP APIs and event handlers whose lasting state lives elsewhere. It conflicts with an agent that expects its installed software, browser session, or local server to remain available.
Duration is only part of the problem. AWS Lambda caps standard function execution at 15 minutes, but extending execution would not establish continuity between invocations. Durable orchestration can keep a goal open through many steps and human approvals without keeping compute alive. That works when a progress checkpoint is sufficient for the next step.
What "environment state" actually consists of in a browser agent session
When an agent signs into a service, it accumulates cookies, OAuth tokens, session storage, and signed-in browser state. Rebuilding them can mean another MFA challenge, human intervention, or fraud signals from repeated authentication. A saved workflow checkpoint does not itself return the agent to that signed-in browser.
When the agent installs software, it changes its workspace. Native packages, browser extensions, language runtimes, and compiled binaries become prerequisites for later actions. Reinstalling them adds delay and can introduce version drift. The agent also downloads documents, generates scripts, processes datasets, and writes diffs and logs that subsequent steps must read.
Repeated activity warms more than the filesystem. DNS lookups, TLS handshakes, CDN responses, in-process model clients, and package manager caches reduce the work required for later requests. Some of that state belongs to running processes. A package cache on disk and a client held in memory thus need to be recovered in different ways, though both help the agent get back to work faster.
Other artifacts exist only while something stays alive. WebSockets, gRPC streams, and browser DevTools Protocol sessions connect the agent to services and browser controls. Headful Chromium or Firefox, local servers, background watchers, and VPN tunnels also span reasoning steps. Losing these means more than fetching saved data. It means restarting software and rebuilding connections before the agent can act again.
Why serverless discards these artifacts by design, not by limitation
Disposable execution enables the serverless cost and scaling model. The platform can scale to zero, bill per invocation, and run workloads on shared infrastructure without promising to keep a process alive for each task. Environment reuse may help performance, but it is not a persistence contract. Asking for that contract changes the kind of compute on offer.
Step Functions and Lambda durable executions address a different need by checkpointing workflow progress between invocations. A session identifier can link steps without a promise to keep the same process alive. Similarly, a database or object store can retain file contents and other values, but it cannot keep a browser process or an open socket running.
At-least-once execution semantics common in function platforms can duplicate an agent action. Submitting a form or posting to an API is not necessarily safe to repeat. A longer timeout does not resolve that problem, any more than a faster cold start restores an installed-and-warmed workspace.
AWS Lambda MicroVMs provide a genuine counterexample to any blanket claim that managed, on-demand compute cannot retain state. AWS announced them on June 22, 2026, as isolated environments that suspend when idle and resume with memory and disk intact for up to 8 hours. But they are a separate compute primitive from classic event-based Lambda functions. The first request after suspension waits for restoration. AWS also recommends refreshing credentials and re-validating network connections because credentials can expire and connections may terminate or fail to recover automatically.
Stateful microVMs meet a requirement that disposable functions do not promise to meet.
What a persistent VM actually holds across the same steps
A persistent VM separates its workspace and running environment from any single agent invocation. As long as the machine runs, the browser process and its profile are there for the next step. Persistence avoids discarding the session merely because a reasoning step ended.
Installed dependencies remain on the filesystem. The agent does not need to reinstall native packages or recompile binaries before continuing. Downloaded documents, generated scripts, partial datasets, diffs, and logs also stay on a durable volume. A later step can read a file written three steps earlier without first retrieving it from an external store.
Runtime continuity preserves a different set of assets. In-process clients and warm caches remain available because the process has not restarted. WebSockets, DevTools Protocol channels, and gRPC streams can stay connected between reasoning steps. Headful browsers, local servers, and background watchers can also keep running, so the agent can take control again without having to launch and navigate again.
Filesystem persistence is not process persistence, however. A durable volume survives a machine stop, while ordinary RAM, open connections, and running subprocesses do not. Snapshot restoration can recover captured memory, but it does not guarantee uninterrupted activity or valid connections. The recovery contract therefore still needs to cover mounting the workspace, reloading credentials, restarting the browser where needed, reading the checkpoint, and continuing.
How Firecracker microVMs preserve environment state without the overhead of full VMs
Firecracker microVMs make VM isolation practical for smaller, per-agent workloads. They boot in approximately 125 milliseconds, without the startup overhead of a full VM environment. Each guest has its own kernel. This gives agents a hardware-level boundary instead of the shared-kernel boundary used by containers.
Snapshot restoration is a separate, optional mechanism. A microVM first boots and initializes its application, then a snapshot captures its ready state. Subsequent instances can restore that state. The snapshot represents memory and block device state at capture time, so it can preserve an already prepared environment.
The same mechanism supports snapshot-and-fork workloads. A ready microVM is captured to local NVMe, then cloned into parallel instances for evaluations or RL runs. Each instance inherits the warm starting environment. That saves repeated preparation while giving each run its own isolated guest.
A snapshot is not uninterrupted execution, though. Restored memory does not keep an external socket alive during sleep or guarantee that in-flight work remains valid on wake. Connections and transient activity still need recovery handling. When a microVM service bills per second and does not charge for idle time while sleeping, its costs suit agents that work for a while and then wait. Those billing terms belong to the service independently of Firecracker's snapshot mechanism itself.
Where the gap becomes an engineering cost: legacy desktop apps, authenticated services, and regulated workflows
Legacy desktop workflows make the cost of reconstruction concrete. EHR systems, loan origination software, dealer management systems, and Citrix/VDI environments often require a stable, signed-in desktop across an interaction sequence. They were not designed as isolated event handlers. Building their environment again between agent steps adds the work of setting up and recovering the session to the task itself.
Citrix makes the dependency especially clear. The agent needs a local browser or desktop automation stack and a long-lived connection to the VDI. Setting up that session on every invocation can trigger authentication flows that the agent needs help to complete. In that setting, disposable execution makes the workflow depend on a human when it needs to keep going on its own.
Authenticated web portals impose similar costs without a desktop. Payer portals, property management platforms, and broker tools accumulate session state through logins and navigation. Re-authentication risks account lockouts, MFA challenges, and audit log noise that compliance teams must explain.
Screenshots of EHR or payer portal screens can contain PHI, making the environment that handles them a PHI-handling surface. HIPAA's Security Rule audit and minimum-necessary requirements therefore apply to more than the final output. A persistent, isolated VM with defined network policy and audit logging gives that surface a clearer boundary than a shared worker pool. It is not a compliance certificate, and HIPAA has no certification program.
Sandboxing untrusted code inside a persistent agent environment
Persistence also gives an attacker more valuable state to reach. An agent that writes and executes Python, shell commands, or browser automation scripts can expose authenticated sessions, intermediate files, and credentials held in memory if that execution is compromised. A vulnerability can escalate to remote code execution on the host.
A malicious document presents a specific route into this problem. Prompt injection can direct an agent to exfiltrate files from its persistent workspace. The relevant question here is where the resulting code runs and what it can access. Even with model-level safety, that code still needs an execution boundary.
MicroVM isolation separates the guest from the host and other agents' workspaces. Network policy constrains where code in that guest can connect. But isolation from other machines leaves files at risk when they are deliberately made available inside the same execution environment. A sandbox containing the agent's entire valuable workspace would still put that workspace within reach of the code running there.
The agent retains its repo, checkpoints, and logs in a persistent workspace, while generated code runs in separate disposable sandboxes. For evaluations and tasks involving untrusted input, cloning a fresh microVM from a clean snapshot also removes residue from prior runs.
Matching the right machine type to the browser agent's actual state requirements
The choice should start with a state inventory. The choice depends on what must survive while the agent's goal remains open as well as how long the goal takes. Durable disk state includes the repo, artifacts, logs, package caches, and checkpoints. Transient runtime state includes RAM, sockets, and running processes, which need explicit recovery treatment after a stop or sleep cycle.
Use a persistent VM when continuation depends on the environment. That includes maintaining an authenticated browser, returning to a signed-in legacy desktop or Citrix session, or accumulating local files for later steps. Open WebSockets, DevTools Protocol channels, and gRPC streams also favor a continuously running environment. So does a headful browser that must stay on a particular page between reasoning steps.
Use a disposable sandbox when continuation is not the goal. Evaluation and RL rollouts often need a clean baseline. Untrusted or generated code also belongs in a sandbox that cannot touch accumulated state. A fully self-contained task with no cross-step dependencies has no inherent need for a persistent workspace.
Use durable serverless orchestration when the goal is long-lived but each execution is stateless. An agent that calls external APIs and reads managed databases can save its progress without keeping local files or processes. Step Functions or Lambda durable executions fit that separation. A wait for human approval alone is not a reason to keep a machine running.
VMs for each user or task can tie spending to how much work they do when the machines sleep while idle and bill per second. But sleeping trades uninterrupted runtime for a recovery step, even when disk and captured memory survive. The deciding requirement is what the next action must find intact, and whether reconstructing it is acceptable.


