Run a coding agent in a sealed sandbox without putting real credentials on the machine.
Airlock routes the sandbox's outbound traffic through a default-deny proxy. The agent receives placeholders; the proxy adds or substitutes credentials only for destinations named in policy. After the run, Airlock destroys the sandbox and writes a self-contained HTML record containing the transcript, egress decisions, tool calls, and filesystem changes.
Status: early prototype. The Claude + Sprites path and HTML records work end to end. Airlock cannot yet reattach after the CLI exits, and Sprites is the only cloud provider wired up.
- A YAML policy defines every reachable host and where credentials may go.
- Airlock provisions a fresh sandbox, installs the agent, and seals egress to the broker.
- The broker allows or denies each request and injects credentials only when a rule matches.
- Airlock writes
airlock-<run>.htmland destroys the sandbox.
Denied requests are part of the record, including traffic the agent or its harness attempted without mentioning it in the transcript.
Airlock requires Elixir 1.18 or later.
mix deps.get
mix escript.build
./airlock check priv/policies/example.yamlcheck parses a policy, shows the compiled network and credential rules, and
reports missing environment variables.
allow:
- api.anthropic.com
- example.com
credentials:
- host: api.anthropic.com
scheme: substitute
placeholder: PLACEHOLDER-ANTHROPIC
from: env:ANTHROPIC_API_KEY
unmatched: denySee priv/policies/example.yaml for bearer, basic,
and path-scoped credential rules.
A cloud sandbox must be able to reach the local broker. For a development run, bind the broker to a known port and expose that port with a raw TCP tunnel:
export SPRITES_TOKEN=...
export ANTHROPIC_API_KEY=...
ngrok tcp 14322
./airlock run policy.yaml "fetch https://example.com" \
--broker-port 14322 \
--broker-host 4.tcp.ngrok.io:19482Replace --broker-host with the address printed by ngrok. An HTTP tunnel will
not work because the broker handles CONNECT traffic.
Security: the broker connection is currently plaintext, so a public tunnel exposes its session token in transit. Treat tunneling as a development setup and use short-lived, narrowly scoped credentials.
The default tool-permission mode is ask. Because no human is attached to
answer, requests are denied and recorded; pass --permissions auto_allow for an
unattended run that may use tools.
If the CLI is killed before cleanup, the sandbox may survive:
./airlock boxes
./airlock reap --yesreap destroys every Airlock-created box in the selected provider account.
Run ./airlock help for all runtimes, providers, and options.
CLAUDE.md— product and architecture briefPLAN.md— milestones and design decisionsNOTES-M0.mdandNOTES-M2.md— implementation findings
Apache-2.0. See LICENSE.