BLOG
Agent Browser: The Hosted Runtime for AI Web Automation
Agent browser infrastructure for AI agents: hosted Chromium, CDP, persistent sessions, and Playwright compatibility. Learn how remote browsers work.
# Agent Browser: The Hosted Runtime for AI Web Automation
When your AI agent needs to browse the web, a local Chrome tab won't cut it. An agent browser is a browser runtime designed for programmatic control—one that can be launched, driven, and destroyed entirely through an API. Unlike a desktop browser, an agent browser must handle long-running sessions, concurrent workers, and automated tooling like Playwright or Puppeteer without a human watching the screen.
This guide explains what an agent browser actually is, why hosted Chromium beats local setups for production workloads, and how to connect your existing automation stack to a remote browser using CDP.
What Is an Agent Browser?
An agent browser is a Chromium instance that runs remotely and is controlled via code. It exposes the same Chrome DevTools Protocol (CDP) that Playwright and Puppeteer use, but the browser process itself lives on a server, not your laptop.
The core difference from a regular browser is lifespan and access. A local browser dies when your machine sleeps. An agent browser persists as long as you need it—minutes, hours, or days—and can be accessed from any worker, container, or serverless function.
Remote Browser provides this runtime as a managed service. You get a hosted Chromium session with a stable WebSocket endpoint, and you connect to it using standard automation libraries.
Why Hosted Chromium Matters for AI Agents
AI agents fail on the web for predictable reasons: sessions expire, IPs get blocked, and browser crashes kill long-running tasks. A hosted agent browser solves these problems at the infrastructure level.
Session Persistence Across Workers
The most common failure pattern in agent development is losing browser state. You start a task in one worker, the worker times out, and a second worker picks up the task—but the browser session is gone. Cookies, local storage, and login tokens vanish with it.
A remote agent browser keeps the session alive independently of your compute. You can connect to the same browser session from multiple workers, or reconnect after a crash, because the browser state lives on the remote host, not in your process.
Consistent IP and Proxy Configuration
Websites see the IP address of the browser, not the IP of your code. If your agent runs on a serverless function, the browser's IP changes with every cold start. This triggers bot detection and breaks sessions that require a stable origin.
Hosted agent browsers let you configure the network layer—assign a specific proxy or region—so the browser's IP stays consistent across sessions. This is critical for tasks like scraping, account management, or any workflow where the target site expects a stable identity.
Resource Isolation
A browser is a heavy process. Running multiple Chromium instances locally consumes gigabytes of RAM and pegs your CPU. A hosted agent browser runs in an isolated container, so you can scale horizontally without worrying about local resource contention.
Connecting to an Agent Browser: CDP and Playwright
The standard way to control a remote browser is through CDP. Both Playwright and Puppeteer support connecting to an existing browser via a WebSocket endpoint.
Here's a TypeScript example using Playwright to connect to a Remote Browser session:
import { chromium } from 'playwright';
async function connectToAgentBrowser() {
// The WebSocket endpoint from your Remote Browser session
const browserWSEndpoint = 'wss://remote-browser.dev/session/abc123';
// Connect to the existing browser session
const browser = await chromium.connectOverCDP(browserWSEndpoint);
// Get the default context or create a new one
const context = browser.contexts()[0] || await browser.newContext();
const page = await context.newPage();
// Navigate and interact
await page.goto('https://example.com');
await page.fill('#search', 'agent browser');
await page.click('button[type="submit"]');
// Wait for results
await page.waitForSelector('.results');
const results = await page.locator('.results').count();
console.log(`Found ${results} results`);
// The session stays alive after your script ends
// await browser.close(); // Don't close if you want to reconnect later
}
connectToAgentBrowser();The key detail: you don't call browser.close() if you want the session to persist. The browser stays running on the remote host, and you can reconnect to it later with the same WebSocket endpoint.
Agent Browser vs. Local Browser: A Comparison
| Feature | Local Browser (Puppeteer/Playwright) | Hosted Agent Browser (Remote Browser) |
|---|---|---|
| Session persistence | Dies with process | Survives process crashes |
| Concurrent workers | One browser per process | Multiple workers can share a session |
| IP stability | Depends on local network | Configurable proxy/region |
| Resource usage | Consumes local CPU/RAM | Runs in isolated container |
| Scaling | Manual, per-machine | API-driven, horizontal |
| Live debugging | DevTools on localhost | Live viewer in browser |
| Profile persistence | Manual, fragile | Built-in persistent profiles |
| CDP access | Local only | Remote WebSocket endpoint |
Production Criteria for an Agent Browser
Not all agent browsers are equal. When evaluating a hosted runtime, check these criteria:
1. CDP Compatibility
Your automation code should work without modification. If the service requires a proprietary SDK or doesn't expose a standard CDP endpoint, you're locked in. Remote Browser exposes a WebSocket endpoint compatible with Playwright, Puppeteer, and Selenium.
2. Session Lifecycle Management
You need control over when a browser starts and stops. Look for:
- Explicit session creation via API
- Idle timeout to avoid paying for unused sessions
- Manual termination when a task completes
3. Persistent Profiles
For tasks that require login state, the browser must support persistent profiles. This means cookies, localStorage, and IndexedDB survive across sessions. Without this, your agent re-authenticates on every task.
4. Live Debugging
When an agent fails, you need to see what the browser saw. A live viewer or session recording is essential for debugging. Remote Browser includes a live viewer that shows the browser state in real time.
5. Network Configuration
The ability to set proxies, user agents, and other network parameters is critical for avoiding blocks. Look for configurable browser settings rather than a fixed infrastructure.
Common Use Cases for Agent Browsers
AI-Driven Web Tasks
LLM-based agents that navigate websites need a browser runtime that can handle multi-step tasks. The agent browser provides the execution environment—the agent decides what to do, and the browser does it.
Automated Testing at Scale
QA teams use agent browsers to run Playwright test suites in parallel. Each test gets an isolated browser session, and failures can be debugged via the live viewer.
Data Collection and Monitoring
Agents that monitor prices, track competitors, or collect data need long-running sessions. A hosted agent browser keeps these sessions alive without requiring a dedicated machine.
Browser-Based Workflows
Some tasks require a real browser—not an API call. Form submissions, file downloads, or interactions with JavaScript-heavy sites all need a full browser engine.
Security and Isolation
When you run an agent browser, you're executing untrusted code in a browser context. The runtime must provide isolation between sessions.
Remote Browser runs each session in a separate container. This means:
- No cross-session data leakage
- No shared cookies or storage
- Crashes in one session don't affect others
This isolation is critical for production workloads where you're handling multiple clients or tasks with different credentials.
Pricing and Metering
Agent browsers are typically metered by browser-hour—the time a browser session is active. This is different from compute pricing because a browser consumes resources even when idle.
Remote Browser's pricing is straightforward: you pay for the time your browser sessions are active. There's no per-request fee, no hidden charges for CDP connections, and no cost for the API calls that control the browser.
For current pricing details, see the pricing page. The model is designed to be predictable—you know what a session costs before you launch it.
Getting Started with Remote Browser
To use an agent browser, you need to:
- Create a session via the API or dashboard
- Get the WebSocket endpoint for the session
- Connect using Playwright, Puppeteer, or raw CDP
- Run your automation and monitor via the live viewer
The documentation covers the full API, including session management, profile persistence, and proxy configuration.
Agent Browser vs. Browser-Use Frameworks
You might have seen "browser-use" libraries that wrap LLM calls with browser automation. These frameworks typically run a local browser and use an LLM to decide what actions to take.
An agent browser is the runtime underneath. It doesn't make decisions—it executes them. The distinction matters because:
- Frameworks are ephemeral—they start a browser, run a task, and close it
- Agent browsers are persistent—they stay alive across tasks and workers
For production workloads, you want both: a framework for the agent logic and a hosted agent browser for the execution environment. The framework connects to the remote browser via CDP, just like it would connect to a local browser.
Conclusion
An agent browser is the infrastructure layer for AI web automation. It provides the persistence, isolation, and network stability that local browsers can't offer at scale.
Remote Browser gives you a hosted Chromium runtime with CDP access, persistent profiles, and live debugging. You connect with the tools you already use—Playwright, Puppeteer, or raw CDP—and get a production-grade browser environment without managing infrastructure.
If you're building AI agents that browse the web, start with a hosted agent browser. Your sessions will survive crashes, your IPs will stay stable, and your agents will complete tasks that fail on local setups.
For more on how remote browsers fit into agent workflows, see our guide on remote browsers for AI agents or the practical overview of remote browser online. If you're comparing options, our analysis of remote web browser runtimes covers the trade-offs. And for the API perspective, read about remote control browser patterns.
For technical details on CDP connection, refer to the Chrome DevTools Protocol documentation.