drivers ai

Stagehand Driver Now Available

BCTRL Team ·

A New Way to Automate

Today we’re launching the Stagehand driver for BCTRL — bringing AI-powered browser automation to the platform. Instead of writing CSS selectors and XPath queries, you describe what you want in plain English.

How It Works

Stagehand uses vision and language models to understand web pages the way a human would. Point it at a page, tell it what to do, and it figures out the rest:

import { BCTRL } from "@bctrl/sdk";

const session = await BCTRL.browser.create({ driver: "stagehand" });

await session.goto("https://example.com");
await session.act("Click the sign-in button");
await session.act("Fill in the email field with test@example.com");
await session.act("Submit the form");

No selectors. No waiting strategies. No brittle locators that break when the UI changes.

Intelligent Element Detection

Stagehand doesn’t just match text — it understands context. Ask it to “click the submit button” and it knows which button you mean, even if there are multiple buttons on the page. It considers:

  • Visual hierarchy — Primary buttons are prioritized over secondary ones
  • Proximity — Elements near the content you just interacted with are ranked higher
  • Semantic meaning — It understands that “Sign In”, “Log In”, and “Login” mean the same thing

When to Use Stagehand

Stagehand is ideal for:

  • Prototyping automations quickly — Skip the selector engineering phase entirely
  • Handling dynamic UIs — Pages that change layout frequently won’t break your scripts
  • Non-technical users — Let team members write automations in plain language
  • AI agent workflows — Let LLMs drive the browser directly without selector knowledge

For high-performance, high-volume automation, Playwright and Puppeteer drivers remain the best choice. Stagehand adds a small latency overhead per action due to the AI inference step.

Getting Started

Enable the Stagehand driver when creating a session:

const session = await BCTRL.browser.create({
  driver: "stagehand",
  model: "gpt-4o", // or "claude-sonnet-4-5-20250514"
});

Check out our documentation for the full Stagehand API reference and examples.