← Blog

BLOG

Browserbase Skills: Build Reliable Browser Workflows

Learn what browserbase skills mean, how to structure reusable browser instructions, connect Playwright over CDP, and manage sessions in production.

8 min readRemote Browser
Ivory computer towers connected across terracotta platforms in a quiet desert landscape
The infrastructure behind your browserREMOTE BROWSER / ILLUSTRATION

“Browserbase skills” usually refers to reusable instructions that help an AI agent operate a browser session provided by Browserbase. A skill can describe how to navigate a site, what actions are allowed, how to verify results, and when to stop. Browserbase supplies the hosted browser session; the skill guides the agent that uses it.

That distinction matters when you choose a setup. A skill does not, by itself, create a browser session or connect your code to one. Your agent still needs a browser tool or automation library, a session endpoint, and a way to manage the session’s lifetime. This guide covers how to organize those pieces and how to use Playwright over Chrome DevTools Protocol (CDP).

What “Browserbase skills” can mean

The phrase can describe a few related things:

  • Reusable agent instructions: A Markdown file or framework-specific package that tells an agent how to carry out browser tasks.
  • Browser tools: Functions exposed to an agent, such as opening a page, clicking a control, or reading visible content.
  • A hosted browser session: A remote Chromium instance that the tools control through a supported connection.
  • A workflow: Instructions, tool calls, browser access, and checks assembled to complete a repeatable task.

These parts work together, but they solve different problems. Instructions set the workflow. The agent or automation library chooses and issues actions. The hosted browser runs the page and holds its live state.

There is no single universal “Browserbase skill” format that every agent framework recognizes. Check the documentation for the specific agent or skill system you use. A project may package instructions in a SKILL.md file, but another framework may expect a tool definition or configuration of its own.

Separate the skill from the browser runtime

A useful design keeps the skill’s instructions distinct from the code that creates and controls sessions. This makes it easier to change an agent framework or browser provider without rewriting every task.

LayerResponsibilityExample
Skill instructionsDefine the task, limits, and success checks“Find the latest invoice and report its date and total.”
Agent or workflowSelect tools, interpret results, and handle errorsCall a navigation tool, inspect the page, then verify the invoice.
Browser connectionAttach automation code to a live browserConnect Playwright to a CDP WebSocket endpoint.
Browser runtimeRun Chromium and maintain page stateA Browserbase session or another hosted browser service.

This separation also helps with failures. If the agent clicks the wrong control, review its instructions and action logic. If the connection drops, review session setup and network access. If the page behaves differently in Chromium, inspect the browser session and page state.

For a broader overview of hosted sessions and agent workflows, see remote browsers for AI agents. The Remote Browser documentation covers its own session and connection options.

What a useful browser skill should contain

A browser skill should give the agent enough detail to act safely, while leaving room to handle normal changes in page layout. Keep the instructions task-specific and easy to follow.

Include these elements:

  1. Purpose and scope. State which task the skill handles and which sites or page types it covers.
  2. Starting conditions. Explain whether the agent begins at a URL, an authenticated page, or an existing browser session.
  3. Allowed actions. Specify what the agent may read, change, submit, or download.
  4. Action guidance. Prefer semantic controls such as labels and accessible roles. Give a fallback for ambiguous page content.
  5. Verification. Define what evidence confirms that the task succeeded.
  6. Failure handling. Tell the agent when to retry, ask for help, or stop.
  7. Session handling. Clarify what state may persist and when the session must end.

For example, a skill for reviewing an order could tell the agent to open the order page, find the order by a supplied identifier, read the status and expected delivery date, and report those values with their page context. If the order is missing or multiple matches appear, it should stop and report the ambiguity instead of guessing.

The skill should also define limits around consequential actions. Reading a page and submitting a payment are different operations. If a workflow can make purchases, change account settings, or send messages, require a clear approval step before that action. Instructions should describe the approval condition in terms the agent can check.

Connect Playwright to a hosted CDP session

When a provider exposes a Chromium session through a CDP WebSocket endpoint, Playwright can attach to that browser with connectOverCDP. The endpoint is a credential: retrieve it from your session setup and keep it on the server. Do not place it in browser-side JavaScript, a public repository, or logs.

The following TypeScript example expects BROWSER_WS_ENDPOINT to contain the authorized endpoint for an active session:

import { chromium } from "playwright";

const endpoint = process.env.BROWSER_WS_ENDPOINT;

if (!endpoint) {
  throw new Error("BROWSER_WS_ENDPOINT is required");
}

const browser = await chromium.connectOverCDP(endpoint);

try {
  const context = browser.contexts()[0];

  if (!context) {
    throw new Error("The connected session has no browser context");
  }

  const page = context.pages()[0] ?? await context.newPage();

  await page.goto("https://example.com/account/orders", {
    waitUntil: "domcontentloaded",
    timeout: 30_000,
  });

  const heading = page.getByRole("heading", { name: /orders/i });
  await heading.waitFor({ state: "visible", timeout: 10_000 });

  const orderStatus = await page
    .getByRole("row", { name: /order #12345/i })
    .getByText(/shipped|processing|delivered/i)
    .textContent();

  if (!orderStatus) {
    throw new Error("Could not verify the order status");
  }

  console.log({ orderStatus: orderStatus.trim() });
} finally {
  await browser.close();
}

Use the Playwright `connectOverCDP` documentation to check the current API behavior and its limitations. Playwright describes CDP connection as lower fidelity than its native Playwright protocol connection. connectOverCDP is for Chromium-based browsers, so confirm that it fits the provider’s supported connection method.

The code assumes the active session already has a browser context and may have an open page. Session setup, authentication, and shutdown are provider-specific. Follow the provider’s documentation for creating and ending sessions; confirm whether closing the Playwright connection also affects the remote session.

Design the skill around observable page state

Skills become more reliable when they tell the agent how to verify what happened. A click succeeding at the API level does not prove the site accepted the action. After submitting a form, for example, check for a confirmation message, a changed status, or a resulting record.

Prefer selectors based on page meaning:

  • Use getByRole with an accessible name for buttons, links, headings, and form controls.
  • Use getByLabel for labeled inputs.
  • Use getByText for distinctive, visible text when no better semantic locator exists.
  • Use a CSS selector when the page has no stable semantic locator, and document why it is needed.

Avoid relying on coordinates or brittle class names when the site exposes meaningful controls. For workflows that must use visual interaction, make the skill specify how the agent should confirm the target before acting.

The skill should also distinguish a recoverable delay from a failed task. Wait for a specific page condition, such as a visible result row, rather than sleeping for a fixed interval. If the condition does not appear within a reasonable timeout, capture useful context and stop or follow a stated recovery path. Repeating a click without checking the page can create duplicate submissions.

Manage identity, state, and isolation

A browser session holds more than a page URL. It may contain cookies, local storage, open tabs, and authentication state. Decide whether the task needs an existing profile or a clean session, and make that choice explicit in your workflow.

Use a persistent profile when the same authorized identity needs to carry across runs. Use an isolated session when tasks should not share cookies or page state. Restrict access to session endpoints and credentials, and avoid recording secrets in traces, screenshots, or application logs.

For teams using hosted browsers, review these operational details before scaling a skill:

  • Session ownership: Know which worker created a session and which worker is allowed to control it.
  • Timeouts: Set limits for connection, navigation, and task duration.
  • Concurrency: Check the account’s current session and concurrency limits before scheduling parallel work.
  • Cleanup: End sessions when the task finishes or fails, following the provider’s lifecycle guidance.
  • Debugging: Use a live viewer or approved recordings to inspect failures, while controlling access to sensitive page content.
  • Usage tracking: Attribute browser time and errors to a task, user, or job so you can diagnose unexpected usage.

Pricing and plan limits can change. Check the pricing page for current details before estimating production costs.

Browserbase skills and Remote Browser

A skill can be written for a specific provider, or it can describe a workflow that uses a provider-neutral browser interface. Provider-specific instructions may cover session creation, endpoint retrieval, and session shutdown. A provider-neutral skill can focus on navigation, allowed actions, and verification while an adapter handles those details.

Remote Browser provides hosted Chromium sessions with CDP access and compatibility for Playwright, Puppeteer, and Selenium. Its runtime also includes a live viewer, persistent profiles, session isolation, usage controls, and configurable browser settings. Teams can use these capabilities as the browser layer for agent workflows, while keeping their own task instructions and action policies in a skill.

The choice depends on what your system already uses. If an existing agent integration is built around Browserbase, a skill can document its session conventions and tools. If you want to compare the runtime layer separately, see remote browser options and remote control for browser workflows.

Production checklist

Before deploying a browser skill, confirm that:

  • Its task scope and permitted actions are explicit.
  • The browser endpoint comes from a trusted server-side source.
  • The agent verifies outcomes using page state.
  • Ambiguous results and failed checks lead to a defined stop or recovery path.
  • Session identity, persistence, and cleanup are documented.
  • Logs and debugging artifacts are reviewed for sensitive data.
  • Timeouts, concurrency, and usage are monitored under realistic workloads.

A well-structured Browserbase skill makes browser tasks repeatable by giving the agent clear instructions and checks. Reliable execution still depends on the connected runtime, session configuration, and how the workflow handles errors. Keep those responsibilities visible, and you can update the skill without losing control of the browser sessions beneath it.