# Stagehand

> Browserbase's open-source SDK for browser agents — act, extract, observe, and agent primitives that mix natural language with code-level control.

Stagehand (MIT, ~23k stars, by Browserbase) is the engineer's browser-agent SDK: four primitives — act() for natural-language actions that survive redesigns, extract() with Zod-validated schemas, observe() to preview actionable elements, agent() for full autonomy — composable with ordinary code. TypeScript-first, Python too; Browserbase cloud optional.

Website: https://stagehand.dev

Stagehand is the browser-agent framework built the way engineers wish AI tools were built: **deterministic code by default, intelligence exactly where brittleness lives.** Instead of handing the whole task to an agent, you compose four primitives — and each one earns its place.

## Highlights

- **`act()`** — natural-language actions ("click the submit button") resolved against the live page, surviving the redesigns that break selectors.
- **`extract()`** — structured data out, validated against a Zod schema: [structured output](/glossary/structured-output) discipline applied to scraping.
- **`observe()`** — preview what's actionable on a page before committing, the look-before-you-leap primitive.
- **`agent()`** — full multi-step autonomy when you want it, model-agnostic (pairs with any LLM or computer-use model).
- **v3 architecture** — native CDP driver layer (Playwright removed), self-healing execution, and action caching that avoids repeat inference on known pages.
- **Two languages** — TypeScript flagship, Python SDK alongside; `npx create-browser-app` scaffolds a running project.

## In an AI-assisted workflow

```bash
npx create-browser-app    # scaffold + run locally; OPENAI_API_KEY (or similar) required
```

The sweet spot is **reliable automations with AI joints**: a checkout flow that's 90% ordinary code and 10% `act()` where the DOM churns; an extraction pipeline whose schema is enforced, not hoped for. For one-shot autonomous errands, [Browser Use](/tools/browser-use)'s task-in/result-out model is less ceremony; the trade is exactly control versus convenience.

> [!TIP]
> The caching matters in production: actions Stagehand has resolved once replay without LLM calls until the page changes — turning per-step model costs from a constant into an amortized one.

## Good to know

MIT, from Browserbase (whose $40M Series B, June 2025, funds the cloud layer: hosted browsers, recordings, stealth, proxies — optional, paid, and where scale lives). v2-era content predates the Playwright removal — check versions when following tutorials. Field positioning against Browser Use, Skyvern, and the MCP-based options: [Browser Agents in 2026](/guides/comparisons/browser-agents-compared-2026).

---

_Source: https://agentscamp.com/tools/stagehand — Tool on AgentsCamp._
