Session Continuity and State Isolation Requirements When a Headless Browser API Serves Concurrent Agent Instances
Per-session containers keep concurrent agents from acting as the wrong user.

A web scraping API for agents should separate read-only extraction from browser work that needs a logged-in identity. For concurrent browser agents, the core requirements are per-session container isolation, explicit continuity controls, and session-scoped observability. Without those boundaries, a successful browser action can still be an action performed as the wrong user.
Why browsers carry state that breaks multi-agent concurrency by design
A database pool lends a connection so a worker can do work, while a browser pool can lend an entire prior user's authenticated context. A browser's profile holds cookies, localStorage, IndexedDB, service-worker caches, HTTP cache, and downloaded files, while sessionStorage retains context within a browsing session. These forms of state have different lifetimes, but navigation alone does not reset them.
That design assumes one human uses each browser profile. Keeping a login or a site preference helps that person pick up where they left off. However, when a worker pool reuses a profile to avoid launching a fresh browser, the next agent can inherit context it never requested. No browser error needs to occur. The browser is remembering exactly what it was designed to remember.
Remote Browser's API explainer identifies authentication, connection lifecycle, profiling, cleanup, and observability as production responsibilities. Those responsibilities distinguish a browser API from a remote connection to a browser. For concurrent agents, the architecture must define which state belongs to which agent and how long that ownership lasts. Otherwise, reuse becomes an implicit transfer of identity.
How silent state bleed produces failures that standard observability cannot catch
Consider a worker returning a browser to an idle pool. The next agent receives it and navigates successfully, but the previous session's OAuth cookie remains in the profile. The site accepts that cookie and opens the prior user's account. Nothing has failed at the navigation layer. Yet the agent is now working under an identity that does not belong to its task.
The more dangerous version involves a write. An agent instructed to update a CRM record could complete the edit against a different tenant's account because that is where the browser remains authenticated. The destination's audit log would record a legitimate edit by a real principal, even though the task intended a different account. This is a hypothetical consequence of the mechanism. Remote Browser's runtime post describes how stateless sessions lose context and lead to repeated work, but does not show this wrong-identity scenario.
Standard success signals cannot distinguish these two outcomes. Latency can remain normal, the action can complete, and an eval suite can show no regression if it does not detect the identity mismatch. An external party may be the first to notice incorrect data. If ordinary monitoring cannot tell correct-user success from wrong-user success, how does the architecture keep the failure from happening?
The external attack surface that profile reuse opens
An authenticated profile is also a security boundary. A stolen browser cookie can take the place of a password and an MFA prompt, so a leaked cookie jar can give someone access along with old browsing data. Exposed automation workbenches that pair headless Playwright instances with logged-in Chromium profiles are targets for harvesting SaaS cookies. Reuse gives that sensitive state a longer life. It also leaves more tasks dependent on the same stored credentials.
A malicious string in DOM content can become an instruction when an agent framework ingests it, potentially changing the agent's constraints and provoking adversarial tool calls. Those calls run within the headless browser, where they may change session cookies, open remote-debug ports, or exploit sandbox weaknesses. The page is therefore not merely passive input. It can influence the agent controlling the environment that holds authenticated state.
Internal reuse can give the wrong agent access to a profile, while an attacker can seek access to that profile from outside or through page content. Separate profiles alone do not establish process isolation. Security depends on a boundary that prevents one compromised session from reaching another.
Why clearing state at the browser level is not a reliable isolation primitive

Calling clearCookies() clears only the cookies in the browser state. Opening an incognito context also does not establish a process boundary. A complete cleanup would need to address localStorage, sessionStorage, IndexedDB, service-worker registrations and caches, HTTP cache, and extension storage, then verify the cleared state through a read. Missing one category leaves the boundary incomplete. A service worker left from a prior session is especially troublesome because it can intercept later requests before cookie-clearing logic runs.
ego's browser decision guide distinguishes a persistent profile from an authorized storage-state file. Both can retain account data, but treating them as interchangeable leads to incomplete isolation. The guide instead describes an isolated, user-authorized workspace with explicit reset and handoff controls. That distinction shifts the question from whether a cleanup call ran to whether ownership of the workspace is enforced.
Some state also exists below those storage abstractions. CVE-2026-6770 exposed a stable, process-lifetime identifier through IndexedDB ordering across origins and private sessions. The boundary was between process-scoped and origin-scoped state and went beyond the boundary between profiles. Cookie cleanup cannot enforce that boundary. Manual clearing remains a convention whose completeness the application must establish, while a separate execution environment gives the boundary an enforcement mechanism.
The per-session isolated container as the enforcement primitive the industry has converged on
Hyperbrowser's architecture explainer says each session is a secure, isolated container that runs a real Chrome instance. Cookies, storage, tabs, and fingerprint state belong to that session. The explainer states that a failure, crash, or malicious page in one session cannot spill into another. Isolation is the starting condition. Existing Playwright, Puppeteer, and Selenium scripts can connect with little more than a connection-string change.
Steel uses the same session-centered model, starting a real browser in under a second and releasing it when work ends. Its Sessions API and Commands API provide control over those browser sessions. Its account-per-agent model also gives each agent its own identity, so it can sign in as itself across runs. That adds a necessary distinction. An isolated browser still needs an explicit decision about whose persistent state it may load.
Remote Browser's runtime post says isolation protects against runaway navigation loops, heavy pages, and leaked scripts that use up resources. In the container model, creation yields a WebSocket endpoint for a compatible client, and teardown removes the execution environment's state. Deliberately saved profile state has a separate lifecycle. That separation also narrows debugging to one session instead of a profile altered by several prior agents.
Session continuity across multi-step agent workflows without reintroducing shared state

Isolation seems to destroy the continuity agents need. If every browser environment goes away at teardown, a multi-step workflow could lose its login and have to repeat the costly setup on every turn. The solution separates execution from persistence. A container isolates the active session, while a profile stores the state that is allowed to survive it. A new session loads that profile, and teardown saves the changes that are allowed back to it.
A profile can retain cookies, localStorage, IndexedDB, and site preferences. The one-active-session-per-profile constraint prevents two agents from writing conflicting state into the same saved context. Concurrent work needs multiple profiles instead. Giving each agent or task type its own profile preserves separation without forcing every run to begin unauthenticated.
Remote Browser's runtime post uses inventory checks, daily social posts, and authenticated customer-service dashboards to explain why repeated login is an operational obstacle. Steel's Sessions API supports exporting session context after a run and supplying it when creating another session. Its timeout parameter controls how long a context remains valid.
Serverless workers invert where that continuity must live. A function invocation is ephemeral, so its process cannot be the durable home of the browser. Instead, the worker persists a session ID and reconnects to the same remote session on its next invocation. The browser outlives the worker. That keeps the agent's control loop separate from the lifetime of its authenticated browser context.
Observability requirements that match the isolation model
Session-aware observability must expose more than whether an action completed. It must let a team examine what a particular agent saw and did within its authenticated context. A live viewer lets a team check identity and account context during the run without interrupting the agent. Recordings support investigation after the session ends. Replay avoids depending on a later attempt to reconstruct state that may no longer exist.
Hyperbrowser provides a live URL for viewing a running session and recordings for replay. The session boundary ties those records to one session and keeps them from mixing the work of agents that take turns using a shared browser. Steel adds readable traces, a live session viewer at 1080p resolution, and replays once the run is over. Its MCP server lets an agent list past runs and read their logs and traces. Observability can therefore support both the agent's reasoning and human debugging.
A person may need to complete two-factor authentication, confirm a payment, or resolve an ambiguous UI state before returning control to the agent. Destroying the session at that point would discard the context the handoff was meant to preserve. The viewer and control boundary must let the human complete a step within the existing session while preserving its identity and history.
Isolation makes that history attributable to a particular run. In a shared profile, a recording of one agent cannot by itself explain state inherited from every other agent that touched the profile. Separating state is a prerequisite for knowing what an agent actually did.
Architectural requirements checklist for a headless browser API serving concurrent agents
A platform evaluation should treat isolation as an enforced property. Each concurrent session needs its own isolated environment, with automatic teardown and no shared state surface between sessions. Profile separation is not enough where state can leak within a process. The platform must also prevent simultaneous writes to one persistent profile rather than leave that rule to application convention.
Continuity should have two explicit paths. Profile-backed sessions keep the account state that is allowed between browser runs, while session-ID persistence lets a new worker reconnect to a browser session that is still there. Remote Browser's API explainer states that a session can remain alive after client disconnection so the agent can reattach. The evaluation should establish which path a workflow needs and whether the platform enforces its ownership rules.
Operational controls need equally clear scope. Live viewing, recordings, and readable traces should show a given run and its session context, going beyond results for the fleet as a whole. Human intervention must preserve that session when control passes back to the agent. Billing should be clear and based on use, with charges in credits or session-hours and no hidden minimums. A free tier should let teams validate the integration before committing.
Extraction is a separate requirement from browser control. For read-heavy work, Markdown and structured JSON let agents consume content without parsing raw HTML or maintaining an authenticated browser profile. Context.dev is one option for fetching pages in those formats or running live agent search through an API, avoiding an authenticated session that could bleed between agent instances for those tasks. Workflows that interact with the browser still need the browser controls described above. A clean data API and an isolated browser runtime serve different layers of the same agent architecture.


