← Blog

BLOG

ChatGPT Agent Browser: What It Is and How to Run One

A ChatGPT agent browser is a real Chromium session your model can drive. Here is how it works, where it breaks, and how to run one in production.

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

A ChatGPT agent browser is a real browser session that a ChatGPT-driven agent controls through code rather than through a chat window. The model decides what to click, type, and read; a runtime executes those decisions against an actual Chromium instance. The hard part is not the model. It is the browser: where it runs, how the agent connects to it, and how you keep sessions isolated, observable, and reproducible when the agent goes off-script. This guide covers what the term means, the three architectures people actually build, and the production criteria that separate a demo from a system you can leave running.

What "ChatGPT agent browser" actually refers to

The phrase gets used for three different things, and conflating them causes most of the confusion:

  1. ChatGPT's built-in browsing. OpenAI's product can fetch and read web pages on your behalf. You do not control the browser, you cannot script it, and you have no CDP endpoint. It is a feature, not infrastructure.
  2. A ChatGPT model driving a browser you control. You run an agent loop — typically the OpenAI API with tool calls — where the tools are browser actions (navigate, click, type, extract). The browser is yours: local Chrome, a container, or a hosted session.
  3. A hosted runtime that exposes a browser to any model. The browser lives on a provider's infrastructure and you connect over CDP. The model is swappable; the runtime is the constant.

This article is about the second and third. If you are building anything that needs to run repeatedly, on a schedule, or across many tasks at once, the built-in browsing feature will not get you there. You need a browser your code can address.

The distinction matters because the model is the least stable part of the stack. Models change, prompts drift, and tool-calling formats evolve. The browser runtime is what you can actually engineer around.

The three architectures, compared

Before writing code, decide where the browser lives. Each option trades setup cost against operational burden.

ArchitectureSetup effortIsolationDebuggingScales to many parallel tasksBest for
Local Chrome on your machineLowNone — shares your profile and cookiesEasy, you can watch itNoPrototyping, one-off scripts
Self-hosted Chromium in containersHigh — you own orchestration, images, networkingGood if you build it correctlyModerate — needs log plumbing and VNCYes, with real engineeringTeams with existing infra and strict data rules
Hosted browser runtime (CDP endpoint)Low — one API call per sessionPer-session by defaultLive viewer plus session recordingsYes, bounded by your planMost agent products past the prototype stage

The local option is where everyone starts and where most people get stuck. A local Chrome instance carries your logged-in cookies, your extensions, and your IP. An agent that misreads a page can act on your real accounts. It also cannot run two tasks at once without profile conflicts, and it dies when your laptop sleeps.

Self-hosting is legitimate. If you already run Kubernetes and have a reason to keep browser traffic inside your network, a containerized Chromium with a CDP port is a known quantity. The cost is that you now own browser image updates, zombie process cleanup, outbound proxy configuration, and a debugging story for when a session hangs at 3 a.m.

A hosted runtime collapses that into an API call. You get a CDP WebSocket URL, connect with Playwright or Puppeteer, and the provider handles the container lifecycle. You still own the agent logic and the prompts — which is the part that actually differentiates your product.

How the agent loop connects to the browser

The mechanics are simpler than the marketing suggests. A ChatGPT-driven agent needs three things from the browser: a way to observe the page, a way to act on it, and a way to know whether the action worked.

Observation usually means one of two approaches. The first is a DOM snapshot — serialize the accessibility tree or a trimmed HTML representation and hand it to the model as text. The second is a screenshot passed to a vision-capable model. Most production agents use the DOM approach because it is cheaper per step and produces more deterministic tool calls; screenshots are reserved for pages where the DOM is uninformative, such as canvas-heavy apps.

Action means the model emits a structured tool call — click(selector), type(selector, text), navigate(url) — and your code executes it through the browser automation library. Verification means re-reading the page after the action and checking that the expected state change occurred. Skipping verification is the single most common cause of agents that "work" in demos and fail silently in production.

Here is a minimal loop using Playwright over CDP against a hosted session. The same shape works with Puppeteer's connect or Selenium's remote WebDriver.

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

type SessionInfo = { cdpUrl: string };

// Your runtime returns a CDP WebSocket URL for a fresh, isolated session.
async function createSession(): Promise<SessionInfo> {
  const res = await fetch(`${process.env.BROWSER_API}/sessions`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.BROWSER_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ profile: "checkout-agent", timeoutMinutes: 15 }),
  });
  if (!res.ok) throw new Error(`session create failed: ${res.status}`);
  return res.json();
}

async function runTask(task: string) {
  const { cdpUrl } = await createSession();
  const browser: Browser = await chromium.connectOverCDP(cdpUrl);
  const context = browser.contexts()[0] ?? (await browser.newContext());
  const page: Page = context.pages()[0] ?? (await context.newPage());

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

  // Each iteration: observe -> model decides -> act -> verify.
  for (let step = 0; step < 12; step++) {
    const snapshot = await page.locator("body").ariaSnapshot();
    const action = await callModel({ task, snapshot, history: [] });

    if (action.type === "click") {
      await page.locator(action.selector).click({ timeout: 10_000 });
    } else if (action.type === "type") {
      await page.locator(action.selector).fill(action.text);
    } else if (action.type === "done") {
      break;
    }

    await page.waitForLoadState("networkidle").catch(() => {});
  }

  await browser.close(); // releases the hosted session
}

async function callModel(_: { task: string; snapshot: string; history: unknown[] }) {
  // Call the OpenAI API with a tool schema; return a validated action object.
  throw new Error("wire your model call here");
}

Two details in that snippet matter more than they look. First, connectOverCDP attaches to an existing browser rather than launching one, which is exactly what a hosted runtime provides — see the Playwright CDP documentation for the full contract. Second, browser.close() on a CDP connection disconnects and releases the session; forgetting it is how you accumulate billable browser-hours.

Production criteria that decide whether this holds up

Once the loop works on one page, the questions shift from "can it" to "will it, repeatedly, under load, without leaking data." These are the criteria worth evaluating a runtime against.

Session isolation. Every task should get a fresh browser context. If two agents share a profile, one agent's login state and cookies bleed into the other's task. Isolation is not a nice-to-have; it is the difference between a bug and a security incident.

Persistent profiles, deliberately scoped. Some workflows genuinely need to stay logged in across sessions — a support agent that checks a dashboard every hour, for example. That should be an explicit, named profile, not an accident of shared state. Look for a runtime where profiles are first-class objects you can list, reuse, and delete.

Live observability. When an agent stalls, you need to see the page it is stuck on. A live viewer that lets you watch or take over a running session turns a 40-minute debugging session into a 40-second one. Session recordings serve the same purpose after the fact.

Proxy and browser settings. Many sites behave differently by geography or IP reputation. Configurable proxy and browser settings let you test and operate against realistic conditions. Be skeptical of any claim that a runtime makes your agent undetectable — no provider can guarantee that, and the honest framing is "configurable settings," not "invisibility."

Usage controls. Agent loops can run long. You want per-session timeouts, a way to cap concurrent sessions, and a clear view of what you are spending. Check /pricing for current rates and limits rather than assuming a number.

A real API surface. CDP access is the baseline. Beyond that, you want session creation, profile management, and status endpoints that behave predictably under retries. If the API is undocumented or the error codes are opaque, you will feel it in production.

Where ChatGPT-driven browser agents actually break

The failure modes are consistent enough to plan for.

  • Stale selectors. The model picks a selector from a snapshot, the page re-renders, and the click lands on nothing. Mitigation: re-snapshot after every action and let the model re-decide rather than replaying a fixed script.
  • Modal and cookie-banner interception. A consent dialog blocks the element the agent wants. Mitigation: give the agent an explicit "dismiss overlays" step, or handle known banners deterministically before the loop starts.
  • Silent success. The agent reports completion but the form was never submitted. Mitigation: define a verification predicate per task — a URL pattern, a text match, a network response — and fail loudly when it is not met.
  • Runaway loops. The model retries the same failing action indefinitely. Mitigation: hard step caps, and a distinct "give up and escalate" tool the model can call.
  • Credential exposure. The agent types a password into a page it should not trust. Mitigation: keep secrets out of the model's context; inject them at the automation layer, scoped to a specific origin.

None of these are solved by a better model alone. They are solved by a runtime that gives you isolation, observability, and control, plus an agent design that verifies its own work.

Choosing between a hosted runtime and rolling your own

The decision usually comes down to three questions.

How many concurrent sessions will you run? One or two, occasionally: local is fine. Dozens, continuously: the container orchestration work is real, and a hosted runtime removes it.

What are your data constraints? If browser traffic must stay inside your VPC, self-hosting is the answer regardless of convenience. If not, a hosted runtime with clear retention policies is usually the better trade.

How much of your engineering time should go to browser plumbing? Every hour spent debugging zombie Chromium processes is an hour not spent on the agent behavior that customers actually notice. For most teams, that math favors a hosted runtime.

If you are still mapping the landscape, the remote browser for AI agents overview covers the runtime layer in more depth, and remote browser online walks through running real Chromium without local setup. When you are ready to wire it up, the documentation has the session and CDP endpoints.

A practical starting checklist

If you are building a ChatGPT agent browser today, this is the order that avoids rework:

  1. Separate the agent from the browser. Your model-calling code should not know whether the browser is local or hosted. Abstract session creation behind one function.
  2. Start with DOM snapshots, add vision only where needed. It is cheaper and more deterministic.
  3. Build verification into every task. No task is done until a predicate passes.
  4. Use named profiles for anything that needs login state, and fresh sessions for everything else.
  5. Watch a session live before you trust it. The first time you see your agent click the wrong button in real time, you will understand your own failure modes better than any log.
  6. Set timeouts and step caps on day one, not after the first surprise bill.

The model will keep changing. The runtime you build around it — isolated sessions, CDP access, live debugging, scoped profiles — is the part that stays stable, and it is the part worth getting right first.