Docs

BetterWright documentation

The token-efficient browser for AI agents — one persistent, policy-guarded browser engineered so every observation costs the fewest tokens possible.

BetterWright is used in two ways — integrated, where your agent drives the browser (skill, MCP, Pi, or the JS API), and standalone, where BetterWright's own agent loop drives (betterwright exec "<task>") and returns one JSON answer. getting-started.md explains how to pick; most pages apply to both.

Start here

New here: bun install -g betterwright && betterwright init. That one command installs the browser, wires up the agent hosts on your machine, and proves the whole path works by loading a real page.

PageWhat it covers
Getting startedinit, the two usage shapes, first run, sessions, proof screenshots
Integration guide (SETUP.md)Wiring BetterWright into any host — written to be followed by an AI agent
The built-in agentbetterwright exec, the interactive console, model adapters, runAgentTask()
JavaScript APIBetterWright, NetworkPolicy, the result envelope, vault API
SDK entrypointbetterwright/sdk: the curated export list and the withBrowser helper
Browser APIEvery sandboxed global inside a snippet: page, snapshot, screenshot, human, …
CAPTCHA recipesManual fallbacks for CAPTCHA interactions
Sessions & the daemonPersistence, concurrency, interrupting a run, reconnecting

Capabilities

PageWhat it covers
Credential vaultEncrypted storage, site matching, selector-free login, generated-password commits, and betterwright vault for reading your own saved passwords back
Cookie SyncCopy selected local browser cookies into BetterChromium or an explicitly approved cloud browser
Live view & handoffWatch/coach/take over in a browser tab; hosting presets, password gate, security model
CAPTCHA helpersLocal checkbox/Turnstile/slider/motion/drag-fit solving; numbered-crop vision loop for image grids
Network policyWhat the browser may reach; the unliftable metadata floor
WebAgents batch workflowsCompact origin discovery and one-call dependency graphs with guarded first-party execution
Semantic action directoriesToken-small control/evidence extraction and guarded batches for ordinary websites
WebMCP page toolsTyped capabilities published by the current page; discovery, safe invocation, and timeout cancellation
Skill packsPer-site / per-password-manager packs, plus the host e2e-review playbook loaded only when a review is requested
Agent guidanceThe operator prompt and its guardrail options

Under the hood

PageWhat it covers
Architecture & security modelThe worker process, the RPC loop, what is and isn't a security boundary
Launch identityThe coherent locale/timezone/geo identity layer; launch modes and egress matching
Browser providersManaged fork, local executables, CDP endpoints, named cloud browsers, connected API keys, and betterwright boxes
Chromium forkBetterWright's own Chromium build: farbling, discovery
Chromium fork patchesWhat each source patch in the pinned Chromium 151 build changes, and why
Headed / headlessDisplay modes over one persistent profile
Edit this page on GitHubSynced from commit 24c7cd0 on 2026-09-10