Install in a click
Open the
sbx/anchorbrowser kit on Docker Hub and copy the run command under Apply this mixin to a sandbox.sbx/anchorbrowser.

sbx 0.55.0, kit 0.1.0, Claude Code 2.1.335, Codex 0.173.0, the Anchor Python SDK 1.0.1 and the Anchor TypeScript SDK 1.0.0.
What you’re integrating
Anchor kit in a Docker Sandbox → Anchor Cloud. The agent and its code run in the sandbox. Chromium runs as a managed Anchor cloud session, reached over HTTPS and CDP.- Docker Sandboxes stay the agent runtime: the agent edits files, installs packages and runs commands there.
- Anchor stays the remote browser: stealth, proxies, live view and session lifecycle.
- Do not launch a browser inside the sandbox.
Before you start
Install thesbx CLI. On macOS, use Homebrew. For Windows and Linux, follow the Docker Sandboxes docs.
Enter secret: prompt. In a script, pipe it in instead:
--sandbox after you create that sandbox. It takes priority over the global one there:
Create a sandbox with the kit
Pass the kit with--kit when you start the agent. Run this from your project folder:
claude for codex or shell. The kit picks up the stored anchorbrowser secret on its own.
To create the sandbox without attaching to the agent, use sbx create with the same flags and a workspace path:
Check that it works
Run the smoke test inside the sandbox:The key stays on your machine
Inside the sandbox the variable holds a placeholder, not your key:anchor-api-key header to every request to api.anchorbrowser.io. So curl, the SDKs and the MCP clients all authenticate without holding the key, and an agent that prints its environment or reads its config files cannot leak it.
The cdp_url a session returns inside the sandbox carries no API key either.
Use Anchor from the agent with MCP
The kit registers three hosted servers:- Claude Code
- Codex
- Other agents
~/.claude/skills as anchorbrowser and anchorbrowser-mcp.anchor server lists 29 tools from inside the sandbox, among them perform_web_task and get_web_task_status.
Then ask the agent in plain English, for example:
anchor server and ending its session:

anchor server. Its perform_web_task tool runs the whole task on Anchor’s side and is the shortest path to a result.
The agent itself still needs its own login inside the sandbox. If Claude Code answers Not logged in, sign in with /login, or store its key on your machine with sbx secret set anthropic.
Call the REST API
curl works with no header:
Use the Python SDK
Docker’sclaude, codex and shell sandboxes ship Python and pip. Install the SDK in the sandbox:
Anchorbrowser() takes no key: it reads the placeholder from the environment and the proxy does the rest.
Run a web task
This version creates a session, runs the task on Anchor’s side, and ends the session. It needs nothing beyond the SDK.task.py
Drive the browser with Playwright
client.agent.task(...) and Playwright both start Playwright’s local driver, which needs the libatomic1 system library. The stock sandbox images do not include it, and the driver stops with Connection closed while reading from the driver. Install it once as root:
finally can always end it:
agent_task.py prints the three books, and pw.py prints:
Called without
session_id, client.agent.task(...) starts its own browser session. If the call then fails, for example because the driver cannot start, that session keeps running and nothing in your code holds its ID. Pass a session you created, as above.Use the TypeScript SDK
The stock sandboxes have no Node.js. Add Docker’s Playwright kit next to the Anchor kit; it brings Node.js 24:Network
The kit allows five hosts on top of the sandbox’s own policy:live.anchorbrowser.io is left out on purpose. You open the live view in your own browser, not from the sandbox.
The agent can still browse any site, because pages load in Anchor’s browser. A direct request from the sandbox to a host that is not allowed is held for your approval:
sbx policy ls anchor-demo.
Leave the agent’s MCP config alone
To get the credential, network policy, skills and smoke test without registering the MCP servers, passmcp=none:
claude mcp list then shows only the sandbox’s own gateway:
Clean up
- Anchor sessions. End every session in a
finallyblock. Removing the sandbox does not end a cloud browser; it keeps running and billing until its own timeout. Check withsbx exec anchor-demo curl -s https://api.anchorbrowser.io/v1/sessions/all/status. - The sandbox.
sbx stop anchor-demostops it;sbx rm anchor-demoremoves it. - The key.
sbx secret rm anchorbrowserremoves it from your machine. The kit writes nothing else to the host.
Troubleshooting
anchorbrowser-smoke: command not found: the sandbox was created without the kit. Remove it and create it again with--kit docker.io/sbx/anchorbrowser:latest.kit "anchorbrowser" declares credentials, which the kit-add recreate flow does not yet wire: you ransbx kit addon an existing sandbox. Create a new sandbox with--kitinstead.{"error":"Invalid API Key"}with HTTP401: the stored key is wrong. The smoke test reports it asFAIL GET /v1/sessions/all/status returned HTTP 401. Runsbx secret ls, look for a sandbox-scopedanchorbrowserentry that overrides the global one, and store the right key again withsbx secret set anchorbrowser. Remove a sandbox-scoped one withsbx secret rm anchorbrowser --sandbox anchor-demo.Connection closed while reading from the driverin Python: Playwright’s driver needslibatomic1. Install it as shown in Drive the browser with Playwright, or useperform_web_task.node: command not found: the stock images have no Node.js. Add the Playwright kit as shown in Use the TypeScript SDK.Approval required for <host>: the sandbox tried to reach a host outside its policy. Review it withsbx policy approval ls.- Claude Code says
Not logged in: the agent needs its own login in the sandbox. Use/loginorsbx secret set anthropic.

