How does Browser-Use 1.0 execute cells over browser-harness, and where do its domain guard and event buffer stop?

Short answer

At pinned commit 30dffbb, Browser-Use 1.0 replaces 0.x action-dict tool calling and security_watchdog.py with a Pydantic AI agent loop calling one sequential python tool. The host Repl parent runs worker.py in its own subprocess group over a local socket, and the worker drives Chrome through the browser-harness daemon while killing only the worker process tree on cell timeouts so workspace files and Chrome survive.

Two runtime boundaries are easy to misread: domains.Guard is explicitly a guard for an aligned model rather than a sandbox—Fetch.enable filters only Document requests (iframes, fetch, and images pass), the REPL subprocess has its own Python networking outside the browser, and setting allowed_domains ignores prohibited_domains; and ax.AxHelpers polls a 500-event buffer shared by every client of one BU_NAME daemon. This is independent static source analysis, not upstream endorsement or a runtime trace.

Pinned-commit evidence

Every evidence link below is bound to browser-use/browser-use commit 30dffbb9285e7bd8d2c81698d8a4712d5953ada5 and points to an exact line or range.

Open the offline interactive artifact · Inspect the JSON source · Open the pinned commit ↗

FromToEvidence kindFinding and permalinks
agent_loop repl_parent direct call

Pydantic AI Agent exposes sequential python() tool that invokes repl.call("exec", code, timeout).

browser_use/agent/loop.py#L176-L214browser_use/agent/loop.py#L1209-L1228
repl_parent repl_worker process / socket IPC

Repl spawns python -P worker.py in its own process group over a local socket and uses _kill_tree on timeout.

browser_use/repl/session.py#L222-L235browser_use/repl/session.py#L304-L412
repl_worker harness_daemon IPC relay

worker.py loads browser_harness helpers, enforces check_url(), and wires ax.AxHelpers(cdp) against the daemon IPC.

browser_use/repl/worker.py#L525-L595browser_use/repl/worker.py#L969
harness_daemon chrome_cdp shared event buffer

ax.py polls EVENT_BUFFER=500 from the daemon buffer shared across every client on one BU_NAME daemon.

browser_use/ax.py#L1-L9browser_use/ax.py#L38-L39
domain_guard chrome_cdp separate CDP Fetch guard

Browser instantiates Guard(ws, self.domains) with Fetch.enable (Document only), BlockedByClient failures, and _sweep().

browser_use/browser/browser.py#L1001-L1012browser_use/browser/browser.py#L1088-L1090browser_use/domains.py#L356-L456
domain_guard policy_limits policy boundary

allowed_domains ignores prohibited_domains; iframes, subresources, and REPL Python networking are not filtered.

browser_use/domains.py#L14-L19browser_use/domains.py#L206-L208

Boundaries that mislead

domains.Guard is an aligned-model guard, not a network sandbox

Fetch.enable intercepts only resourceType: "Document" on main frames. Subresources (fetch, images, iframes) pass unfiltered, Python code inside the REPL subprocess can open network sockets outside Chrome, and setting allowed_domains causes prohibited_domains to be ignored with only a warning log.

browser_use/domains.py#L14-L19browser_use/domains.py#L206-L208browser_use/domains.py#L356

One browser-harness daemon shares its 500-event buffer across all clients

Ultrafast mode reads CDP dialogs and network events from the browser-harness daemon buffer (EVENT_BUFFER = 500) via a background thread. Sharing one BU_NAME daemon between two agents or an external browser-harness CLI can cause one client to drain events needed by another.

browser_use/ax.py#L3-L8browser_use/ax.py#L39

Calls and ownership

1. Sequential Python REPL cells replace 0.x action schemas

browser_use/agent/loop.py wires a Pydantic AI Agent with Tool(python, sequential=True) plus finish and finish_from_repl. Each cell executes through Repl.call("exec", code, ...), while Repl spawns worker.py with python -P in its own process group so _kill_tree can terminate runaway child processes without tearing down Chrome.

2. Worker IPC and the shared browser-harness event buffer

Inside worker.py, check_url() rejects disallowed URLs before helper calls navigate, and ultrafast mode wraps cdp() in ax.AxHelpers (bu). A background thread polls EVENT_BUFFER = 500 from the browser-harness daemon; because every client on the same BU_NAME daemon shares that buffer, concurrent agents or CLI sessions on one daemon can drop each other’s dialog and network events.

3. Three-layer domain enforcement and its explicit non-sandbox ceiling

Browser attaches domains.Guard on its own CDP WebSocket, calling Fetch.enable with resourceType="Document" and failing disallowed main-frame navigations with Fetch.failRequest(errorReason="BlockedByClient"), followed by post-cell sweep() tab resets. As documented in domains.py, subresources and iframes are unfiltered, Python networking in the REPL bypasses the browser guard, and allowed_domains supersedes prohibited_domains.

What this proves — and what it does not

  • This article is independent static source analysis, not an endorsement by the Browser-Use maintainers. Conclusions are limited to browser-use/browser-use commit 30dffbb9285e7bd8d2c81698d8a4712d5953ada5.
  • The six evidence rows cover the Pydantic AI loop, REPL subprocess lifecycle, browser-harness event buffer, and domains.py Guard; cloud browser provisioning, proxy rotation, and external browser-harness daemon internals are outside this scope.
  • Static source review does not prove OS-level container isolation, Chrome version-specific CDP behavior, or runtime race outcomes when a CDP WebSocket drops.
  • Readers migrating from 0.x should verify against MIGRATING.md and their pinned package version rather than assuming 0.x watchdog classes still exist.

Reuse with your agent

Give an agent the pinned commit and this review prompt; require it to open every permalink and keep unknowns explicit.

Audit only browser-use/browser-use commit 30dffbb9285e7bd8d2c81698d8a4712d5953ada5. Map the Pydantic AI sequential python() tool in loop.py, Repl process-group lifecycle in session.py, worker.py + browser-harness shared EVENT_BUFFER=500 in ax.py, and domains.py Guard (Document-only Fetch.enable, allowed_domains ignoring prohibited_domains, unfiltered subresources and REPL Python networking). Do not infer 0.x watchdog classes or external daemon internals.
Cite this source case in Markdown
[Browser-Use 1.0: Python REPL & Domain Guard Map](https://archify.si/cases/browser-use-repl-guard)

Archify independent static source analysis, limited to the pinned commit.

Start with the architecture diagram type →