Stagehand: AI-Resolved Instructions Meet Deterministic Browser Automation
Stagehand pairs AI-resolved natural-language instructions with deterministic browser actions, surviving redesigns that break hardcoded selectors.
Stagehand is an open-source browser automation SDK from Browserbase that positions itself between brittle hardcoded selectors and unpredictable fully-autonomous agents. Developers write plain-English instructions like "click the buy button"; an AI resolves the instruction to a real page element at runtime, and deterministic code performs the actual click. The MIT-licensed project has surpassed 23,000 GitHub stars.
The framework is built around four verbs: act, extract, observe, and agent. The first three are precision tools - act executes a single atomic step, extract returns data validated against a Zod schema, and observe surveys actionable elements before anything irreversible happens. agent hands over control entirely, looping through observe-decide-act cycles toward a goal, optionally backed by computer-use models.
Rather than sending screenshots or raw HTML to the model, Stagehand reads the page's accessibility tree - the same semantic outline browsers maintain for screen readers - making the payload far smaller and role/label-based rather than markup-based. Sensitive values like passwords are handled through placeholder variables so secrets never reach the LLM. For engineers, the appeal is clear: automation that survives page redesigns while remaining debuggable and token-efficient compared to fully autonomous agents.