Browserbase Rebuilds Stagehand v4 to Run 1.59x Faster as a Browser Extension
Browserbase ships Stagehand v4, moving browser state management into an extension to fix remote automation reliability and unify TypeScript, Python, and Go SDKs
Takeaways
- Stagehand v4 is live: Browserbase ships a major architectural overhaul moving browser state management into a browser extension co-located with the page.
- Remote reliability fixed: State is now queried live from the browser, eliminating the stale-mirror bugs that caused errors like
Target page, context or browser has been closedin remote setups. - TypeScript, Python, and Go at parity: The shared extension core means one feature implementation ships to all three SDKs simultaneously.
- Speed gains: Experimental batch commands show 1.59x throughput over Playwright on a 50-action crawl;
goBackdropped from 139.5ms to 17.5ms. - Security for agents: Domain policy now enforced at the network level inside the browser, blocking prompt-injection exfiltration before requests leave.
- Free and open source: MIT-licensed, 23k+ GitHub stars, works locally with any Chromium browser; Browserbase cloud is optional for production. GitHub | Docs
Stagehand v4 is out. Browserbase's open-source browser automation framework has undergone its biggest architectural overhaul: the core of the framework no longer lives in your SDK process. It now runs as a browser extension, sitting next to the page it controls. That one change produces faster remote automation, a unified multi-language SDK, and security properties that Playwright was never designed to provide.
The stale-state problem every agent builder hits
Every browser automation framework, Playwright, Selenium, Puppeteer, works the same way under the hood. Your code holds a local object (a page, a context) that mirrors state living inside a browser process somewhere else. When the browser is on your laptop, that mirror is a few microseconds away and the gap is invisible. Point it at a remote browser in another region and the gap becomes a source of real bugs.
The classic symptom is the Target page, context or browser has been closed error. Your agent calls page.click, the page navigates at the same instant, and the click arrives at a target that no longer exists. The client thought the page was there; by the time it found out otherwise, the request was already in flight. Remote execution does this to any framework that manages its own copy of browser state.
Stagehand v3 hit a concrete version of this with domain policy enforcement. To block a domain, Stagehand used CDP's Fetch domain to intercept outgoing requests. For tabs it opened itself, interception was armed before anything loaded. But when a page triggered window.open, the new tab started loading before Fetch.enable could reach it from the client machine. The pop-up leaked through, and the only fix was closing it after the fact.
Moving the engine inside the browser
Stagehand v4 moves target management, state, and CDP dispatch into a browser extension that runs next to the page. The SDK becomes a thin client that sends JSON messages to a service worker running inside the browser, rather than a stateful process trying to maintain an accurate local copy of what the browser is doing. Remote browsers now behave like the Chrome on your laptop.