Policy file
A JSON file, passed with -policy-file, that says where the agent may connect and how markers are put back. It is required. Unknown keys are errors, so a misspelled key can't silently drop a rule.
The shipped default#
deploy/default-policy.json allows the public package registries and nothing else:
{
"mode": "default",
"allow": [
"registry.npmjs.org",
"registry.yarnpkg.com",
"pypi.org",
"files.pythonhosted.org",
"proxy.golang.org",
"sum.golang.org",
"crates.io",
"index.crates.io",
"static.crates.io",
"rubygems.org",
"index.rubygems.org",
"repo.maven.apache.org",
"repo1.maven.org",
"plugins.gradle.org",
"services.gradle.org",
"api.nuget.org",
"repo.packagist.org"
],
"passthrough": [],
"registries": ["services.gradle.org"],
"data_hosts": []
}Keys#
| Key | Type | Meaning |
|---|---|---|
mode | string | "default" (also when empty) or "paranoid". Decides when a marker is put back; see mode. |
allow | list | Destinations the agent may reach. Patterns below. |
passthrough | list | Host patterns whose TLS is tunneled undecrypted, for clients that pin certificates or carry their own roots. No inspection, no put-back, no response scanning. The launcher prints them as "not inspected". |
registries | list | Public package registries besides the built-in ones. Their archives pass unscanned. |
data_hosts | list | Hosts that hold your data. An archive from them too large to decompress and scan (over 64 MiB) is refused instead of streamed. Other binary responses are scanned for known values only, as from any host. |
Allow patterns#
| Pattern | Allows |
|---|---|
example.com | That host on ports 80 and 443 |
*.example.com | Any subdomain, one or more labels deep, on ports 80 and 443 |
db.internal:5432 | That host on one port |
host:* | That host on every port |
10.1.0.0/16:5432 | Addresses in a CIDR range, for connections to IP literals |
The allowlist names real hosts. When the agent only ever sees a hostname's marker, you still write the real name here.
Allowing a port doesn't make the proxy understand what runs on it. Database wire protocols are out of scope: such a connection is a raw tunnel, nothing in it is inspected, and a marker password fails the login.
Never allowed#
Anything not on the allowlist is refused, so loopback, link-local and metadata addresses are unreachable unless your policy allows them. Anthropic's hosts are refused whatever the policy says, so the model is reached only through the redacting LLM endpoint:
anthropic.com *.anthropic.com claude.ai *.claude.ai claude.com *.claude.comA built-in block for loopback, link-local and metadata addresses is in progress. Until then, don't allowlist names that can resolve to them: an allowlisted name is dialled wherever it resolves.
Mode#
| Mode | Put-back |
|---|---|
default | A marker resolves toward any allowlisted host, in the auth, header, url or body position; a body put-back is logged as a warning. On public-surface hosts, only the auth position resolves; a request with a marker elsewhere is refused and queued. |
paranoid | Only bound values resolve, and only in the auth position: a provider key toward its provider (a GitHub token to github.com, a Stripe key to api.stripe.com, an OpenAI key to api.openai.com), or a token toward the host that issued it. Everything else is blocked and queued for approval. |
In both modes personal data is never put back. A real known value leaving in clear is blocked unless the sandbox's own files hold it and it goes to its bound host (auth position) or where you approved it; personal data already in the sandbox's files is only logged. In paranoid mode a kubeconfig's token is not bound to its API server, so its first use waits for approval.
Public-surface hosts#
Services where a request body can become public. Only the auth position is put back there, so a request that pastes a marker into a gist or a chat message is refused and queued:
github.com *.github.com *.githubusercontent.com gist.github.com
gitlab.com *.gitlab.com bitbucket.org *.bitbucket.org
slack.com *.slack.com discord.com *.discord.com discordapp.com *.discordapp.com
npmjs.org *.npmjs.org npmjs.com *.npmjs.com
pypi.org *.pypi.org files.pythonhosted.org
docker.io *.docker.io docker.com *.docker.com
s3.amazonaws.com *.s3.amazonaws.com s3.*.amazonaws.com *.s3.*.amazonaws.com s3-*.amazonaws.com
pastebin.com *.pastebin.com paste.ee hastebin.com webhook.site *.webhook.site
requestbin.com *.requestbin.com *.pipedream.net ngrok.io *.ngrok.io *.ngrok-free.app
transfer.sh file.io 0x0.stBuilt-in package registries#
Archives from these pass unscanned. Add others with registries.
registry.npmjs.org registry.yarnpkg.com files.pythonhosted.org pypi.org
proxy.golang.org sum.golang.org pkg.go.dev
crates.io static.crates.io index.crates.io
rubygems.org *.rubygems.org
repo.maven.apache.org repo1.maven.org plugins.gradle.org
registry-1.docker.io production.cloudflare.docker.com auth.docker.io
deb.debian.org security.debian.org archive.ubuntu.com security.ubuntu.com ports.ubuntu.com
dl-cdn.alpinelinux.org packages.microsoft.com nuget.org api.nuget.org
repo.anaconda.com conda.anaconda.org hex.pm repo.hex.pm packagist.org repo.packagist.orgBeing a registry doesn't put a host on the allowlist: list it under allow as well.
Examples#
A Kubernetes cluster#
{"allow": ["kubernetes.docker.internal:6443"]}Docker Desktop's API server, reachable from the proxy container. See Kubernetes.
A paranoid run against one API#
{
"mode": "paranoid",
"allow": ["registry.npmjs.org", "api.stripe.com"]
}A Stripe key is bound to api.stripe.com by a provider rule, so its marker is put back there, in the Authorization header. A request with any other marker is refused and queued.