← Blog

BLOG

Agent Broser: The Production Runtime for AI Browser Agents

Agent broser infrastructure explained: how hosted Chromium solves session persistence, scaling, and reliability for AI browser agents in production.

September 6, 20269 min readRemote Browser

# Agent Broser: The Production Runtime for AI Browser Agents

If you are building an AI agent that needs to browse the web, you have likely hit a wall: local browser sessions die, cloud workers are ephemeral, and scaling Playwright or Selenium workloads reliably is harder than it looks. The term "agent broser" (often misspelled as "agent browser" or "agent browswer") describes the runtime layer that keeps these agents operational. This guide explains what an agent broser actually requires in production, why hosted Chromium is the pragmatic answer, and how to connect your stack without rewriting your automation code.

What Is an Agent Broser?

An agent broser is not a consumer browser like Chrome or Firefox. It is a browser runtime designed to be driven programmatically by an AI model or automation script. Unlike a human clicking buttons, an agent needs deterministic control, session persistence, and the ability to scale horizontally across many parallel tasks.

The core components of a production agent broser include:

  • A real browser engine (typically Chromium) that renders JavaScript and handles modern web standards.
  • A control protocol such as the Chrome DevTools Protocol (CDP) or WebDriver, allowing external code to navigate, click, type, and extract data.
  • Session persistence so that cookies, localStorage, and login states survive across requests and worker restarts.
  • Isolation between tasks to prevent cross-contamination of data or state.
  • Observability tools like live viewing and session recording for debugging.

Local browser setups fail on the first two requirements when you move beyond a prototype. A hosted agent broser runtime addresses all of them.

Why Local Browsers Fail in Production

Developers often start with a local Playwright or Puppeteer script. It works on a laptop. The moment you deploy to a cloud worker or a container, problems emerge.

Ephemeral Workers Kill Sessions

Serverless functions and most cloud workers are stateless. Every invocation may spin up a fresh environment. If your agent logs into a site and then the worker terminates, the session is gone. The next invocation starts from zero, forcing re-authentication and breaking multi-step workflows.

Resource Contention

Headless browsers are memory-hungry. A single Chromium instance can consume 300-500 MB of RAM. Running multiple sessions on one machine leads to resource contention, slower execution, and flaky results. You need a strategy for scaling browser instances independently from your application logic.

IP Reputation and Blocking

Websites increasingly block traffic from cloud provider IP ranges. If your agent runs from a single data center, you will encounter CAPTCHAs and 403 errors. A production agent broser needs configurable network settings, including the option to route through different proxies or residential IPs.

Debugging Is Opaque

When an agent fails, you need to see what happened. Local browsers offer a DevTools window, but in production, you have no visual feedback. Without session recording or a live viewer, debugging becomes guesswork.

The Hosted Agent Broser Runtime

Remote Browser provides a hosted Chromium runtime designed for AI agents and automation workloads. Instead of managing browser infrastructure, you connect to a remote session via a simple API. The browser runs in the cloud, and your code controls it over CDP or WebDriver.

This architecture solves the core problems:

  • Session persistence: Browser sessions live on dedicated instances, not ephemeral workers. They remain alive across API calls and worker restarts.
  • Scalability: Spin up multiple isolated browser sessions in parallel. Each session has its own resources, so one heavy task does not degrade another.
  • Network flexibility: Configure proxy settings per session to manage IP reputation.
  • Observability: Use the live viewer to watch sessions in real time or record them for later analysis.

Connecting Your Agent to a Remote Browser

The most common integration path is via CDP. Playwright and Puppeteer both support connecting to an existing browser over CDP, which means you can keep your existing automation code and simply change the connection target.

Here is a TypeScript example using Playwright to connect to a Remote Browser session:

import { chromium } from 'playwright';
import { RemoteBrowserAPI } from '@remote-browser/sdk';

// 1. Create a new browser session via the Remote Browser API
const api = new RemoteBrowserAPI({
  apiKey: process.env.REMOTE_BROWSER_API_KEY,
});

const session = await api.sessions.create({
  // Persistent profile ID if you need to maintain login state
  profileId: 'prof_abc123',
  // Optional: route through a specific proxy
  proxy: { country: 'us' },
});

// 2. Connect Playwright to the remote Chromium instance via CDP
const browser = await chromium.connectOverCDP(
  `wss://remote-browser.dev/cdp/${session.id}`
);

// 3. Use the browser as you normally would
const page = await browser.newPage();
await page.goto('https://example.com');
await page.fill('#username', 'agent-user');
await page.click('#login-button');

// The session stays alive after this script ends.
// You can reconnect later from another worker.

await browser.close();

The key point is that connectOverCDP gives you a live connection to a browser that persists independently of your script. If your worker crashes, the session remains. You can reconnect and continue from where you left off.

Playwright and Selenium Compatibility

A common concern is whether hosted browsers work with your existing tooling. The answer depends on the protocol.

Playwright

Playwright supports connectOverCDP for Chromium-based browsers. This is the recommended path for Remote Browser. You can use Playwright's full API—locators, auto-waiting, and network interception—against a remote Chromium instance.

For Firefox, the situation is different. Playwright's connectOverCDP is Chromium-only. Firefox does not support CDP natively; it uses the WebDriver BiDi protocol. If you need Firefox, you must use Selenium or the WebDriver protocol instead.

Selenium

Selenium WebDriver works with any browser that implements the WebDriver protocol. Remote Browser sessions can be exposed as WebDriver endpoints, allowing Selenium scripts to connect without modification. This is useful for teams with existing Selenium test suites who want to move to hosted infrastructure.

Puppeteer

Puppeteer connects to Chromium over CDP natively. The puppeteer.connect() method accepts a browserWSEndpoint or browserURL, making it straightforward to attach to a remote session.

Scaling Browser Workloads Reliably

Scaling browser automation is not just about adding more instances. You need to manage concurrency, session lifecycle, and resource allocation.

Session Isolation

Each task should run in its own browser session. This prevents state leakage between tasks and makes it easier to debug failures. If one session crashes, it does not affect others.

Concurrency Limits

Running too many sessions on a single instance degrades performance. A hosted runtime lets you scale horizontally: each session gets a dedicated or semi-dedicated browser instance. You can run numerous parallel sessions without worrying about local resource limits.

Session Lifecycle Management

Decide when sessions should be created and terminated. For short tasks, create a session, run the task, and close it. For long-running agents that need to maintain state, keep the session alive and reconnect as needed.

The table below compares local browser setups with a hosted agent broser runtime:

RequirementLocal Browser SetupHosted Agent Broser Runtime
Session persistenceLost when process exitsSurvives across API calls and worker restarts
ScalingManual, resource-boundHorizontal, isolated sessions
IP diversitySingle machine IPConfigurable proxy settings
DebuggingLocal DevTools onlyLive viewer, session recording
Setup timeHigh (infra management)Low (API key + connect)
Resource usageContends with app codeDedicated browser instances
Protocol supportCDP or WebDriverCDP and WebDriver

Keeping Sessions Alive Across Cloud Workers

One of the most frequent questions from developers is how to keep a browser session alive when using serverless functions. The answer is to decouple the browser from the worker.

In a typical serverless flow, each function invocation is stateless. If your agent needs to perform a multi-step task that spans multiple invocations, you cannot store the browser state in the worker. Instead, you store a session ID and reconnect to the same remote browser.

Here is the pattern:

  1. Create a session on the first invocation. Store the session ID in your database or queue.
  2. Perform a step of the task. Close the connection but leave the session running.
  3. On the next invocation, retrieve the session ID and reconnect via CDP.
  4. Continue where you left off. The browser state, cookies, and DOM are intact.

This pattern works because the browser runs on a dedicated instance, not inside the worker. The worker is just a client that connects and disconnects.

Security and Access Control

When you expose a browser to an AI agent, you need to control what it can do. Remote Browser provides usage controls and session isolation to mitigate risk.

Scoped Permissions

Define which domains the agent can access. Block navigation to internal tools or administrative interfaces. This is critical when an agent has access to sensitive systems.

Session Timeouts

Set maximum session durations to prevent runaway agents from consuming resources indefinitely. A production runtime should enforce idle timeouts and hard limits.

Audit Logs

Record every action the agent takes. This is essential for debugging and for compliance in regulated environments. Session recording gives you a visual replay of what happened.

When to Use a Hosted Agent Broser

Not every workload needs a hosted runtime. If you are running a few scheduled scripts on a single VM, local browsers may suffice. But consider a hosted runtime when:

  • Your agents run for more than a few minutes and need to maintain state.
  • You are using serverless functions or ephemeral containers.
  • You need to run many sessions in parallel.
  • Your agents interact with sites that are sensitive to IP reputation.
  • You need to debug failures without access to a local display.

Getting Started

Remote Browser offers a straightforward path from local development to production. The API is designed to be a drop-in replacement for your current browser connection logic.

  1. Sign up and get an API key.
  2. Create a session via the REST API or SDK.
  3. Connect using Playwright, Puppeteer, or Selenium.
  4. Scale by creating more sessions as needed.

For detailed integration guides, see the documentation. To understand how the runtime fits into broader AI agent architectures, read our post on remote browsers for AI agents.

Conclusion

An agent broser is the runtime layer that makes AI web automation reliable. Local browsers are fine for prototypes, but production workloads demand session persistence, isolation, and scalability. A hosted Chromium runtime provides these capabilities without requiring you to manage browser infrastructure.

The shift from local to hosted is not about replacing your automation code. It is about changing where the browser runs. By connecting over CDP or WebDriver, you keep your existing Playwright, Puppeteer, or Selenium logic and gain the operational benefits of a managed runtime.

For a deeper look at how hosted browsers compare to self-managed infrastructure, see our analysis of browser-as-a-service vs self-hosted Playwright infra. If you are evaluating costs, our pricing page outlines the current metering model.

The web is the interface your agents need to navigate. Give them a browser runtime that can handle production traffic.