← Blog

BLOG

Browser Use Tools: A Practical Guide for AI Agents

Browser use tools explained: how AI agents drive Chromium, where CDP fits, and how to run browser use models on a hosted runtime.

September 23, 20268 min readRemote Browser

# Browser Use Tools: A Practical Guide for AI Agents

Browser use tools are the software layer that lets an AI agent open pages, click elements, read the DOM, and complete multi-step tasks on the live web. If you are evaluating them, the useful question is not "which library is best" but "which combination of model, control protocol, and browser runtime will still work when the task is long, the site is protected, and the agent runs unattended." This guide covers the tool categories, the trade-offs between local and hosted execution, and the concrete wiring you need to run browser use models against a remote Chromium session.

The short version: the model decides *what* to do, a control layer like the Chrome DevTools Protocol (CDP) decides *how* to do it, and the runtime decides *whether it survives production*. Most failures people attribute to "the agent" are actually runtime failures — a crashed local Chrome, a lost session, a stale profile, or an IP that gets blocked on step nine of a twelve-step flow.

What counts as a browser use tool

The term covers four distinct layers, and conflating them is the most common source of confusion.

Agent frameworks. These wrap an LLM with a loop: observe the page, decide an action, execute it, repeat. Browser-use, Agent Browser, and similar projects live here. They own the prompt, the action space, and the retry logic.

Control protocols. CDP is the wire protocol Chromium exposes for programmatic control. Playwright and Puppeteer are higher-level clients that speak CDP (or WebKit's equivalent) under the hood. When you connect an agent to a browser, you are almost always connecting over CDP or a Playwright/Puppeteer abstraction of it.

Browser runtimes. This is the actual Chromium process: where it runs, what profile it uses, what network it egresses from, and how long it stays alive. A local chromium.launch() is a runtime. A hosted session with a connection URL is also a runtime — just one you do not have to babysit.

Model providers. The vision-language or text model that interprets screenshots and DOM snapshots. Different browser use models have different tolerances for noisy DOM, long context, and partial page loads.

A working stack picks one from each column. The failure mode is picking a framework and a model, then treating the runtime as an afterthought.

Local Chromium vs hosted runtime

The decision that matters most for reliability is where Chromium actually runs.

DimensionLocal ChromiumHosted runtime (Remote Browser)
StartupProcess spawn per run, cold start on CIConnect to an existing session via CDP URL
Session persistenceLost when the process or container diesProfiles persist across workers and restarts
ScalingOne browser per machine, manual orchestrationSessions provisioned on demand, isolated per task
Network identityYour laptop or CI IPConfigurable proxy and browser settings
DebuggingScreenshots and logs you wire up yourselfLive viewer plus CDP access to the running session
Environment driftChrome version, fonts, and flags vary per machineConsistent Chromium build per session
Cost modelCompute you already pay for, plus your timeMetered per browser-hour — see /pricing

Local Chromium is the right call for a script you run once and watch. It stops being the right call the moment the agent needs to run on a schedule, from more than one worker, or against a site that treats fresh datacenter IPs with suspicion.

The practical signal: if you have ever written a retry wrapper around chromium.launch() because the browser died mid-task, you have a runtime problem, not an agent problem.

Connecting browser use models to a remote session

The wiring is deliberately boring. You get a CDP endpoint, you connect, you hand the page to your agent loop. Here is a TypeScript example using Playwright's connectOverCDP, which is the same path Puppeteer and raw CDP clients take.

import { chromium } from 'playwright';

// The connection URL comes from your runtime provider.
// Treat it like a credential — it grants control of a live browser.
const CDP_URL = process.env.REMOTE_BROWSER_CDP_URL!;

async function runAgentTask(task: string) {
  const browser = await chromium.connectOverCDP(CDP_URL);

  // Reuse the existing context so persistent profile state carries over.
  const context = browser.contexts()[0] ?? await browser.newContext();
  const page = context.pages()[0] ?? await context.newPage();

  try {
    await page.goto('https://example.com/login', { waitUntil: 'domcontentloaded' });

    // Your agent loop goes here. Each step should observe, act, and verify.
    // Keep the loop bounded — unbounded retries burn browser-hours.
    const result = await agentStep(page, task);

    return result;
  } finally {
    // Close the connection, not the browser, if you want the session to persist.
    await browser.close();
  }
}

Two details that trip people up:

`browser.close()` on a CDP connection disconnects your client. It does not necessarily terminate the remote browser. If you want the session to end, use the runtime's session-termination API. If you want it to persist for the next worker, just disconnect.

Contexts and pages may already exist. A hosted session often starts with a page open. Calling newPage() unconditionally leaves orphan tabs that consume memory and confuse screenshot-based agents.

For the full connection surface — profiles, proxies, session lifecycle — see the /documentation.

Where browser use tools break in production

The failure taxonomy is small and predictable. Naming it makes debugging faster.

Session loss. The browser process dies, the container is recycled, or the network drops. Local setups lose all state. Hosted runtimes with persistent profiles let the next worker resume from a logged-in state instead of replaying authentication.

Detection and blocking. Sites fingerprint TLS, canvas, fonts, and IP reputation. A headless Chromium on a cloud IP is easy to flag. This is where configurable browser settings and proxy selection matter more than any prompt engineering. Note that "stealth" is a spectrum, not a switch — no runtime guarantees you will pass every check.

Context window exhaustion. Long tasks accumulate DOM snapshots and screenshots. Agents that re-read the entire page every step hit token limits around step fifteen. Trimming observations to the relevant subtree is an agent-design problem, but a runtime that exposes structured CDP events helps.

Non-deterministic timing. SPAs render after load. Agents that act on domcontentloaded click into empty pages. Wait on a specific selector or a network-idle condition, not a fixed sleep.

Cost drift. Unbounded retry loops are the single largest driver of browser-hour spend. Cap retries per step, log every action, and review sessions that exceed a threshold. Current metering details are at /pricing.

Choosing a runtime: production criteria

If you are comparing hosted options — and the "cloud browser for AI agents" threads on Reddit are full of them — evaluate against these, in order.

  1. CDP compatibility. Can you connect with Playwright, Puppeteer, and Selenium without a proprietary SDK? Vendor lock-in at the protocol layer is expensive to undo.
  2. Session isolation. Does each task get its own browser context, or do tasks share state? Shared state means one agent's cookies leak into another's run.
  3. Profile persistence. Can a session survive a worker restart with cookies and local storage intact?
  4. Network controls. Proxy configuration, geographic egress, and per-session IP assignment.
  5. Observability. A live viewer and CDP access let you watch a failing run instead of guessing from logs.
  6. Usage controls. Per-session timeouts, concurrency caps, and spend visibility.
  7. Pricing transparency. Per-browser-hour metering is standard; check what counts as a billable hour and whether idle time is charged.

Remote Browser is built around this list: hosted Chromium sessions, CDP access, Playwright/Puppeteer/Selenium compatibility, a live viewer, persistent profiles, configurable browser and proxy settings, session isolation, and usage controls. It is a runtime, not an agent framework — you keep your model and your loop.

A realistic production topology

The pattern that holds up at scale separates concerns:

  • Orchestrator — a queue or scheduler that assigns tasks to workers.
  • Worker — stateless code that requests a session, connects over CDP, runs the agent loop, and disconnects.
  • Runtime — the hosted browser, holding profile state and network identity.
  • Model — called by the worker, swappable without touching the runtime.

Because the worker is stateless, you can scale it horizontally or move it between clouds without migrating browser state. Because the runtime is separate, a model upgrade does not require re-provisioning browsers. This is the same separation that makes /blog/remote-browser-for-ai-agents worth reading before you commit to an architecture.

If you want to see the connection path without writing code first, /blog/remote-browser-online walks through a browser session you can drive from a URL.

Common questions, answered directly

Do I need a special browser for browser use models? No. You need a Chromium build that exposes CDP and stays alive. Hosted runtimes standardize the build so behavior does not drift between your laptop and CI.

Is Playwright required? No. Playwright is a convenience client. Raw CDP over WebSocket works, and Puppeteer and Selenium are equally valid. Playwright's connectOverCDP is simply the least code for most teams — the official reference is in the Playwright CDP documentation.

Can I run browser use tools for free? You can run local Chromium for free indefinitely. Hosted runtimes meter browser time, so "free" usually means a trial allowance. Check /pricing for what is currently offered rather than relying on third-party summaries.

What about Hermes-style agent-browser setups? The connection model is identical: point the client at a CDP endpoint and drive the session. The differences are in configuration and session management, not the protocol. /blog/remote-control-browser covers the control path in more depth.

What to do next

Pick your model and agent framework first — those are the parts you will iterate on. Then treat the browser runtime as infrastructure: something that should be consistent, observable, and boring.

Concretely:

  • Run one task locally to validate the agent loop.
  • Move the same loop to a hosted session by swapping chromium.launch() for chromium.connectOverCDP(url).
  • Add a persistent profile so authentication survives worker restarts.
  • Cap retries and set session timeouts before you scale concurrency.
  • Watch one session in the live viewer to confirm the agent sees what you think it sees.

The tools are not the hard part. Keeping a browser alive, unblocked, and debuggable for the length of a real task is — and that is a runtime decision you make once.