Skip to main content
Docker Sandboxes run a coding agent such as Claude Code or Codex in an isolated environment on your machine, with a network policy and a proxy in front of it. The Anchor kit adds a cloud browser to that sandbox: three hosted MCP servers, two agent skills, and API access that never puts your key inside the sandbox.

Install in a click

Open the sbx/anchorbrowser kit on Docker Hub and copy the run command under Apply this mixin to a sandbox.
Or paste the direct kit link into your terminal. Store your key first, as shown in Before you start.
The kit is published on Docker Hub as sbx/anchorbrowser.
Docker Hub page for the sbx/anchorbrowser Sandbox Kit, a mixin from a verified publisher
Tested with 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.
What the kit sets up:

Before you start

Install the sbx CLI. On macOS, use Homebrew. For Windows and Linux, follow the Docker Sandboxes docs.
Create an Anchor key at API Keys and store it once in the Docker Sandboxes secret store on your machine:
Paste the key at the Enter secret: prompt. In a script, pipe it in instead:
To check it is there:
To use a different Anchor key for one sandbox, store it with --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:
Swap 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:
Add the kit when you create the sandbox. sbx kit add cannot attach it to a sandbox that already exists, because the kit declares a credential. It stops with kit "anchorbrowser" declares credentials, which the kit-add recreate flow does not yet wire. Remove the sandbox and create it again with --kit.

Check that it works

Run the smoke test inside the sandbox:
It confirms the key is accepted, creates a session, opens the CDP websocket, calls the hosted MCP endpoint, then ends the session and checks nothing is left running.

The key stays on your machine

Inside the sandbox the variable holds a placeholder, not your key:
The sandbox proxy adds the real 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:
The two skills are linked into ~/.claude/skills as anchorbrowser and anchorbrowser-mcp.
No header and no placeholder are stored in the agent’s config. The registration runs when the sandbox is created and again on every start. The 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:
Claude Code in the sandbox, answering that prompt through the anchor server and ending its session:
Claude Code in a Docker Sandbox returning the title and price of the first three books and confirming the browser session is ended
Start with the 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’s claude, 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:
After that both work. Create the session yourself and pass it in, so 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:
Then install the SDK and the Playwright client in the sandbox:

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:
See what a sandbox is allowed to reach with 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, pass mcp=none:
claude mcp list then shows only the sandbox’s own gateway:

Clean up

  • Anchor sessions. End every session in a finally block. Removing the sandbox does not end a cloud browser; it keeps running and billing until its own timeout. Check with sbx exec anchor-demo curl -s https://api.anchorbrowser.io/v1/sessions/all/status.
  • The sandbox. sbx stop anchor-demo stops it; sbx rm anchor-demo removes it.
  • The key. sbx secret rm anchorbrowser removes 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 ran sbx kit add on an existing sandbox. Create a new sandbox with --kit instead.
  • {"error":"Invalid API Key"} with HTTP 401: the stored key is wrong. The smoke test reports it as FAIL GET /v1/sessions/all/status returned HTTP 401. Run sbx secret ls, look for a sandbox-scoped anchorbrowser entry that overrides the global one, and store the right key again with sbx secret set anchorbrowser. Remove a sandbox-scoped one with sbx secret rm anchorbrowser --sandbox anchor-demo.
  • Connection closed while reading from the driver in Python: Playwright’s driver needs libatomic1. Install it as shown in Drive the browser with Playwright, or use perform_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 with sbx policy approval ls.
  • Claude Code says Not logged in: the agent needs its own login in the sandbox. Use /login or sbx secret set anthropic.
The kit source is in docker/sbx-kits-contrib. See the Sandboxes overview and the MCP server page.