act()
Perform browser actions from a plain-English instruction. Click, fill, navigate, scroll.
Stagehand is an open source SDK that uses AI to make your browser agents resilient, readable, and production-ready.
Write browser agents using natural language instructions that handles real-world page changes, without handing over control to a black-box agent.
Perform browser actions from a plain-English instruction. Click, fill, navigate, scroll.
Pulls structured data from any page with Zod schema validation.
Surfaces what's actionable on a page before you commit to an action.
Runs multi-step workflows autonomously when you need end-to-end execution.
Every team running Playwright at scale knows the maintenance loop: a site updates its DOM, a selector breaks, a pipeline fails, someone gets paged.
Stagehand exits that loop. Instructions like "click the submit button" survive page redesigns because they're resolved by AI at runtime, not hardcoded into your test suite.
It's also the only open source browser AI framework built specifically for browser agents. Use it for agents that need to log in, navigate, extract, and take action on real web interfaces. Use it when there's no API. Use it when the site changes without warning.
The first browser agent framework built for the AI era, giving you both the predictability of code and the adaptability of AI.
| Feature | Legacy frameworks | Stagehand | Browser agent |
|---|---|---|---|
| Core features | |||
| Can read page content | Yes | Yes | Yes |
| Can interact with page | Yes | Yes | Yes |
| Continues to work when the page changes | No | Yes | Yes |
| Extract data using natural language | No | Yes | Yes |
| Framework standards | |||
| Fast, cheap, and predictable | Yes | Yes | No |
| Understandable | No | Yes | No |
| Self-healing | No | Yes | Yes |
| Open source | No | Yes | No |
Stagehand + Browserbase
Start using Stagehand locally with full feature compatibility. Four primitives (act, extract, observe, agent) all work out of the box. When you're ready for production, connect to Browserbase's cloud browsers with no code changes.
One API key, everything your agent needs. Browserbase gives Stagehand headless browsers with Agent Identity, action caching, session replay, prompt observability, and captcha solving. Deploy instantly with Functions - zero infrastructure.
Stagehand is an open source AI browser automation framework. It gives you four primitives — act, extract, observe, and agent — that let you write browser automations using natural language instructions instead of brittle CSS selectors. It's available in TypeScript and Python.
Traditional frameworks like Playwright and Selenium rely on hardcoded selectors that break whenever a site updates its DOM. Stagehand uses AI to resolve instructions like "click the submit button" at runtime, so your scripts survive page redesigns without maintenance. You still get deterministic control — Stagehand isn't a black-box agent.
No. Stagehand works locally out of the box with any Chromium browser. Browserbase is optional — when you're ready for production, you can connect Stagehand to Browserbase's cloud browsers for Agent Identity, session replay, captcha solving, and zero-infrastructure deployment via Functions.
Stagehand supports all major model providers — including OpenAI, Anthropic, and Google Gemini — via the Vercel AI SDK. If you're on Browserbase, you can also use Model Gateway to access every supported model through a single Browserbase API key, with no separate accounts or credentials to manage.
Yes. Stagehand is fully open source under the MIT license. You can find the source code, contribute, and file issues on GitHub at github.com/browserbase/stagehand.
Use act, extract, and observe when you want precise, step-by-step control over browser actions — they're deterministic and predictable. Use agent when you need multi-step workflows executed autonomously, like navigating a complex checkout flow. Most teams combine both: agent for exploration, individual primitives for critical paths.
Join the Stagehand community Discord at discord.gg/stagehand — it's the best place to ask questions, share what you're building, and get help from the team and other developers.