stagehand
Browserbase's SDK for building browser agents
Decision gist · record as of 2026-08-14
Yes. Stagehand is actively maintained, carries no known vulnerabilities, and is purpose-built for agent-driven browser automation with features (self-healing, agent-optimized context, complex DOM support) that address real pain points in autonomous web interaction. The MIT license and low install friction make it a straightforward choice for projects building production browser agents. Install if you are building AI agents that need to interact reliably with web interfaces.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later; LLM API credentials (e.g., OpenAI key) needed for agent operations.
- Active maintenance with a recent release and high repository engagement (23940 stars).
- Low install friction via a pure-Python wheel.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, making it suitable for production agent applications.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14 · 23,940 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,401,472 downloads/mo, #3,950 on PyPI
Alternatives
Verify before relying
import asyncio
from stagehand import Stagehand, local_browser
async def main():
browser = await local_browser.launch(headless=True)
stagehand = await Stagehand.create(browser=browser, model="openai/gpt-4-mini", model_api_key="...")
await stagehand.act("click on element")
result = await stagehand.observe("find something")
await stagehand.close()
await browser.close()
asyncio.run(main())- Whether self-healing actions reduce token consumption compared to standard Playwright in typical agent workflows.
- Performance characteristics and latency profile for complex multi-step agent tasks.
- Compatibility and interoperability with non-OpenAI LLM providers beyond the documented examples.
What it is and what it does
Stagehand is a Python SDK designed specifically for building browser agents—autonomous systems that interact with web pages on behalf of AI models. Unlike Playwright, which was built for testing, Stagehand combines familiar Playwright-style APIs with agent-specific features: self-healing actions that adapt when websites change, agent-optimized page context that reduces token usage, and native support for complex DOM structures including out-of-process iframes and closed Shadow DOMs. The SDK provides three core methods—act() for executing individual actions, observe() for reporting actionable elements on a page, and extract() for returning structured data validated by Pydantic models—plus deterministic Playwright-style locators for precise control.
The package integrates with local browsers via local_browser or hosted Browserbase sessions, supports async Python workflows, and includes OpenTelemetry instrumentation for observability. It is actively maintained with recent releases and carries no known security vulnerabilities. The runtime depends on browserbase, pydantic, opentelemetry-api, and websockets, all of which are standard ecosystem packages. Stagehand is intended for production use in agent systems where reliability, determinism, and token efficiency matter.
Use it for
- Automate multi-step web tasks like form filling, navigation, and data extraction for AI agents without manual DOM selector maintenance.
- Build autonomous agents that interact with GitHub, e-commerce, or SaaS platforms while adapting to UI changes through self-healing actions.
- Extract structured data from web pages into Pydantic models, validated and typed for downstream processing.
- Monitor and interact with dynamic web content including iframes and Shadow DOMs that standard browser automation tools struggle with.
- Reduce LLM token consumption by providing agent-optimized page context and deterministic action feedback.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Stagehand is actively maintained, carries no known vulnerabilities, and is purpose-built for agent-driven browser automation with features (self-healing, agent-optimized context, complex DOM support) that address real pain points in autonomous web interaction. The MIT license and low install friction make it a straightforward choice for projects building production browser agents. Install if you are building AI agents that need to interact reliably with web interfaces.
Install
stagehand on PyPI
Before you install
Active maintenance with a recent release and high repository engagement (23940 stars). Low install friction via a pure-Python wheel. Requires Python 3.11 or later and four runtime dependencies including browserbase, pydantic, opentelemetry-api, and websockets.
Requires Python 3.11 or later; LLM API credentials (e.g., OpenAI key) needed for agent operations.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for production agent applications.
Quickstart
import asyncio
from stagehand import Stagehand, local_browser
async def main():
browser = await local_browser.launch(headless=True)
stagehand = await Stagehand.create(browser=browser, model="openai/gpt-4-mini", model_api_key="...")
await stagehand.act("click on element")
result = await stagehand.observe("find something")
await stagehand.close()
await browser.close()
asyncio.run(main())
Verify before relying
- Whether self-healing actions reduce token consumption compared to standard Playwright in typical agent workflows.
- Performance characteristics and latency profile for complex multi-step agent tasks.
- Compatibility and interoperability with non-OpenAI LLM providers beyond the documented examples.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesbrowserbaseopentelemetry-apipydanticwebsockets |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,401,472 / month, #3,950 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
Evidence: stagehand-4.0.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “playwright alternative for ai”
- stagehandStagehand is a Python SDK for building browser agents with…
- cloakbrowserLaunches a stealth Chromium browser that evades bot detection by…
- agentqlAgentQL is a Python client for interacting with web pages using…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also testmuai-playwright-bindings · agentql · browserbase · pytest-playwright-asyncio · tf-playwright-stealth · pytest-playwright · robocorp-browser · hyperbrowser · nova-act · pyppeteer