← Blog

BLOG

Agents Browser: The Production Runtime for AI Web Automation

Agents browser runtime: hosted Chromium, CDP, and Playwright for AI agents. Keep sessions alive across workers and scale automation.

September 1, 20269 min readRemote Browser

# Agents Browser: The Production Runtime for AI Web Automation

When your AI agent needs to browse the web, a local Chrome instance rarely survives contact with production. Sessions die when a worker restarts, IP reputation gets you blocked, and debugging a headless browser that no one can see is painful. An agents browser runtime solves these problems by moving Chromium to the cloud and exposing it through a simple API. Remote Browser provides hosted Chromium sessions with CDP access, Playwright and Puppeteer compatibility, persistent profiles, and a live viewer—so your agent can do real work without you managing browser infrastructure.

This guide covers what an agents browser runtime actually does, how to connect your existing Playwright or Selenium code, and the production criteria that separate a hosted browser from a local script.

What Is an Agents Browser Runtime?

An agents browser runtime is a hosted Chromium instance that your AI agent controls over the network. Instead of launching a browser inside your worker process, you connect to a remote session via the Chrome DevTools Protocol (CDP) or a WebSocket endpoint. The browser runs in a data center, not on your machine.

This matters for AI agents because of three constraints:

  1. Session persistence — A local browser dies when your worker restarts. A hosted session can stay alive across multiple workers, so your agent can pick up where it left off.
  2. Resource isolation — Browsers are memory-hungry. Running them inside your application server competes with your actual workload.
  3. Observability — You cannot debug an agent that fails silently in a headless browser. A live viewer lets you watch what the browser is doing in real time.

Remote Browser implements this runtime with hosted Chromium, exposing a standard CDP endpoint and a REST API. You connect with Playwright, Puppeteer, or Selenium—whichever your agent already uses.

Why Local Browsers Fail in Production

Local browser automation works fine for a script you run once. It breaks in production for reasons that have nothing to do with your code.

Session Lifecycle

A typical AI agent workflow looks like this:

  1. A user submits a task.
  2. Your orchestrator spins up a worker.
  3. The worker launches a browser, navigates, extracts data, and returns a result.
  4. The worker terminates.

If the task takes longer than the worker's lifetime—or if the worker crashes—the browser session is gone. Any cookies, local storage, or in-progress form state is lost. For agents that need to log in, fill a multi-step form, or maintain a shopping cart, this is fatal.

A hosted agents browser decouples the browser session from the worker. The browser lives in the cloud. Workers connect, disconnect, and reconnect without losing state.

IP Reputation and Blocking

Data center IPs are heavily flagged by anti-bot systems. If your agent runs from a cloud worker, it will hit CAPTCHAs and 403s that a residential IP would not. Remote Browser supports configurable browser settings and proxy options so you can route traffic through IPs with better reputation.

Debugging Blind

Headless browsers are invisible. When an agent fails, you get a stack trace and nothing else. A hosted runtime with a live viewer lets you watch the browser render pages, see where the agent clicked, and replay the session.

How to Connect Your Agent to a Hosted Browser

The most common integration path is Playwright's connectOverCDP method. This lets you attach to an existing browser session without launching a new one.

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

import { chromium } from 'playwright';

// The CDP endpoint from your Remote Browser session
const cdpUrl = 'wss://remote-browser.dev/cdp/your-session-id';

// Connect to the existing hosted Chromium instance
const browser = await chromium.connectOverCDP(cdpUrl);

// Get the default context and page
const context = browser.contexts()[0];
const page = context.pages()[0];

// Now your agent can drive the browser
await page.goto('https://example.com');
await page.fill('#search', 'agents browser');
await page.click('button[type="submit"]');

// Wait for results
await page.waitForSelector('.result');
const results = await page.$$eval('.result', (els) =>
  els.map((el) => el.textContent)
);

console.log(results);

// The session stays alive after your script ends
// await browser.close(); // Don't close if you want to reconnect later

The key detail: you do not call browser.close() if you want the session to persist. The browser stays alive in the cloud, and your next worker can connect to the same CDP endpoint.

Keeping Sessions Alive Across Cloud Workers

One of the most common questions we hear is: *How do I keep browser sessions alive across multiple cloud workers?*

The answer is to treat the browser as a stateful service, not a process you spawn. With Remote Browser, you create a session once, get a CDP endpoint, and share that endpoint across workers.

Here is the pattern:

  1. Create a session via the Remote Browser API. You get back a session ID and a CDP WebSocket URL.
  2. Store the session ID in your orchestrator's state store (Redis, Postgres, or your workflow engine).
  3. Connect from any worker using connectOverCDP with the stored URL.
  4. Reconnect after failures — if a worker crashes, the next worker connects to the same session and continues.

This works because the browser is not tied to any single worker's lifecycle. It runs until you explicitly terminate it or it hits your usage limits.

Playwright CDP vs. Selenium: What Works with Hosted Browsers

Most AI agent frameworks use Playwright or Puppeteer because they support CDP natively. Selenium works too, but the integration is less direct.

FeaturePlaywright (connectOverCDP)Puppeteer (connect)Selenium (WebDriver)
CDP supportNativeNativeVia WebDriver BiDi
Session persistenceYes, reconnect to same sessionYes, reconnect to same sessionLimited
Live viewerWorks via CDPWorks via CDPRequires separate setup
Stealth/configurable settingsYesYesPartial
Best forAI agents, browser-use workflowsLightweight agentsLegacy test suites

For new AI agent projects, Playwright with connectOverCDP is the most straightforward path. It is well-documented, has first-class TypeScript support, and works with the hosted browser model.

Production Criteria for an Agents Browser

Not all hosted browsers are equal. When evaluating an agents browser runtime, check these criteria:

1. Session Isolation

Each session should be isolated from others. A crash in one browser should not affect another. Remote Browser runs each session in its own Chromium instance, so failures are contained.

2. Persistent Profiles

Your agent will need to log in to sites, accept cookies, and maintain preferences. A persistent profile stores this state across sessions. Without it, your agent re-authenticates every time.

3. Proxy and IP Controls

Anti-bot systems are the biggest operational risk for web agents. Look for a runtime that lets you configure proxy settings and browser fingerprints. Remote Browser supports configurable browser settings so you can tune how the browser presents itself.

4. Live Debugging

When an agent fails, you need to see what happened. A live viewer that shows the browser's current state—and ideally records the session—is essential for debugging.

5. Usage Controls

Browsers are expensive to run. You need per-session time limits, concurrency controls, and cost tracking. Remote Browser provides usage controls so you can cap how long a session runs and how many sessions you spin up.

6. API Compatibility

Your agent code should not need to change when you move from local to hosted. The runtime should expose standard CDP and WebSocket endpoints that work with Playwright, Puppeteer, and Selenium.

Common Use Cases for an Agents Browser

AI Web Agents

The primary use case. An LLM decides what actions to take, and the browser executes them. The agent needs a reliable, observable browser that does not get blocked. A hosted runtime gives you that.

Browser-Use Workflows

Frameworks like browser-use (the Python library) and similar tools expect a browser they can drive. Remote Browser provides the runtime layer that these frameworks connect to.

Data Extraction at Scale

When you need to scrape data from sites that require JavaScript rendering, a hosted browser is more reliable than a simple HTTP client. You get full rendering, cookie handling, and the ability to interact with dynamic content.

Testing and QA

While not the primary focus, a hosted browser works for UI testing. You can run Playwright tests against a remote Chromium instance and watch them execute in the live viewer.

Trade-Offs: Hosted vs. Local Browsers

Hosted browsers are not always the right choice. Here is an honest comparison:

CriterionHosted (Remote Browser)Local (Your Machine)
LatencyHigher (network round-trip)Lower (same process)
Session persistenceHigh (survives worker restarts)Low (dies with process)
IP reputationConfigurable (proxy support)Depends on your IP
DebuggingLive viewer, replayDevTools on localhost
ScalingAdd sessions via APIAdd processes on your box
CostPer browser-hourYour existing compute

If your agent runs a single, short task and does not need persistence, a local browser is simpler. But for anything that runs longer than a few minutes, needs to survive worker restarts, or requires reliable IP reputation, a hosted runtime wins.

Getting Started with Remote Browser

To start using an agents browser runtime:

  1. Create an account at remote-browser.dev.
  2. Create a session via the API or dashboard. You get a CDP endpoint.
  3. Connect with Playwright using connectOverCDP as shown above.
  4. Set usage limits so you do not overspend on browser hours.

For detailed API documentation, see the Remote Browser documentation. For current pricing and session limits, check the pricing page.

If you are building AI agents that browse the web, these posts cover adjacent topics:

For the underlying protocol, the Chrome DevTools Protocol documentation is the authoritative reference. Playwright's connectOverCDP documentation is also worth reading if you are new to remote browser connections.

The Bottom Line

An agents browser runtime is not a luxury—it is the difference between a demo and a production system. Hosted Chromium gives your AI agent a persistent, observable, and scalable browser that does not die with your worker. Whether you are building a browser-use agent, a data extraction pipeline, or a QA harness, the pattern is the same: connect your code to a remote browser, keep the session alive, and let the runtime handle the infrastructure.

Start with a single session, connect your existing Playwright code, and see how much simpler your agent becomes when the browser is not the bottleneck.