Stagehand v4 is Browserbase's SDK for building browser agents, launched in 2026 as a complete rewrite that moves the core execution into a native browser extension, promising twice the speed of Playwright and an 80% token saving. Unlike traditional headless browsers such as Puppeteer or Playwright, which were built for automated testing, Stagehand was built specifically for AI agents to interact with the web semantically, using natural language commands instead of fragile CSS selectors. In version 4, the project removed the integrated orchestrator to return control to the programmer, doubled performance, and drastically reduced the LLM cost per operation. The architectural shift is significant: instead of controlling the browser from an external process via CDP (Chrome DevTools Protocol), Stagehand v4 runs its state management, frame tracking, and command dispatch inside an extension of the browser itself. This removes the network round trip between the SDK and the browser, enables asynchronous access to pages and contexts, and opens the door to a more robust security model where enforcement runs inside the browser process. How does Stagehand v4 work? Stagehand v4 operates on three natural language primitives that form its core API: , , and . Each one solves a different piece of the agent web interaction. runs an action described in free text on the page. Instead of writing and crossing your fingers that the selector did not change, you describe what you want: . Stagehand uses a language model to interpret the intent, locate the relevant element in the DOM (or in Chrome's accessibility tree), and execute the action. If the page changes tomorrow and the button now has class instead of , your script still works. inspects the page and returns a list of detected interactive elements, with metadata about their type, position, and context. It is useful for debugging what the agent sees before acting, or for building pipelines where the agent first "looks" and then decides. extracts structured data from the page, validating it against a schema you define. If you need prices, product names, and availability from an online store, you describe the expected structure and Stagehand returns typed JSON, not raw HTML that you then have to parse with cheerio. Version 4 introduces important changes to the SDK lifecycle. In v3 you created a Stagehand instance and it launched the browser for you. In v4 the order is inverted: you launch or connect the browser first, then create Stagehand by passing that instance to it. This reflects the new architecture: Stagehand no longer "owns" the browser; it runs "alongside it" as an extension that the SDK communicates with. Another significant change: has been removed . In previous versions, Stagehand included an autonomous orchestrator that could run sequences of actions without programmer intervention. Version 4 drops that idea. The control flow is once again your responsibility; Stagehand provides the low level primitives, but you decide when to act, when to observe, and when to extract. It is an explicit bet on transparency and control over opaque magic. How does Stagehand v4 differ from Playwright and Puppeteer? The most honest comparison comes from Browserbase's own documentation: "Playwright was built for testing; Stagehand was built for agents." This distinction is not marketing; it translates into concrete technical decisions. | Feature | Stagehand v4 | Playwright | Puppeteer | | | | | | | Primary purpose | Autonomous AI agents | End to end testing | Chrome automation | | Control API | Natural language ( , ) + code | Deterministic selectors | Deterministic selectors | | Resilience to UI changes | High (self healing) | Low (fragile selectors) | Low (fragile selectors) | | Performance (v4 claim) | 2x vs Playwright | Baseline | Similar to Playwright | | Token efficiency | 80% more efficient | N/A (does not use LLM) | N/A (does not use LLM) | | v4 architecture | Native browser extension | External CDP process | External CDP process | | Orchestration | Manual (removed ) | Manual | Manual | | iframes / Shadow DOM support | Yes (nested, out of process) | Yes | Partial | Playwright and Puppeteer shine when you know the structure of the page and need to repeat the same sequence a thousand times deterministically. When the CSS changes, broken tests pile up in the QA team's inbox. Stagehand bets on the opposite case: pages that change constantly, flows where the structure is not known ahead of time, or tasks where the cost of keeping selectors updated exceeds the cost of using a language model. The design question is not "which is faster?" but "where do you want to spend your engineering hours: keeping selectors alive or paying LLM tokens?" A concrete data point: Browserbase reports that Stagehand v4 is approximately 2x faster than Playwright in its internal benchmarks, and 80% more token efficient than earlier versions of Stagehand. These figures come from the vendor itself, so take them