# BX Browser A vision-capable, DOM-first browser agent. You give it a task in plain language; it enumerates the page, decides, acts, and repeats until the task is done. Built to be fast. Most browser agents screenshot every step and wait on a vision model. BX Browser reads the accessibility tree first and only falls back to vision when the page actually demands it — canvas apps, bot walls, visual-only controls. ## Why it's fast - **DOM-first decisions.** Numbered elements from the a11y tree mean 2–4 second steps instead of a vision round-trip every turn. - **Atomic observation.** Tree and screenshot are fetched in a single server round-trip, not two. - **Session keep-alive.** Logins persist across runs, so you authenticate once instead of every invocation. - **Health-aware key rotation.** Rotates across a pooled set of model keys and degrades down a model ladder under rate limits rather than failing. ## Design ``` enumerate elements -> model picks an INDEX -> execute -> repeat ``` Deliberately index-based rather than selector-generating. The model never writes a CSS selector, so it cannot hallucinate one that silently matches the wrong node. Zero third-party Python dependencies in the core agent — standard library only. ## Usage ```bash # run a task bx_browser.py run "" [--url U] [--max-steps N] [--mode auto|fast|vision] [--profile fast|balanced|smart] [--model M] # deterministic primitives, no AI calls bx_browser.py enum [--url U] # numbered element dump bx_browser.py click bx_browser.py type "" [--enter] bx_browser.py scroll [amount] bx_browser.py goto | back | forward | refresh bx_browser.py shot [--full] | links [limit] | tabs bx_browser.py extract '' # structured scrape, no AI bx_browser.py js "" # raw JS in page context # diagnostics bx_browser.py keys | health | close ``` The non-AI subcommands matter: `enum`, `click`, `extract` and `js` let you script a deterministic path once you know it, and spend model calls only on the parts that genuinely need judgement. ## Configuration All via environment, nothing hardcoded: | Variable | Purpose | |---|---| | `CAMOFOX_URL` | Browser engine endpoint (default `http://localhost:9377`) | | `GEMINI_BROWSER_MODEL` | Model id | | `BX_MODEL_LADDER` | Comma-separated fallback ladder | | `BX_PROFILE` | `fast` / `balanced` / `smart` | | `BX_STATE_FILE` | Session state path | | `GOOGLE_AI_STUDIO_API_KEY_*` | Key pool for rotation | ## Status Working tool, extracted from a larger private workspace. The engine binding targets a local anti-bot browser server; the agent loop itself is engine-agnostic and the CDP helpers in `src/` show the raw protocol path. MIT.