CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

browser-use/browser-use

Scanned commit d8110c5ff8 dated 2026-09-15 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/browser-use/browser-use ↗ · 508 files · 4.3 MB

--- Navigate the web like a human does. Find an available slot, pick a date and time, handle the CAPTCHA, and book a driving test.

Deep analysis by cli:grok via the grok CLI on 2026-09-22 (340s) — every claim below links to its cited source files.

Overview

browser-use 0.13.10 is an async Python library (and a thin CLI) that lets an LLM complete web tasks by driving Chromium over the Chrome DevTools Protocol. The library loop is Agent.run: snapshot the DOM and a screenshot, ask a chat model for the next actions, execute those actions through an event bus and watchdog services, and repeat until a done action or a step/failure cap. It is aimed at developers embedding a browser agent and at coding agents that drive a real browser through the CLI; the distinctive pieces are the indexed DOM the model clicks, a large built-in action registry, and first-class hooks into Browser Use Cloud browsers, the BU LLM gateway, skills, and a remote @sandbox runner.

System map

The installable package is browser_use, built with hatchling and exposed as the console scripts browser-use, browseruse, bu, and browser (browser_use.cli:main), plus python -m browser_use. The runtime splits into an Agent orchestrator, a BrowserSession that owns a bubus event bus and a cdp-use CDP client, a Tools/Registry action layer, and a DomService that serializes the page for the model. Persistence is local (temp agent directories, cookie storage state, config under ~/.config/browseruse) plus optional cloud event sync. External systems are the Browser Use cloud browser API, the LLM gateway, the sandbox stream API, PostHog telemetry, and optional provider SDKs (OpenAI, Anthropic, Google, Groq, Ollama, AWS, MCP). CI is GitHub Actions: per-file pytest of tests/ci, ruff/pre-commit/pyright, PyPI publish on GitHub release, and a multi-arch Docker image.

Feature catalog

User-facing capability sits on three paths described in the README: a hosted cloud product (outside this process), a CLI that executes Python against a browser daemon, and the Python Agent library. The library's default tool registry covers navigation, element interaction, extraction, tabs, files, and task completion. Optional features include cloud browsers, the remote sandbox, MCP server mode, Gmail OTP actions, cloud skills, structured output, vision, planning, a judge pass, GIF/HAR/video recording, and domain or captcha policy.

Data flow

A task string enters Agent.__init__, which picks an LLM, builds a system prompt, a MessageManager, a FileSystem, and a BrowserSession. Each step pulls a BrowserStateSummary (DOM text, selector map, screenshot) from the browser, redacts secrets, and sends the message list to the LLM. The model returns an AgentOutput whose action list is validated by Pydantic and executed one by one; ActionResult objects are written back into history and into the next prompt. Side effects leave the process through CDP commands, local files under the agent temp dir, optional conversation and GIF dumps, PostHog, and authenticated POSTs to the Browser Use events API.

Behavior traces

Three flows dominate. Startup brings up logging, the agent object, the browser process or cloud session, and the watchdog set before any model call. The primary step is a fixed phase sequence from DOM snapshot through LLM output to event-bus actions. Persistence is split across the in-memory AgentHistoryList, the on-disk file system and screenshots, optional conversation and GIF files, cookie storage state, and cloud event sync.

Testing signals

The project uses pytest 9 with pytest-asyncio in auto mode, a 300s default timeout, and xdist. The CI-gated suite is tests/ci, discovered as one GitHub Actions job per test file with a 4 minute job timeout. Tests are expected to use a real browser plus pytest-httpserver; the LLM is the only allowed mock, via conftest.create_mock_llm. Large areas outside tests/ci (examples, most LLM live tests, the beta agent, and the browser_harness CLI daemon) are not part of that matrix. A separate eval workflow can POST the PR commit to an external eval platform for owner, member, or collaborator PRs.

Risk map

The highest-risk surfaces are arbitrary page JavaScript, the remote sandbox that cloudpickles and ships user code, secret substitution, file upload and external file reads, and domain policy that is off unless configured. Several controls exist and are tested (domain filter, IP blocking, upload whitelist, sensitive-data redaction), but the JavaScript evaluate path only fixes quotes, the flat sensitive_data format is global, and CrashWatchdog is disabled. Docs in AGENTS.md disagree with Agent.__init__ defaults, which is a trap for agents editing call sites.

Extension points

New behavior is meant to be added as registered actions, not by editing the step loop. Tools.action and Registry.action are the plugin table; special parameter names are the injection API. Browser behavior is extended by watchdogs that subscribe to bubus events. LLM providers plug in through BaseChatModel and get_llm_by_name. Cloud skills, Gmail, and MCP are additional registries on top of the same action or tool list. System prompts are selected markdown files, overridable with override_system_message or extend_system_message.

Contributor handoff

Edit inside browser_use, keep examples and docs aligned only when behavior changes, and do not add sample scripts. The code style is tabs, single quotes, line length 130, Python 3.11+ unions, and Pydantic v2 models for action schemas. Before changing the agent loop, read Agent.step, BrowserSession.on_BrowserStartEvent, Tools.act, and Registry.execute_action. Run the focused tests/ci file plus pyright; the full matrix is ./bin/test.sh. Known traps are stale defaults in AGENTS.md, the external browser_harness CLI, the commented-out CrashWatchdog, and secret handling that is only domain-scoped when the caller uses the nested dict form.

Languages

LanguageFilesShare of source
Python40499%
Markdown60docs/config
YAML17docs/config
Shell41%
HTML3docs/config
JSON1docs/config
TOML10%

Start reading here

Probable source entrypoint: pyproject.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

browser_use/ (186 files) skills/ (28 files) static/ (3 files)

Source layout — browser_use/

PathFiles
browser_use/beta/2
browser_use/llm/39
browser_use/tools/8

Repository structure

Top-level pathFiles
browser_use/186
tests/129
examples/119
skills/28
.github/18
docker/5
static/3
bin/3

Docs found: AGENTS.mdCLAUDE.mdREADME.md

Package

pyproject.toml — browser-use v0.13.10, 31 declared dependencies.

clicorebrowser-use-core==0.13.3;browser-use-core==0.13.3;browser-use-core==0.13.3;browser-use-core==0.13.3;browser-use-core==0.13.3;]awsocivideoexamples

CI & config entrypoints

Structural health signals

Average score 9.1/10 across 96 analyzed source files; 2 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history