Stagehand
$ stagehand Official Med RiskStagehand (browserbase/stagehand) is Browserbase's AI-native browser automation framework and CLI/MCP toolkit built around deterministic observe, act, and schema-validated extract primitives. Ships official SKILL.md guidance for Claude Code and Codex along with stagehand init and create-browser-app.
npm install @browserbasehq/stagehand Combines CLI scaffolding and official SKILL.md agent workflows with a stdio MCP server adapter for persistent multi-step browser sessions.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Ships official SKILL.md, schema-typed extract JSON outputs, observe/act primitives, and stdio MCP integration.
- Official
SKILL.md, Zod-validatedextract, andstagehand init
Separates element discovery (observe) from execution (act) and reads API keys cleanly from environment variables.
- Env-based credentials and explicit
observebeforeactpattern
Available across TypeScript (npm), Python (pip), and npx create-browser-app with local or cloud Chromium.
- Multi-language npm/PyPI packages and
npx create-browser-app
Self-healing selectors + structured schema extraction dramatically cut fragile Playwright maintenance.
- Schema-first
extractand resilientact/observeprimitives
Official Browserbase flagship repository (browserbase/stagehand, 26k+ stars) under MIT license.
- Official
browserbase/stagehandrepository
Thorough docs at docs.stagehand.dev plus bundled SKILL.md for Claude Code and Codex.
- Official documentation at docs.stagehand.dev and
SKILL.md
Security, Auth & Guardrails
Reads optional BROWSERBASE_API_KEY, BROWSERBASE_PROJECT_ID, and model provider keys (OPENAI_API_KEY / ANTHROPIC_API_KEY) from environment variables.
MIT open-source SDK/CLI; local Chromium is free while Browserbase cloud sessions and LLM calls are usage-billed.
# stagehand Agent Rules - Prefer `observe` + schema-validated `extract` (Zod/Pydantic) before running `act` mutations. - Keep `BROWSERBASE_API_KEY` and LLM keys in `.env` or environment variables—never hardcode them in scripts. - Close browser sessions cleanly after extraction finishes.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx create-browser-app --help
Inspects CLI scaffolding options for launching a new Stagehand extraction script.
Controlled Writes & Previews
stagehand init
Generates Stagehand config files and environment templates for local or Browserbase runs.
Strengths for Agents
- + Ships official
SKILL.mdalongside schema-enforcedextractJSON outputs. - + Supports both local Chromium and managed Browserbase cloud browsers.
- + First-class TypeScript and Python tooling with
npx create-browser-app.
Caveats & Pitfalls
- ! Requires an LLM API key for AI-driven
act/observe/extractsteps. - ! Full automation scripts use SDK calls or the stdio MCP adapter rather than a single standalone query binary.