instabox-sdk 0.5.15, @insforge/instabox-sdk 0.11.0, the Anchor Python SDK 1.0.1 and the Anchor TypeScript SDK 1.0.0.
What you’re integrating
Anchor SDK on an InstaBox machine → Anchor Cloud. The machine runs your agent and its code. Chromium runs as a managed Anchor cloud session, reached over HTTPS and CDP.- InstaBox stays the code runtime: the agent edits files, installs packages and runs commands there.
- Anchor stays the remote browser: stealth, proxies, live view and session lifecycle.
- The Anchor key is an InstaBox Org Secret. The machine holds a placeholder, and InstaBox’s outbound proxy swaps in the real key on requests to
api.anchorbrowser.io. - A network allowlist limits the machine to Anchor’s two hosts.
Before you start
Install theinstabox CLI and sign in by following the InstaBox quick start. Check it works:
await, so set "type": "module" in your package.json.
Save your Anchor key as an Org Secret
Create an Anchor key at API Keys. Save it as an Org Secret that may only go to Anchor’s API host. With the key inANCHORBROWSER_API_KEY in your shell:
ANCHORBROWSER_API_KEY: the Anchor Python SDK reads it on its own, and the TypeScript samples pass it to the SDK.
Saving a Secret needs a signed-in owner or admin. An API key of a personal workspace is refused with
403 missing_scope and the hint sign in with instabox login, or use an API key of a workspace.Prepare a snapshot once
Install the Anchor SDK and the Playwright client on one machine, save it as a snapshot, and start every later machine from that snapshot.- The machine is ready in seconds. In testing, a new machine ran 3.7 seconds after the create call. The Python install took 6 seconds and the Node.js install 4.
- The snapshot takes a few minutes. The save took about 3.5 minutes. You do it once.
- The install is small.
playwright(Python) andplaywright-core(Node.js) are only the client library that speaks CDP. You do not runplaywright install, because the browser lives on Anchor. - Python needs a virtual environment. The machine runs Debian 13, whose system
piprefuses to install packages outside one. - The free plan runs one machine at a time. That is why the commands delete
anchor-prepbefore the next step. The snapshot is kept.
Create a locked machine from the snapshot
Create the machine your agent works on.--secrets all gives it the workspace’s proxy Secrets, and --allow-domain limits where it can connect:

The InstaBox SDKs create machines, but they do not take a Secret selection or a network policy at create. Create the machine with the CLI, as above, and use the SDK to run code on it.
The key stays out of the machine
Inside the machine the variable holds a placeholder that starts withibsec_, not your key:
curl, the SDKs and MCP clients on the machine all authenticate without holding the key, and an agent that prints its environment or reads its config files cannot leak it. The key is not in the snapshot either.
The cdp_url a session returns carries no API key. It holds a session ID and a session token, which is why connect.anchorbrowser.io needs no Secret.
Run a web task on the machine
Describe the goal in plain English and let Anchor’s agent drive the browser. The script writes a small program to the machine and runs it there.- The machine wakes up by itself. An idle machine pauses after 30 minutes.
ensure_runningandSandbox.connectresume it. - Home is
/data/home. The Python SDK writes relative paths there. The TypeScript version runs in/data/home/anchor, wherenpminstalled the packages. - The session is created first. The task runs on a session the script created, so
finallycan always end it, also when the task fails. Anchorbrowser()takes no key. It reads the placeholder from the environment and the proxy does the rest.
Drive the browser yourself with Playwright
For step-by-step control, create an Anchor session and connect Playwright to it over CDP from the machine.Watch the browser
Open thelive view URL in your own browser while the script runs, or open the session in the Anchor dashboard. This is the Anchor session streaming directly, so the machine needs no desktop, tunnel or public port for it.


What the allowlist blocks
The machine reaches Anchor and nothing else. A name that is not on the list does not resolve:live.anchorbrowser.io is opened by the person watching, not by the machine, so it does not need to be on the list.
To install more packages later, open the network, install, and lock it again. Both changes take effect at once:
Give the coding agents on the machine Anchor’s MCP server
The default template has Claude Code, Codex and OpenCode installed. Register Anchor’s hosted MCP server once, with the placeholder in the header:Clean up two lifecycles
There are two things to end, and ending one does not end the other.- The Anchor session. End it in a
finallyblock inside the script that runs on the machine. Pausing or deleting the machine does not end a cloud browser; it keeps running and billing until its own timeout. - The InstaBox machine. It pauses by itself after 30 idle minutes. Delete it with
instabox rm --yes anchor-demowhen you are done. The snapshot stays until you delete it withinstabox snapshot rm anchor-sandbox --yes. - Set Anchor’s
timeout.max_durationandtimeout.idle_timeout, in minutes, as a safety net for a machine that stops mid-run. See Session Timeout. - Reuse one Anchor session for a whole agent run instead of creating one per page.
instabox secrets show anchor-demo also counts how many requests the proxy added the key to. After the runs on this page it read 10 requests, 0 denied.
API key
Each customer brings their own Anchor key as an Org Secret of their InstaBox workspace. Anchor bills them directly for browser usage; InstaBox bills for the machine.Troubleshooting
403 missing_scopewhen you save the Secret: you are using an API key of a personal workspace. Sign in withinstabox loginand runinstabox secrets setagain.401from Anchor on the machine: the machine has no Secret selected, or the Secret has another name. Runinstabox secrets show anchor-demo. Create the machine with--secrets all, and save the Secret asANCHORBROWSER_API_KEY.error: externally-managed-environmentfrompip: Debian’s system Python refuses installs outside a virtual environment. Create one withpython3 -m venv ~/anchor-env, as the setup does.pipornpmcannot resolve its registry: the allowlist blocks it. Open the network, install, and lock it again, as shown in What the allowlist blocks. Better, install in the snapshot.- The command stops after 60 seconds: that is the default command timeout. Pass
timeout(Python) ortimeoutMs(TypeScript), as the samples do. A web task can take a few minutes.

