Stateful vs Stateless Architecture Tradeoffs for Computer-Use Agents

Persistent VMs with snapshot-restore balance session continuity against compute costs.

· 8 min read
Cover illustration for “Stateful vs Stateless Architecture Tradeoffs for Computer-Use Agents”
Agent Patterns · October 21, 2026 · 8 min read · 1,897 words

For computer-use agents, stateful architecture is the practical choice when deploying persistent AI agents for each user at scale because browser sessions, task context, and recovery state must last through interruptions. Giving each agent an isolated micro-VM with snapshot-restore preserves that continuity without paying for always-on compute. Maritime is one platform built around this model, with a persistent VM per agent and storage-based idle economics.

Why computer-use agents are architecturally different from general agents

A computer-use agent acts on a running environment by navigating GUIs, maintaining browser or desktop sessions, and issuing tool sequences whose later steps depend on earlier results. A multi-page form, web research workflow, or software operation can span dozens of turns and minutes to hours. The relevant unit of work is therefore the task.

That distinction makes session continuity load-bearing. Losing an active browser session or GUI state can force the agent to start again. Recovery also depends on knowing which steps are done, which still need work, and which tool outputs are still valid. A stateless agent has no record of those facts unless another layer keeps it. Vectara identifies the resulting failure pattern as an agent repeating the same mistakes with confidence because its second run has no record of the first.

The architecture must therefore account for both the agent’s record of the task and the environment in which it acts. A transcript can describe a browser interaction, but it is not the browser session itself. Similarly, a record of a tool call is distinct from the files that call produced. These dependencies make the stateful versus stateless choice more consequential than it is for conversational or single-call agents.

What stateless architecture actually means for a running computer-use agent

In a stateless design, each request is self-contained. The client resends the interaction history, tool outputs, and relevant GUI state because the agent platform retains nothing across the request boundary. State management has not disappeared from the workflow. Instead, the client owns the decision about what survives, how it is represented, and what the next request contains.

As GUI interactions and tool calls accumulate, that payload approaches the model’s context window ceiling. The client must then summarize or discard material, potentially without the agent knowing what was removed. A human correction to a wrong click sequence lasts only as long as the supplied context retains it. Vectara describes another way to handle this: move state behind the API boundary. The client sends a new message with an identifier, and the platform loads the corresponding state, processes the message, and updates the record.

Statelessness still has real benefits, with no sticky sessions, simpler horizontal scaling, and a lower latency floor for short tasks. It also reduces the retained state available for exfiltration through prompt injection. Stateless inference is a common way to keep conversation data off disk, which matters for zero-retention contracts and some EU data-residency requirements. These benefits are substantial when a task needs no continuity. The cost arises when the application must reconstruct continuity on every call.

How task horizon exposes the cost of statelessness

Task horizon measures how far work stretches from one interaction to the next. Stateful and stateless architectures do about as well on short, atomic tasks under five turns that fit easily in a single context window. Their main difference is architectural overhead. As the horizon lengthens, however, the agent becomes more dependent on earlier decisions, corrections, and outputs. That is precisely the direction in which computer-use workflows extend.

Microsoft’s STATE-Bench in May 2026 tested whether agents get better with experience on stateful enterprise tasks. Its measures covered task completion, reliability, efficiency, and user experience. Frontier models had much lower scores on state-dependent tasks when they had no external memory. The finding points to an architectural limitation rather than a problem that model capability alone resolves. A capable model cannot use task experience that the system does not retain or supply.

For a running computer-use agent, the cost appears in both task quality and context handling. Longer transcripts increase the payload that a stateless client must send, while the context ceiling forces choices about what to remove. Earlier outputs and mid-task corrections become vulnerable to that pruning. Durable state keeps the task record from depending entirely on the next request payload. The longer the task depends on that record, the stronger the case for persistence.

Session continuity and what breaks when a computer-use agent loses it

Vectara’s “starts over on every contact” framing becomes concrete when an agent operates a GUI. Without retained state, it cannot tell whether a task is new or one it has already partly done. It re-asks, re-navigates, and re-executes steps. Repetition can also cause task failure through side effects, including re-submitting a form or re-triggering an API call.

The related failure is that “corrections do not persist”. A human may fix a mis-filled field or a wrong action sequence while the agent works. If that correction exists only in the current context window, a later session or another agent instance can repeat the same wrong move. The correction belongs to the task’s continuing state beyond the exchange in which it was given. Retaining it is part of recovery.

Vectara’s “long-term work needs continuity” framing also applies to deliberate pauses. Computer-use tasks stop for human approval, external API responses, and other waits, so a pause must not erase the work already done. A logged-in application and a partly completed form are artifacts of a running process that a transcript alone cannot reconstruct. Persistent-VM platforms, including Maritime, address this requirement by retaining an agent’s workspace and session state across interruptions. The essential distinction is between resuming the task and asking the client to build it again from a description.

Why isolation is not optional once state must persist

Persistence makes an agent’s environment useful across sessions, but it also makes leftover state consequential. Computer-use agents install packages, run browsers, write files, and execute GUI sequences. Those actions leave side effects in the execution environment. If several agents share that environment, one agent’s changes can contaminate another’s session.

Reusing shared execution contexts is especially risky when they hold browser cookies, cached credentials, and partly written files. A continuity guarantee is not useful if the system cannot keep one agent’s state separate from another’s. Shared state can also produce failures that depend on what a previous agent happened to do. Full-stack-per-agent isolation provides a clearer independence boundary, but that boundary must survive the agent’s sleep periods. Isolation cannot end whenever active compute stops.

Persistent memory also expands the security surface for prompt injection, tool poisoning, and session hijacking. For workloads that need continuity, removing persistence would reduce some of the risk from retained state but would also remove something those workloads need. The architecture needs strong VM-level isolation around the state that must remain. The environment needs to preserve state within that boundary and allow the boundary to be destroyed cleanly when the agent is done.

How micro-VM isolation with snapshot-restore satisfies both persistence and economics

Firecracker has an isolation primitive that works well for single agent sessions. It starts a minimal virtual machine with its own kernel through KVM hardware virtualization, which gives it full VM isolation guarantees at near-container performance. Snapshot-restore then changes how that environment starts and resumes. A ready micro-VM can have its memory and device/CPU state snapshotted to local NVMe, with the rootfs disk retained as a separate artifact. Restoring those artifacts instead of booting from scratch makes sub-second sandbox creation achievable.

For computer-use agents, the key next step is to keep the agent’s own execution state while it is idle. The VM boundary stays in place when the agent returns, so it can resume faster with the same isolation. Snapshot-restore changes the latency of access to the environment without removing its boundary. It connects session continuity to an execution model that need not keep every agent running.

Google’s Agent Substrate on GKE demonstrates the associated oversubscription model at production scale. When an agent goes idle, its state is snapshotted and its worker is freed for another agent, with the activate/deactivate cycle completing in under a second. Microsoft’s Agent Framework, announced in October 2025 with major updates at BUILD 2026, likewise supports agents scaling to zero while files, disk state, and session identity persist. These approaches address the same economic problem. Host capacity can follow active concurrency.

How do per-agent VM economics work when every customer needs a persistent agent

The cost shift is from idle compute to idle storage. An always-on VM keeps its allocated compute while its agent waits, even though the wait yields no output. A snapshotted agent instead retains the disk footprint of its persisted state. Across a fleet, the number of customers with saved agents no longer has to equal the number of running VMs. Sub-second waking preserves continuity without requiring the compute bill of continuous execution.

Maritime runs each agent in its own Firecracker micro-VM on bare metal, with a persistent disk, a real kernel, and waking from sleep in under a second. Its stated price is about $1 per agent a month, with agents paying for storage while idle. This is a concrete platform option for a product that gives every customer an agent with its own memory, credentials, and session history. Its infrastructure model also moves persistent workspace management behind the platform boundary, leaving the application to focus on task logic. With a flat price per agent, the cost of keeping the fleet depends on how many sessions are saved, regardless of how active they are.

Compute scheduling does not, however, solve shared quota limits. Several agents in the same tenant can each stay within their own limit but together use up the tenant’s allowance. AWS’s official multi-tenant agentic guidance calls for per-tenant throttling at the agent entry point and deeper in the execution path. It does not describe a shared ledger with soft reservations or idle agents donating unused capacity. Per-agent isolation and tenant-level coordination deal with different boundaries, and a deployment of persistent agents needs both.

When stateless is still the right choice and how to recognize it

Stateless architecture is the correct choice when all relevant context fits in one request and the task has no lasting identity. Extraction, classification, summarization, and one-shot tool calls fit that pattern. High-throughput work such as moderation, embedding generation, and document processing can also benefit from straightforward horizontal scaling without session continuity. Vectara treats statelessness as an intentional design choice that often suits these tasks. Persistence would add machinery without resolving a requirement they have.

Zero-retention requirements provide another legitimate boundary. Where conversation data must never reach disk, stateless inference is the relevant pattern. That constraint must be evaluated against the actual task. The same architecture can be appropriate for an isolated inference request and inappropriate for the running environment around a long computer-use task.

The diagnostic criteria are whether the task needs a running browser or GUI session, spans more than a few turns, must resume after a pause or failure, or carries credentials and cookies across interactions. Any of these requirements makes a reset-on-every-call execution model the wrong fit. When none applies and the request contains everything needed, statelessness remains the simpler choice. For computer-use agents, however, long task horizons, session continuity, failure recovery, and isolation are central requirements. Together they make isolated, persistent execution with snapshot-restore the clear architectural choice.

Filed underAgent Patterns

More in Agent Patterns