/safe-browser
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
$ npx -y skills add browserbase/skills --skill safe-browser --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/safe-browser
Context preview
The summary Claude sees to decide when to auto-load this skill.
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
SKILL.md
safe-browser.SKILL.mdname: safe-browser
description: 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.
compatibility: "Requires Node.js 18+, npm, and a local Chromium (`npx playwright install chromium`). The generated Claude Agent SDK runtime app needs ANTHROPIC_API_KEY."
license: MIT
allowed-tools: Bash, Read, Write, Edit
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 hostsTool 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.
Read more
name: safe-browser description: 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. compatibility: "Requires Node.js 18+, npm, and a local Chromium (`npx playwright install chromium`). The generated Claude Agent SDK runtime app needs ANTHROPIC_API_KEY." license: MIT allowed-tools: Bash, Read, Write, Edit
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 hostsTool 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.
A set of skills for enabling Claude Code to work with Browserbase through browser automation and the official browse CLI.
Repo: browserbase/skills
Other skills on browserbase-skills.
- /agent-experience
Audit the developer experience of a product, SDK, docs site, or SKILL.md by dropping multiple Claude subagents at it with only a tiny task prompt and real tools (WebFetch, Bash, Write). Agents must discover the docs themselves, install deps, ask for credentials if needed, and
Open skill - /autobrowse
Self-improving browser automation via the auto-research loop. Iteratively runs a browsing task, reads the trace, and improves the navigation skill (strategy.md) until it reliably passes. Supports parallel runs across multiple tasks using sub-agents. Use when you want to build or
Open skill - /browser-to-api
Turn a website's observable HTTP traffic into a best-effort OpenAPI 3.1 spec by analyzing a `browser-trace` capture. Use when the user wants to discover/extract API endpoints from a browser session, build an OpenAPI doc from network traffic, or document a third-party site's
Open skill - /browser-trace
Capture a full DevTools-protocol trace of any browser automation — CDP firehose, screenshots, and DOM dumps — then bisect the stream into per-page searchable buckets. Use when the user wants to debug a failed run, audit network/console/DOM activity, attach a trace to an
Open skill - /browser-use-to-stagehand
Migrate browser-use (Python) browser-automation scripts to Stagehand v3 (TypeScript) on Browserbase. Use when the user wants to convert, port, rewrite, or migrate a browser-use Agent script to Stagehand, map browser-use features/APIs to Stagehand primitives
Open skill - /browser
Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Supports remote Browserbase
Open skill

