← Blog

BLOG

Agentic Browsers: What They Are and How to Run Them

Agentic browsers let AI agents drive real Chromium. Learn the architecture, runtime requirements, and how to run them in production.

8 min readRemote Browser
Ivory computer towers connected across terracotta platforms in a quiet desert landscape
The infrastructure behind your browserREMOTE BROWSER / ILLUSTRATION

Agentic browsers are browsers driven by an AI agent rather than a human. The agent observes the page, decides what to do next, and executes actions — clicking, typing, scrolling, navigating — through a control protocol. The browser is the execution environment; the agent is the decision-maker. This distinction matters because it changes what the browser must provide: not just rendering, but a stable, observable, isolated session that a model can reason over and a runtime can supervise.

This article covers what makes a browser "agentic," how the control loop actually works, what breaks when you move from a demo to production, and how to evaluate a runtime. If you are already past the definition stage and want the runtime layer, see Remote Browser for AI agents.

What makes a browser agentic

A conventional browser automation script is deterministic. You write page.click('#submit') and it runs. An agentic browser inverts this: the agent receives a representation of the page, produces an action, and the runtime executes it. The loop repeats until the task completes or the agent gives up.

Three properties define the category:

  • Model-driven control. The next action is chosen by a language model or a policy, not hardcoded. The same agent can handle a form it has never seen.
  • Observation-action loop. The agent needs a view of the page — DOM snapshot, accessibility tree, screenshot, or a mix — and a way to act on it. Latency between observation and action is a first-class concern.
  • Real browser execution. The agent drives an actual Chromium instance, not a headless HTTP client. JavaScript-heavy sites, login flows, and client-side rendering all behave as they do for a human.

That last point is why agentic browsers exist as a category separate from API-calling agents. Many web tasks have no API. The browser is the only interface.

How the control loop works

Underneath almost every agentic browser is the Chrome DevTools Protocol (CDP). CDP exposes the browser's internals over a WebSocket: you can navigate, evaluate JavaScript, capture screenshots, intercept network requests, and read the DOM. Playwright, Puppeteer, and Selenium all sit on top of it or alongside it.

A minimal loop looks like this:

  1. The runtime creates a browser session and returns a CDP endpoint.
  2. The agent connects, navigates to a URL, and captures an observation.
  3. The model receives the observation and returns an action (click, type, scroll, extract).
  4. The runtime executes the action and captures a new observation.
  5. Repeat until the task's success condition is met.

The observation format is a design decision with real consequences. A full DOM dump is token-expensive and noisy. An accessibility tree is compact but can hide visual state. Screenshots are faithful but slow to process. Most production agents use a hybrid and prune aggressively.

Here is a minimal Playwright connection over CDP to a hosted session — the pattern most agentic browsers expose:

import { chromium, Browser, Page } from "playwright";

interface SessionInfo {
  cdpUrl: string;
  sessionId: string;
}

async function connectToAgentBrowser(session: SessionInfo): Promise<{ browser: Browser; page: Page }> {
  // Connect to the hosted Chromium instance over CDP.
  const browser = await chromium.connectOverCDP(session.cdpUrl);

  // Reuse the existing context so cookies and storage persist across the session.
  const context = browser.contexts()[0] ?? (await browser.newContext());
  const page = context.pages()[0] ?? (await context.newPage());

  await page.goto("https://example.com", { waitUntil: "domcontentloaded" });
  return { browser, page };
}

async function observe(page: Page): Promise<string> {
  // A compact observation: accessibility snapshot plus the current URL.
  const snapshot = await page.accessibility.snapshot();
  return JSON.stringify({ url: page.url(), snapshot });
}

async function act(page: Page, action: { type: string; selector?: string; text?: string }) {
  switch (action.type) {
    case "click":
      await page.click(action.selector!);
      break;
    case "type":
      await page.fill(action.selector!, action.text!);
      break;
    case "scroll":
      await page.mouse.wheel(0, 800);
      break;
  }
  await page.waitForLoadState("networkidle").catch(() => {});
}

The important detail is connectOverCDP. You are not launching a browser; you are attaching to one that already exists on a remote host. That is the architectural hinge for everything that follows. The Playwright CDP documentation covers the connection semantics, and the Chrome DevTools Protocol reference covers the underlying domains.

Local Chrome vs. hosted runtime

The first production decision is where the browser runs. Running Chrome on the same machine as the agent is fine for development. It stops being fine when you need concurrency, isolation, or persistence.

CriterionLocal Chrome on the agent hostHosted Chromium runtime
SetupInstall Chrome, manage versionsConnect to a CDP endpoint
ConcurrencyLimited by host CPU/RAMScales per session, subject to plan limits
IsolationShared profile and filesystemSession-level isolation
PersistenceManual profile managementConfigurable persistent profiles
ObservabilityLocal logs onlyLive viewer, session recordings
Failure recoveryRestart the hostReconnect or recreate the session
Network controlsWhatever the host hasConfigurable proxy and browser settings
Cost modelHost computeMetered per browser-hour

Local Chrome is not wrong — it is just not a runtime. The moment you run more than a handful of agents, you are building a scheduler, a profile store, and a cleanup process. That is the work a hosted runtime absorbs. For the broader case, see Remote Browser online.

Production criteria for agentic browsers

When you evaluate a runtime for agentic workloads, these are the properties that determine whether agents succeed at scale. They are not marketing features; each one maps to a specific failure mode.

Session isolation

Two agents sharing a profile will corrupt each other's cookies, local storage, and login state. Isolation means each session gets its own browser context and, ideally, its own filesystem namespace. Verify that isolation is per-session, not per-account.

Persistent profiles

Some tasks require staying logged in across sessions — a dashboard the agent checks hourly, an inbox it triages. Persistent profiles let you reuse authenticated state without re-running the login flow every time. The trade-off is that profiles are stateful and need lifecycle management: versioning, rotation, and cleanup.

CDP access and framework compatibility

If the runtime only exposes a proprietary action API, you are locked into its agent loop. CDP access means you can bring Playwright, Puppeteer, Selenium, or your own client. Confirm that connectOverCDP works and that the endpoint is stable for the session's lifetime.

Live viewer and debugging

Agentic browsers fail in ways scripts do not: the agent misreads the page, clicks the wrong element, or loops. A live viewer lets a human watch the session in real time and intervene. Session recordings let you replay a failure after the fact. Without these, debugging an agent is guesswork.

Network and browser settings

Proxies, geolocation, locale, timezone, and user-agent are configurable browser settings that affect whether a site treats the session as legitimate. Be precise about what you need: "configurable proxy and browser settings" is the honest claim, and anything stronger should be backed by evidence from the vendor. Ask exactly which settings are exposed and how they are applied per session.

Usage controls and metering

Agentic workloads are bursty. You need to know how sessions are metered, what happens at your concurrency ceiling, and how to cap spend. Check pricing for the current model rather than assuming.

Where agentic browsers break in production

The gap between a working demo and a reliable agent is usually one of these:

  • Observation drift. The page changes between observation and action. The agent clicks a stale selector. Mitigation: re-observe after every action and use resilient locators.
  • Login and session expiry. Auth state expires mid-task. Mitigation: persistent profiles plus explicit re-auth handling in the agent loop.
  • Bot defenses. Sites challenge automated traffic. Mitigation: realistic browser settings, a proxy configuration that matches your traffic profile, and honest handling of CAPTCHAs rather than assuming they never appear.
  • Runaway loops. The agent retries the same failing action indefinitely. Mitigation: step budgets, loop detection, and a hard session timeout.
  • Cost surprises. Long-running sessions with idle time. Mitigation: stop sessions when the task completes; meter and alert.

None of these are solved by a better model alone. They are runtime concerns, which is why the runtime choice matters as much as the agent framework. For a deeper look at controlling sessions remotely, see Remote control browser.

Choosing a runtime

A practical evaluation sequence:

  1. Confirm CDP access. Connect Playwright with connectOverCDP and run a trivial task. If this fails, stop.
  2. Test isolation. Run two sessions concurrently against the same site with different logins. Verify no state leaks.
  3. Test persistence. Create a profile, log in, close the session, reopen, and confirm the login survives.
  4. Watch a session live. Confirm the viewer works and that you can intervene.
  5. Measure failure recovery. Kill a session mid-task and see how the runtime reports it and how fast you can recreate it.
  6. Read the metering. Understand what counts as a browser-hour and what your concurrency ceiling is.

Run this against two or three runtimes with your own workload. Generic benchmarks rarely reflect your task distribution.

The bottom line

Agentic browsers are not a new browser engine — they are a control pattern layered on real Chromium. The agent supplies judgment; the runtime supplies isolation, persistence, observability, and scale. Getting the first part right is a model and prompt problem. Getting the second part right is an infrastructure problem, and it is the one that determines whether your agents work outside a notebook.

If you want to test the runtime side, the documentation covers session creation, CDP connection, and profile management. Start with a single session, connect over CDP, and watch it run before you scale.