Browser Runtimes

View as Markdown

Browser runtimes are hosted Chromium environments inside a space. BCTRL runs the browser, manages access, records evidence, and gives your automation code a CDP connection.

Your external automation tools connect over CDP:

  • Playwright
  • Puppeteer
  • Selenium
  • Chrome DevTools-compatible debuggers

Hosted AI work uses invocations instead. Use invocations when BCTRL should run Stagehand or browser-use agent work inside the runtime.

What BCTRL manages

CapabilityWhat it does
ProfilesReuse cookies, local storage, and browser identity across runs.
ProxiesRoute browser traffic through custom or managed proxies.
StealthReduce common automation detection signals.
CAPTCHAHandle supported CAPTCHA challenges.
ExtensionsLoad approved browser extensions.
ObservabilityRun events, commands, artifacts, live view, and recording.

Basic flow

1const space = await bctrl.spaces.create({
2 name: "invoice-agent",
3});
4
5const runtime = await space.runtimes.browser.launch({
6 name: "quickbooks",
7 config: {
8 stealth: "high",
9 },
10});
11
12const connection = await runtime.connections.create({
13 protocol: "cdp",
14});

Pass connection.endpoint.url to your browser framework and run normal automation code.

1const browser = await chromium.connectOverCDP(connection.endpoint.url);
2const page = browser.contexts()[0]?.pages()[0] ?? await browser.newPage();
3
4await page.goto("https://example.com");

Observe the active run through currentRun().

1const run = await runtime.currentRun();
2
3await run.events.list();
4await run.artifacts.list();