Skip to main content

Set up

You need uv and Python 3.11 or newer. Chrome (or Chromium) is needed only for the browser tests.
uv sync creates .venv with the library and the dev tools (pytest, ruff, pyright, pre-commit). Try the library from your checkout with uv run python your_script.py.

Test

The tests never call a model provider or create a cloud browser. They run a real REPL worker and a real headless Chrome with a temp profile, and a scripted Pydantic AI FunctionModel plays the model. Cloud HTTP calls are mocked. Point CHROME=/path/to/chrome at a browser if it isn’t found.

Lint and type-check

The code uses tabs, uv, and modern typing (str | None). CI runs the same pre-commit hooks and uv run pyright.

How the code is laid out

The full map, with the CLI, MCP server and skills, is in AGENTS.md.

Pull requests

  • One regression test per bug, failing before your fix.
  • Don’t replace model names in code or tests: people use models you may not know yet.
  • The system prompt (browser_use/agent/prompt.py) is evaluated on a benchmark. Don’t change it casually.
  • A 0.x option that 1.0 cannot honor raises a TypeError that names it. Keep MIGRATING.md in sync when you add or remove one.
  • Don’t add example files to show off a feature.
Questions: GitHub issues or Discord. For these docs, open a pull request on browser-use/sdk (the docs/ folder).