Skip to content
Browserbase
    • Primitives
      • BrowsersCloud browsers for your agent to use the web
      • AgentsScale fully managed browser agents with simple prompts
      • SearchFind relevant websites from a single query
      • FetchRetrieve web data as agent-ready HTML, JSON, or markdown
      • RuntimeScalable, sandboxed environments for agent deployments
      • IdentityAuthenticate your agent to navigate the web like a human
      • ModelsUse any model with a single API key
      • ObservabilityUnified debugging your agent across replays, logs, and prompts
    • Open Source
      • Browse CLIGive your agent browsing skills with a single command
      • StagehandThe most popular AI browser automation framework
    • Use Cases
      • Browser AgentsPower agents across logins, forms, and portals
      • Web Data ExtractionAutomate data extraction from sites with no APIs
      • Records VerificationCheck KYB, background, and title from official sources
      • Portal FilingsFile registrations, pay invoices, and submit appeals at scale
      • Document RetrievalCollect receipts, statements, and reports from vendor portals
      • Data MigrationImport a new customer's data from the system they're leaving
      • Permissioned Data AccessSecurely access payroll, HRIS, and patient portal accounts your users authorize
      • AI AssistantsBuild agents that act on behalf of your users
      All use cases
    • Industries
      • AI & Agent Platforms
      • Healthcare
      • Fintech
      • GTM
      • Legal
    • Resources
      • Blog
      • Customers
      • Enterprise
      • Templates
  • Pricing
  • Docs
  • Log in
Log in
Sign up
Get a demo

November 5, 2026

Introducing Stagehand 4.4: browser.disconnect(), crash-safe sessions, and more

Product Name
Stagehand
Pixelated orange hills and green mountains under a pale sky

We're excited to announce Stagehand 4.4!

This release is about long-lived browsers. You can now let go of a browser without closing it, come back to it later, and trust Stagehand to clean up when your process dies. Here are the highlights:

Disconnect from a browser and reattach later

browser.disconnect() closes Stagehand's connection without closing the browser or releasing its Browserbase session. Tabs, cookies, and signed-in profiles stay where they are. Connect again with localBrowser.connect({ cdpUrl }) or browserbase.connect({ sessionId }), create a new Stagehand instance, and pick up where you left off. Available in TypeScript and Python.

const browser = await browserbase.launch({
  apiKey: process.env.BROWSERBASE_API_KEY,
  keepAlive: true,
});
const stagehand = await Stagehand.create({ browser });
const sessionId = browser.sessionId!;

// Let go: Stagehand closes, the session keeps running
await browser.disconnect();

// Later, from any process
const again = await browserbase.connect({
  apiKey: process.env.BROWSERBASE_API_KEY,
  sessionId,
});
const stagehand2 = await Stagehand.create({ browser: again });

The same works for a local Chrome you started yourself:

let browser = await localBrowser.connect({ cdpUrl: "http://127.0.0.1:9222" });
let stagehand = await Stagehand.create({ browser });

await browser.disconnect(); // Chrome and its tabs keep running

browser = await localBrowser.connect({ cdpUrl: "http://127.0.0.1:9222" });
stagehand = await Stagehand.create({ browser });

On Browserbase, keepAlive decides whether the session survives the disconnect, so launch with keepAlive: true. Calling close() on a handle after you disconnect it throws, so you never close a browser you meant to keep. Read the docs.

Crash-safe sessions

If your SDK process crashes or gets killed, the Stagehand extension now notices from inside the browser, without heartbeats or timers, and cleans up. A local Chrome that Stagehand launched without keepAlive shuts down instead of being orphaned. A keepAlive browser or Browserbase session is released so a new client can attach right away. The watchdog needs Chrome 137 or later.

That also means keepAlive actually works on local browsers now: launch with localBrowser.launch({ keepAlive: true }) and Chrome outlives your script, ready for you to reconnect.

Built on Stagehand: browser use in LangChain Deep Agents

LangChain is giving Deep Agents a browser, and the tools are built on Stagehand. Managed Deep Agents now runs a browser for your agent, with browser_snapshot, browser_run, browser_screenshot, and browser_handoff tools. In LangChain's tests on 100 WebVoyager tasks, the Stagehand-based tools passed 90% for $1.98 in total, the highest pass rate of the seven toolsets they tested. The runner-up passed 89% at 9x the cost.

For open source agents, LangChain now ships langchain-stagehand on PyPI. StagehandMiddleware gives any LangChain or Deep Agents agent Stagehand's run, snapshot, and screenshot tools over one persistent browser, local Chrome or Browserbase, with no MCP server needed.

from deepagents import create_deep_agent
from langchain_stagehand import StagehandMiddleware
from stagehand import Stagehand, browserbase

browser = await browserbase.launch(api_key=os.environ["BROWSERBASE_API_KEY"])
stagehand = await Stagehand.create(browser=browser)

agent = create_deep_agent(
    "anthropic:claude-sonnet-4-6",
    middleware=[StagehandMiddleware(stagehand=stagehand)],
)

Read Sydney Runkle's post, Browser Use in Managed Deep Agents, or get started with the browser use guide.

Here's what else is new:

  • Cross-origin iframes are more reliable: iframes that were already loaded when Stagehand attached (for example after a reconnect), or that are nested inside another cross-origin iframe, are now picked up, so snapshots and actions can reach them (#3339). act() also no longer stops cross-origin iframes from loading (#3388).
  • Know when a connection is gone: browser handles expose connected, which reports whether the handle still has a live connection, and cdpUrl (cdp_url in Python) for local browsers, so you always know where to reconnect.
  • Claude Opus 5.5 fixes: act(), observe(), and extract() now work correctly with Claude Opus 5.5 (#3340).
  • Tighter domain policies: closed ways around domain allow and block lists through URLs with credentials, background requests, and speculative page loads (#3387).

Give it a try and tell us what you build!

Browserbase

Primitives

  • Browsers
  • Web APIs
  • Runtime
  • Identity
  • Model Gateway
  • Observability
  • Stagehand
  • MCP

Industries

  • AI
  • Healthcare
  • GTM
  • Tax
  • Legal

Developers

  • Docs
  • Templates
  • APIs & SDKs
  • Changelog
  • Status
  • Github

Company

  • Careers
  • Customers
  • Partner with Us
  • Trust & Security

Community

TwitterLinkedinYoutube
  • Privacy Policy
  • Terms of Service

Community

TwitterLinkedinYoutube
  • Privacy Policy
  • Terms of Service