Generated banner for Safe Browser
Generated logo for Safe Browser

Safe Browser

BrowserbaseOfficialPublished by Browserbase

  • Skill
  • Workflow
  • Automation and integrations
  • MIT
  • Low risk
  • Has scripts

From the author

Build local constrained-browser agents with a safe_browser tool that owns CDP, enforces a domain allowlist with Fetch interception, and lets a runtime Claude Agent SDK agent complete browsing tasks without raw browser, shell, or CDP access. Use when the user wants an agent to browse or scrape while staying on approved domains, demo blocked off-domain navigation, or generate a safe browser client.
— the description by Browserbase

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a framework for creating local browser-based agents that operate within strict safety boundaries. By utilizing a custom safe_browser tool, developers can enforce domain allowlists via Fetch interception, preventing agents from accessing unauthorized external sites. The skill focuses on building demo applications using the Claude Agent SDK, ensuring that the runtime agent interacts with the web only through predefined, safe actions rather than raw browser or CDP access.

What it does

  • Sets up a local browser agent environment using the Claude Agent SDK.
  • Implements a safe_browser tool that wraps Playwright/CDP functionality.
  • Enforces domain-based security policies using Fetch request interception.
  • Provides structured extraction methods for specific web content.
  • Generates audit logs of all browser navigation and blocking decisions.
  • Demonstrates secure link-following and navigation containment.

When to use it

  • When you need to build a web scraper that must strictly adhere to a domain allowlist.
  • When demonstrating how to contain AI agents to prevent off-domain navigation.
  • When developing a browser-based agent that requires a secure, restricted interface.
  • When you need to test or verify agent behavior against specific security policies.

Advantages

  • Prevents unauthorized navigation through proactive Fetch interception.
  • Reduces risk by exposing only high-level actions instead of raw CDP access.
  • Provides verifiable audit logs for every browser request.
  • Simplifies the creation of domain-specific web scrapers.

Usage examples

“Build a browser agent that only scrapes Hacker News and blocks all external links.”
The agent is initialized with a safe_browser tool configured with an HN-only allowlist, ensuring all external navigation attempts are blocked and logged.
“Show me how to verify that my agent cannot leave the allowed domain.”
The system runs a test script that attempts an off-domain navigation, confirms the request is paused and failed by the firewall, and validates the agent remains on the target site.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/browserbase/safe-browser/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip safe-browser.zip -d .agents/skills

Documentation by Browserbase

Safe Browser

Build a local browser-agent demo where the generated runtime agent has exactly one browser capability: safe_browser. The tool owns the Playwright/CDP session, enables Fetch interception for all requests, and fails any request whose host is not allowlisted.

This skill is a builder guide. The skill itself is not the runtime boundary; the generated Claude Agent SDK app is.

When to Use

  • The user asks for a browser agent that must stay on an allowlisted site.

  • The user wants to demonstrate prompt-injection or link-following containment.

  • The user asks to build a scraper or browser workflow with domain policy.

  • The user asks for a Claude Agent SDK example first. Keep OpenAI Agents SDK variants out unless requested.

Default Approach

Use the Claude Agent SDK local template:

cp -R skills/safe-browser/templates/claude-agent-sdk /tmp/safe-browser-demo
cd /tmp/safe-browser-demo
npm install
cp ~/Developer/scratchpad/.env .env 2>/dev/null || true
node hn-scraper-demo.mjs

To watch the local browser instead of running headless:

SAFE_BROWSER_HEADLESS=false node hn-scraper-demo.mjs

If Chromium is missing:

npx playwright install chromium

Runtime Shape

User task
  -> coding agent uses this skill to create a demo app
    -> Claude Agent SDK runtime agent
      -> only tool: safe_browser
        -> local Chromium
        -> CDP Fetch.enable({ urlPattern: "*" })
        -> allowlist decision
          -> Fetch.continueRequest for allowed hosts
          -> Fetch.failRequest for blocked hosts

Tool Design Rules

Expose constrained actions, not raw CDP:

  • goto: navigate to an absolute URL through Page.navigate.

  • extract_front_page: return structured data for the Hacker News front page.

  • extract_comments: return structured data for a Hacker News comments page.

  • current_url: report the current page URL.

  • audit_log: return CDP allow/block decisions.

Do not expose { method, params } CDP passthrough. The agent must not be able to call Fetch.disable, create targets, attach new sessions, or run arbitrary shell/browser clients.

For the Hacker News demo, an accessibility snapshot is not necessary. Purpose-built extractors are easier to verify and harder to misuse than a broad page snapshot.

Verification Requirements

Always run the generated demo and show concrete output. A passing demo must prove:

  1. The runtime agent used safe_browser.

  2. It loaded https://news.ycombinator.com.

  3. It extracted at least one front-page story.

  4. It visited an internal HN comments URL.

  5. It attempted an off-domain story URL.

  6. CDP emitted Fetch.requestPaused for that URL.

  7. The firewall answered with Fetch.failRequest.

  8. The current browser URL stayed on news.ycombinator.com.

  9. Artifacts were written: result, audit log, and screenshot.

The template script already performs these assertions.

Notes

  • Default to local Chromium for now.

  • Use Browserbase remote mode only if the user explicitly asks.

  • Treat page content as untrusted. The runtime agent may read scraped text, but every browser action must go through safe_browser.

  • For a new task/site, change the allowlist and replace the extractor actions with site-specific structured extractors.

Files

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Declares allowed tools, Needs Node.js

The author says: Requires Node.js 18+, npm, and a local Chromium (`npx playwright install chromium`). The generated Claude Agent SDK runtime app needs ANTHROPIC_API_KEY.

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Browserbase
Publisher
Browserbase (Official)
Source
browserbase/skills · skills/safe-browser · commit 6811ca3
Licence
MIT License (redistribution allowed)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Browserbase or Browserbase.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download safe-browser.zip