Stagehand: The AI Browser Automation Framework
Control browsers with natural language and code for flexible, maintainable, reliable automation.
- Source repo
- browserbase/stagehand
- Stars
- ★ 26k
- Last updated
- today
- License
- MIT
- Primary language
- TypeScript
- FA score
- 47/100 · Major gaps
At a glance
- How it runs
- Works with
- Platform-specific
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Frontend developers needing to automate tests for dynamic web apps without writing brittle selectors.
- Not a fit if
- Developers outside TypeScript, Python, and Go, the only official SDKs
- Teams that want zero per-use LLM costs
- Source review
- 47/100 · Major gaps 2 safety controls not found
What does this agent do, and when should you use it?
Stagehand is a browser automation framework that combines AI with code, letting developers use natural language for actions while retaining precise control via code. Built on a CDP engine, it offers core APIs like act(), agent(), and extract() for individual actions, multi-step tasks, and structured data extraction. The framework features auto-caching and self-healing, remembering repeated actions to reduce LLM inference and recovering when websites change. Written in TypeScript and managed with pnpm, it integrates into existing Node.js projects. It requires an LLM API key and optionally Browserbase credentials.
Stagehand interacts with the browser via its CDP engine, providing act() to execute a single natural language instruction (e.g., 'click on the stagehand repo'), agent() for multi-step tasks (e.g., 'Get to the latest PR'), and extract() to pull structured data (e.g., PR author and title) with Zod schemas. It automatically caches actions to avoid LLM calls and self-heals when page changes break automation. Setup can be done via npx create-browser-app or by cloning and building with pnpm.
- Frontend developers needing to automate tests for dynamic web apps without writing brittle selectors.
- Data engineers extracting structured data from sites with frequently changing HTML.
- DevOps engineers monitoring web dashboards and performing routine clicks via natural language.
- QA engineers replacing fragile selectors with natural language to stabilize test suites.
- Product managers prototyping automation workflows quickly without deep coding knowledge.
How do you install or deploy this agent?
Requires Node.js and pnpm. Clone the repo: git clone https://github.com/browserbase/stagehand.git, cd in, run pnpm install and pnpm run build. Alternatively, use npx create-browser-app to scaffold a new project. You'll need an LLM API key (e.g., OpenAI) and Browserbase credentials–copy .env.example to .env and fill in values.
How do you use this agent?
After install, run pnpm run example to try the sample. In code, use stagehand.act("click on the stagehand repo") for single actions, stagehand.agent().execute("Get to the latest PR") for multi-step, and stagehand.extract(...) with a Zod schema to get data. Ensure env vars are set for LLM and Browserbase.
What are this agent's strengths and limitations?
- Blends natural language with code, allowing flexibility on unfamiliar pages and precision when needed.
- Auto-caching remembers repeated actions, saving tokens and reducing latency.
- Offers clear APIs (act, agent, extract) covering a wide range of automation needs.
- Built on CDP and Playwright, providing a stable and debuggable foundation.
- Requires LLM API keys, incurring per-use costs.
- Depends on Browserbase for remote browser management, adding a third-party service.
- As a relatively new framework, its ecosystem and docs are less mature than Selenium or Playwright.
- Primarily TypeScript/Node.js, which may be a barrier for developers in other languages.
How does this agent compare with similar options?
Compared to traditional automation tools like Selenium or Playwright, Stagehand lets you replace some low-level code with natural language, reducing maintenance overhead.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Stagehand: The AI Browser Automation Framework This agent | 47 · Major gaps | Library / SDKFree + model costs | ★ 26k | today | TypeScript | — |
| CamoFox Browser Server | 72 · Some gaps | Self-hosted serviceFree | ★ 424 | 27d ago | JavaScript | Claude Code |
| Uni-CLI | 72 · Some gaps | CLIFree | ★ 235 | 8d ago | TypeScript | ChatGPT · Codex · Claude Code |
| Notte Web Automation | 44 · Major gaps | Library / SDKFreemium | ★ 2k | today | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows: CLI tests explicitly verify that raw argv values (e.g., URLs and tokens) are not sent to telemetry, demonstrating sensitive data protection; dependency overrides (pnpm overrides) show proactive mitigation of known vulnerabilities; but user confirmation mechanisms (e.g., confirmation before act) and rollback functionality are missing. Deductions: user confirmation and rollback absent, data flow transparency only partially shown (e.g., telemetry events), external effects (e.g., browser actions) not explicitly restricted.
Evidence shows: CI workflow includes lint, build, unit tests, e2e tests, and tests cover error handling (e.g., CLI error messages); dependency versions pinned (pnpm-lock.yaml) and overrides ensure availability. Deductions: self-consistency partially shown (e.g., CLI command naming), failure messages verified in tests but not comprehensively covered.
Evidence shows: README describes multiple use cases (act, agent, extract), supports local and Browserbase environments; CLI provides various commands (cloud fetch, search, etc.). Deductions: trigger precision (e.g., act instruction parsing) not detailed, environment fit (e.g., browser versions) relies on external configuration.
Evidence shows: README provides installation and build instructions, LICENSE is MIT, CI workflow reflects maintenance responsibility; but explicit version changelog and known limitations are missing. Deductions: naming stability (e.g., CLI commands) not explicitly guaranteed, version changelog absent.
Evidence shows: Output formats (JSON, table) and file output supported, CLI provides multiple features (fetch, search, projects, etc.), marginal value high; but cost-benefit (e.g., token consumption) not quantified. Deductions: cost-benefit lacks data support.
Evidence shows: README claims (e.g., reliability) are supported by tests, but no specific evidence links provided; test files (e.g., cli-cloud-contract.test.ts) verify API contracts. Deductions: claim traceability insufficient, cross-source corroboration limited, fact-inference separation unclear.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- User confirmation mechanism missing: actions like act may execute directly, use with caution.
- Rollback functionality not provided: no automatic recovery after failed automation.
- Data flow transparency limited: specific use and storage of telemetry data not detailed.
- Dependency security relies on overrides, but no vulnerability scan report provided.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
Patch Changes - [#2842](https://github.com/browserbase/stagehand/pull/2842) [f86e609](https://github.com/browserbase/stagehand/commit/f86e609b934d3f8ae625f5399104df2df9ade7a5) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - update the MCP SDK to v1.30 and refresh supporting dependency versions …View on GitHub ↗ -
stagehand-server-v3/v3.7.6 stagehand/server-v3 v3.7.6
Release notes excerpt
What's Changed * Version Packages by @github-actions[bot] in https://github.com/browserbase/stagehand/pull/2778 * [V3]: rm docs pkg by @seanmcguire12 in https://github.com/browserbase/stagehand/pull/2830 * [V3]: fix xpath building logic for coordinates inside of iframes by @seanmcguire12 in https://github.com/browserbase/stagehand/pull/2836 * [V3]: bump various transitive deps by @seanmcguire12 in https://github.com/browserbase/stagehand/pull/2842 * [V3]: bump non core transitive deps by @seanmcguire12 in https://github.com/browserbase/stagehand/pull/2845 …View on GitHub ↗ -
stagehand-server-v3/v3.7.5 stagehand/server-v3 v3.7.5
Release notes excerpt
What's Changed * Contrib/2384 by @miguelg719 in https://github.com/browserbase/stagehand/pull/2385 * chore(release): retarget release automation from main to v3 by @miguelg719 in https://github.com/browserbase/stagehand/pull/2660 * fix(v3): normalize CUA coordinates to actual viewport by @miguelg719 in https://github.com/browserbase/stagehand/pull/2767 * fix(v3): preserve provider for structured output by @miguelg719 in https://github.com/browserbase/stagehand/pull/2775 * Version Packages by @github-actions[bot] in https://github.com/browserbase/stagehand/pull/2662 …View on GitHub ↗
FAQ
Does Stagehand support Python?
What credentials do I need?
How does Stagehand handle website changes?
Can I install Stagehand into an existing project?
pnpm add "github:browserbase/stagehand#<branch>&path:/packages/core".