Agent Browser: Browser automation CLI for AI agents
A fast native Rust CLI for browser automation, designed for AI agents to navigate, interact, and extract data.
Evidence: CLI provides many commands, but no explicit least-privilege design; user confirmation mechanisms exist (e.g., dialog handling) but not comprehensive; data flow transparency limited, no detailed data collection; sensitive data handling (cookies, credentials) has commands but no secure storage; dependency security not explicit; external effects (network requests, file writes) have commands but no restrictions; rollback not mentioned; source attribution clear (Vercel Labs) but unverified. Deductions: lack of specific evidence for least privilege, user confirmation, data flow transparency, sensitive data security, dependency security, external effect control, and rollback.
Evidence: command documentation consistent, but actual behavior not verified; dependencies (Chrome) have install instructions but availability not verified; failure messages mentioned (e.g., click failure) but not comprehensive. Deductions: no executed tests, cannot verify consistency, dependency availability, and failure message accuracy.
Evidence: targets AI agents and developers, broad scenarios; capability boundaries described (e.g., read does not read llms-full.txt); trigger precision described (e.g., refs); environment fit described (e.g., Linux dependencies). Deductions: actual adaptability not verified, some boundaries not explicit.
Evidence: information architecture clear (detailed README); install notes complete; naming stable (consistent commands); examples abundant; known limitations partially mentioned (e.g., read does not read llms-full.txt); license clear (Apache-2.0); versioning and changelog present (CHANGELOG.md); maintenance responsibility clear (Vercel Labs). Deductions: known limitations not comprehensive, not all limitations mentioned.
Evidence: output usable (e.g., snapshot, screenshot); marginal value high (provides many features); cost-benefit reasonable (free open source). Deductions: actual output quality not verified, cost-benefit not quantified.
Evidence: README claims partially supported (e.g., command list), but no test results; cross-source verification limited (only README and CI); facts and inferences not clearly separated. Deductions: lack of test evidence, claims not fully verified.
- Unverified publisher identity, treat with caution.
- Static review, no executed tests, actual behavior not verified.
- Sensitive data handling (cookies, credentials) lacks secure storage details, be cautious.
- Dependency security not explicit, check for vulnerabilities.
What does this agent do, and when should you use it?
Agent Browser is a native Rust CLI from Vercel Labs for browser automation, tailored for AI agents. It runs a background daemon that maintains a browser session and exposes a deterministic ref system (e.g., `@e1`) derived from accessibility snapshots, enabling AI to interact reliably. It goes beyond basic clicks and fills: it supports network interception and HAR recording, cookie and storage management, session persistence with profiles and state files, React introspection, Web Vitals metrics, accessibility audits via embedded axe-core, and an MCP server. It works headless by default and can automatically download Chrome from Chrome for Testing.
The agent-browser CLI provides comprehensive browser automation commands. It launches Chrome or Lightpanda via CDP, keeps the session alive with a daemon, and generates snapshots as accessibility trees with refs. Users can click, fill, type, hover, select, drag, and upload files using these refs or traditional CSS selectors. It extracts text from URLs or the rendered DOM (read), evaluates JavaScript (eval), and manages cookies, storage, and network routes. For React apps, it offers component tree inspection, renders profiling, and Web Vitals (LCP, CLS, TTFB, FCP, INP) when launched with --enable react-devtools. It also includes a diff command for snapshot and screenshot comparisons, and an a11y command using embedded axe-core. Security features include domain allowlisting, content boundary markers, action policies, and confirmation prompts.
- AI agents that need to automate web interactions, such as filling forms, clicking through flows, and scraping data, in a deterministic way.
- Developers who want to reuse existing Chrome login state (via
--profile) to automate authenticated workflows. - QA engineers running accessibility audits with built-in axe-core and visual regression with
diff screenshot. - Frontend developers inspecting React component trees, suspense states, and Web Vitals for performance analysis.
- AI coding assistants that need to verify UI changes, fill forms, or inspect page state during development.
- MCP-compatible clients that want to control a browser through the standard MCP protocol (
agent-browser mcp).
What are this agent's strengths and limitations?
- Native Rust CLI offers high performance, and the daemon enables command chaining without startup overhead.
- Ref system provides deterministic element selection, avoiding the fragility of CSS selectors on dynamic pages.
- Built-in Chrome download (Chrome for Testing) simplifies setup; also detects existing Chrome/Playwright/Puppeteer installs.
- MCP server support allows integration with any MCP-compatible AI client.
- Security features like domain allowlists, action confirmation, and content boundaries enhance safe AI deployment.
- Core functionality depends on Chrome (or Lightpanda); Safari and iOS support is limited.
- Advanced features (React introspection, WebGPU) require specific launch flags, and WebGPU screenshots have caveats.
- Building from source requires Node.js 24+, pnpm 11+, and Rust, which may be a high barrier for some.
- The AI chat feature relies on Vercel AI Gateway, requiring an API key; without it, chat is unavailable.
- The extensive documentation can be overwhelming for new users.
How do you install or deploy this agent?
Global installation: npm install -g agent-browser, then run agent-browser install to download Chrome from Chrome for Testing. Alternative methods: Homebrew (brew install agent-browser), Cargo (cargo install agent-browser), or build from source requiring Node.js 24+, pnpm 11+, and Rust: clone the repo, run pnpm install, pnpm build, pnpm build:native, pnpm link --global, then agent-browser install. On Linux, use agent-browser install --with-deps to install system dependencies.
How do you use this agent?
First, install Chrome: agent-browser install. Then open a page and get a snapshot: agent-browser open example.com and agent-browser snapshot -i. Use the refs from the snapshot to interact: agent-browser click @e2, agent-browser fill @e3 "text". Get text: agent-browser get text @e1. Take a screenshot: agent-browser screenshot page.png. Close: agent-browser close. You can also use traditional selectors: agent-browser click "#submit". For MCP, configure your client to spawn agent-browser mcp.
How does this agent compare with similar options?
Compared to Playwright or Puppeteer, agent-browser is specifically designed for AI agents, offering a ref-based snapshot system, background daemon, and MCP integration, whereas Playwright/Puppeteer are more general-purpose libraries requiring more coding.
FAQ
Does it require a separate browser?
agent-browser install to download Chrome from Chrome for Testing. It also auto-detects existing Chrome, Brave, Playwright, or Puppeteer installations.How does it handle login state?
--profile <name>, persistent profile via --profile <path>, session persistence with --session and --restore, importing auth from a running Chrome with --auto-connect, and state files with --state.Is the AI chat feature free?
chat command uses the Vercel AI Gateway, requiring AI_GATEWAY_API_KEY. Without a key, chat is not available, but all other automation features work without one.Does it support headless mode?
--headed to show a browser window for debugging. On Linux without a display, it auto-starts Xvfb for headed mode.