Hand your Anthropic Managed Agents a full cloud browser
This guide shows how to equip your Managed Agents with browser, search, and fetch tooling to navigate the web. The browse CLI powers your agents to run UI testing, conduct deep document research, fill web forms, and complex browser automations.
npm install browse
One CLI for skills, browser primitives, debugging, and cloud sessions, designed to be driven by AI Agents.
Create an environment with the browse npm package installed. For open-web browser agents, set networking to unrestricted. Use limited networking when you want to scope the agent to specific websites.
Anthropic Console
CLI
SDK
In the Anthropic Console, create a new Managed Agents environment. Add browse as a default npm package and set networking to Unrestricted.
Use ant beta:environments create. The --config flag accepts structured literals; ant beta:environments create --help shows the available flags.
The browse CLI is designed for agents to inspect and operate webpages. It exposes commands like browse click, browse snapshot, browse screenshot, and browse network, and can drive local Chromium, any CDP connection, or Browserbase cloud sessions.
Name the variable BROWSERBASE_API_KEY and set its value to your Browserbase API key. Use limited networking with *.browserbase.com as the allowed host.
Anthropic Console
CLI
SDK
Add BROWSERBASE_API_KEY, paste your Browserbase API key, and choose Limited networking with *.browserbase.com.
ant beta:vaults:credentials create --help exposes the credential command. The environment-variable credential carries the variable name, secret value, and allowed hosts.
If your SDK types do not yet include environment-variable credentials, use the Console or CLI path for this vault step and keep the rest of the SDK flow unchanged.
Create a Managed Agent that knows browse is available in the environment. Keep the system prompt short and let the CLI provide command details through browse --help.
name: browser agentmodel: id: claude-opus-4-8 speed: standarddescription: Runs shell commands to check CLI tools and environment variables.system: You are a browser agent. Use the `browse` CLI to operate a headless Chromium environment. Run `browse --help` to view the commands interface.mcp_servers: []tools: - configs: - name: web_fetch enabled: false - name: web_search enabled: false default_config: enabled: true permission_policy: type: always_allow type: agent_toolset_20260401skills: []metadata: {}
You can use this .yml to configure your agent. Optionally disable native web_fetch and web_search to harness Browserbase’s Fetch and Search APIs via the browse CLI.
Anthropic Console
CLI
SDK
Configure the agent with the browser-agent system prompt and shell tool access.
Use ant beta:agents create. The agent_toolset_20260401 toolset gives the agent shell access, and the environment supplies browse.
AGENT_ID=$(ant beta:agents create \ --name "browser agent" \ --model '{id: claude-opus-4-8, speed: standard}' \ --description "Runs shell commands to check CLI tools and environment variables." \ --system 'You are a browser agent. Use the `browse` CLI to operate a headless Chromium environment. Run `browse --help` to view the commands interface.' \ --tool '{"type":"agent_toolset_20260401","configs":[{"name":"web_fetch","enabled":false},{"name":"web_search","enabled":false}],"default_config":{"enabled":true,"permission_policy":{"type":"always_allow"}}}' \ --transform id --raw-output)
const SYSTEM_PROMPT = "You are a browser agent. Use the `browse` CLI to operate a headless Chromium environment. Run `browse --help` to view the commands interface.";const agent = await client.beta.agents.create({ name: "browser agent", model: { id: "claude-opus-4-8", speed: "standard", }, description: "Runs shell commands to check CLI tools and environment variables.", system: SYSTEM_PROMPT, tools: [ { type: "agent_toolset_20260401", configs: [ { name: "web_fetch", enabled: false }, { name: "web_search", enabled: false }, ], default_config: { enabled: true, permission_policy: { type: "always_allow" }, }, }, ],});console.log(`MANAGED_AGENT_ID=${agent.id}`);
Start a Managed Agents session, attach the environment and vault, then ask the agent to complete a browser task such as:
Please find the price of the Fellow Kettle on Target.com and add it to cart.
Find driving traffic time from SFO to Union Square.
Please run a full E2E test for UI regressions on this preview URL: https://example.com
Please check if Adam Smith is a licensed accountant in California.
Anthropic Console
CLI
SDK
Start a session from the Anthropic Console with the agent, environment, and Browserbase credential vault you created.
Create a session with ant beta:sessions create, then send a user event. Open the stream in a second terminal if you want to watch events as they arrive.
ant beta:sessions:events stream \ --session-id "$SESSION_ID" \ --max-items -1
ant beta:sessions:events send \ --session-id "$SESSION_ID" \ --event '{type: user.message, content: [{type: text, text: "Please find the price of the Fellow Kettle on Target.com and add it to cart."}]}'
const session = await client.beta.sessions.create({ agent: agent.id, environment_id: environment.id, vault_ids: [vault.id], title: "Browserbase quickstart",});const stream = await client.beta.sessions.events.stream(session.id);await client.beta.sessions.events.send(session.id, { events: [ { type: "user.message", content: [ { type: "text", text: "Please find the price of the Fellow Kettle on Target.com and add it to cart.", }, ], }, ],});for await (const event of stream) { if (event.type === "agent.message") { for (const block of event.content) { process.stdout.write(block.text); } } else if (event.type === "agent.tool_use") { console.log(`\n[Using tool: ${event.name}]`); } else if (event.type === "session.status_idle") { console.log("\n\nAgent finished."); break; }}
When the Managed Agent uses Browserbase through browse, the browser session appears in the Browserbase sessions panel. Open the session to watch Live View, inspect logs, and review the recording after the run.