Serverless Functions vs Persistent VMs for Browser Agent Backends Compared

Browser agents need environments that survive, so sleeping microVMs beat disposable functions.

· 8 min read
Cover illustration for “Serverless Functions vs Persistent VMs for Browser Agent Backends Compared”
Browser Agent Architecture · November 30, 2026 · 8 min read · 1,770 words

Persistent AI agent infrastructure is a better fit than serverless functions when an agent must keep a live browser, signed-in sessions, and unfinished work between turns. Serverless works well when each step is cheap to rebuild from stored data. For browser agents, the deciding factor is not how long the task lasts, but whether its environment survives.

Why serverless functions were built for a different problem than browser agents

Serverless functions make compute disposable by design. An event triggers some code, the code finishes, and the execution environment can disappear. Any state needed later lives elsewhere, such as a database or queue. The platform takes care of provisioning and scaling, while the developer agrees that the next invocation must work without the memory of the one before it.

Validating a request, sending an email, or calling an AI model can each be a self-contained operation. A traditional backend can hold connections and keep things in memory between requests, while a stateless function rebuilds the context it needs. When that context is small and easy to recover, disposable execution is a useful simplification.

A browser agent starts from a different premise. It launches a browser, signs into a service, moves through pages, and accumulates state as it works. Its next action may depend on the environment created by all the earlier actions. It may also wait minutes or hours before continuing. The goal, the periods of active compute, and the environment therefore have different lifetimes. The browser’s workspace must bridge those gaps even when the agent has nothing to compute.

What are the limitations of running browser agents on serverless functions?

Execution timeouts are the first obvious constraint. A browser task that spans login, navigation, form filling, and confirmation can outlast a standard function invocation. Cold starts add another interruption when the agent must reinitialize its browser context before continuing. Ephemeral storage also means a profile, downloaded file, or installed dependency cannot be relied on after the environment is discarded. A longer timeout addresses only one of these problems.

Environment reconstruction is often the more expensive obstacle. Rebuilding native dependencies, browser profiles, warm caches, or build artifacts consumes time before useful work can resume. Schirmer et al. 2026 describe second-generation serverless platforms that reduce warm request latency and shrink cold starts through lightweight isolates and edge deployment. Those changes do not make the execution environment any better at keeping browser state. Faster startup is not the same as continuity.

Step Functions and Lambda durable executions can keep a goal open for up to a year, with waits that suspend compute charges. That works well when each step can resume cheaply from stored workflow state. But recording that an agent has reached a form does not preserve the browser that has that form open. If every continuation requires another login and reconstruction of page state, orchestration has preserved progress without preserving the working environment.

What a browser agent actually needs from its backend environment

A browser agent needs a backend that behaves like a computer. That includes a persistent filesystem, processes that are running, network connections that stay open during execution, and a browser profile that lasts between turns. A session established at the first step must still be available at the fifteenth. A database can record what the agent has done, but that record is not a cheap substitute for the authenticated browser context in which it was working.

Browser binaries, extensions, language runtimes, and native dependencies need to remain installed across actions. A headless or headful browser must be able to pause and resume with its tabs and navigation history intact. Local servers and background processes may also need to survive between calls. Together, these form the agent’s workspace.

Persistence alone is not enough for that workspace. An agent acting for one user must be separated from agents acting for other users, especially when its browser holds credentials or private data. Standard multi-tenant containers share a kernel, which leaves shared kernel surfaces as a security concern. The backend therefore needs a hardware-level isolation boundary as well as separate processes. In healthcare portals, financial systems, and insurance platforms, that boundary also belongs in the compliance analysis. The requirement is a private, durable environment that can stop consuming compute without being thrown away.

Why persistent microVMs match the browser agent execution model

A persistent microVM combines a durable filesystem with its own guest kernel and saved memory state. That gives the browser agent a place to keep both installed software and work in progress. Firecracker-backed microVMs can sleep when idle and resume from a snapshot. From the guest process’s perspective, execution continues after a pause.

The isolation mechanism is equally important to the fit. Each microVM has its own guest kernel through KVM or an equivalent hypervisor, rather than sharing the host kernel as a standard container does. Its filesystem and network namespace are separated from those of other agents. Meanwhile, saved disk and memory state preserve browser profiles, cloned repositories, and running daemons across turns. The environment stays assigned to the agent even when it is not running.

This architecture also leaves room for optimization. TrEnv-X, developed by Tsinghua and Alibaba in 2026, demonstrates shared browser contexts and OS-level memory templates for microVM-based agent workloads that reduce latency and memory overhead. The research shows that preserving an environment need not mean accepting every startup and memory cost unchanged. That does not make all persistent VM deployments equivalent, however. An always-on VM still consumes resources while idle. The useful distinction is a persistent machine that can release compute while retaining the state needed to continue, rather than a server that stays awake or a function that starts over.

How snapshot and resume makes long-running browser sessions economically viable

Snapshot and resume separates the lifetime of the workspace from the time spent running it. The system checkpoints the environment, releases compute, and restores the saved state when work returns. Snapshot restoration can memory-map the snapshot file, load CPU state, and resume execution without booting the kernel or running init again. That is different from launching a fresh machine.

For a browser agent, the saved state can include a signed-in session, an open tab, and a partially completed form. The machine can then sleep while a human considers an approval or an external event is pending. No active compute is needed for that wait. When the agent continues, it resumes the workspace, saving the cost of reconstruction.

If a disposable environment requires dependency installation, authentication, and browser-state reconstruction on each invocation, those operations consume billable compute without advancing the user’s task. An agent that does many short tasks throughout a day pays that overhead again and again. With a sleeping microVM, the setup cost is spread across those tasks instead. For per-user agents, the benefit grows from preserving each user’s own profile, preferences, and work history rather than treating every turn as a fresh deployment.

Sleep does not make every workload cheaper by definition. The advantage depends on how much work the environment retains and how costly that work would be to repeat. A stateless API call has little workspace to preserve, so durable orchestration can already make its waiting periods economical. A browser with an authenticated, partially completed workflow has far more to lose.

Security and isolation requirements for browser agents handling sensitive sessions

An authenticated browser holds access on a user’s behalf. If that browser is signed into a healthcare portal, financial system, or insurance platform, its credentials must remain inaccessible to other agents and tenants. The workspace is therefore a security boundary as well as a convenience. Preserving a session is useful only if the backend also keeps that session private.

Containers keep processes separate but still have shared kernel surfaces, through which a compromised or misbehaving agent can put co-tenants at risk. A microVM places a guest kernel and a hypervisor boundary between agents. Its own filesystem and network namespace further separate the workspace from neighboring tenants.

Network access needs its own controls as well. An agent should reach only the services it is authorized to use, with outbound access configurable per VM. An allowlist restricts routes to attacker-controlled infrastructure if browser content manipulates the agent. Hardware isolation does not replace that restriction, because separating machines and controlling their destinations solve different problems. Human desktop takeover also helps by letting a person review a live session without tearing it down.

For HIPAA-covered work, including EHR portals and insurance authorization systems, these boundaries form part of a defensible data protection analysis. They are not a compliance certification by themselves. A BAA or DPA addresses obligations that cannot be inferred merely from the use of a microVM. Security assessment therefore has to cover the deployment’s isolation, network configuration, and handling of authenticated sessions, rather than treating the choice of virtualization technology as the entire answer.

Matching the backend primitive to the browser agent's actual task shape

Diagram: Three Backend Primitives for Browser Agents. Visualizes: The article lays out three distinct backend choices for browser agents, each matched to a specific task shape: (1) Persistent microVM — when a live browser, signed-in session, or…

The choice starts with what needs to last between turns. Goal lifecycle, active execution, workflow state, and agent memory are separate concerns. A goal can stay open for days without needing compute the whole time. Durable orchestration is a reasonable fit when the next step is a pure API call, database read, or stateless transformation that can be reconstructed cheaply.

A live browser changes that decision. If the next turn depends on a signed-in profile, installed dependency tree, or partially completed GUI workflow, a persistent microVM preserves something orchestration alone cannot. A one-shot task has a different shape again. When nothing needs to survive completion, a throwaway sandbox can provide isolation and make deletion of the environment the cleanup guarantee. Parallel eval pipelines or RL rollouts call for swarms.

Maritime is one implementation of these patterns, offering persistent agent boxes and desktops, throwaway sandboxes, and swarms, with sleeping machines incurring no charges and Linux desktops and agent boxes waking in about a second. Its Dedicated plan includes a named engineer for custom integrations such as residential or static IPs, security groups and port rules, Windows desktops with installed software, and Android phones, while also offering a BAA and DPA.

Customers can bring their own model and keys or use the platform’s built-in metered LLM proxy. Persistent desktops support signed-in browser work, while Windows desktops and Android phones reach software that requires those operating environments. The recommendation for browser-agent backends is to start with the persistent-machine option when the workspace must survive. Use durable orchestration when stored workflow state is enough, and disposable execution when cleanup is the intended end state. That distinction makes the backend choice concrete without assuming every AI agent needs the same infrastructure.

Sources

  1. Do AI Agents Still Belong in Serverless? A Lifecycle Model for Agentic Compute
  2. TrEnv-X: Transparently Share Serverless Execution Environments Across Different Functions and Nodes
  3. New Kids: An Architecture and Performance Investigation of Second-Generation Serverless Platforms

More in Browser Agent Architecture