redact-proxy pre-release
Docs menu

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:

deploy/default-policy.json
{
  "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#

KeyTypeMeaning
modestring"default" (also when empty) or "paranoid". Decides when a marker is put back; see mode.
allowlistDestinations the agent may reach. Patterns below.
passthroughlistHost 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".
registrieslistPublic package registries besides the built-in ones. Their archives pass unscanned.
data_hostslistHosts 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#

PatternAllows
example.comThat host on ports 80 and 443
*.example.comAny subdomain, one or more labels deep, on ports 80 and 443
db.internal:5432That host on one port
host:*That host on every port
10.1.0.0/16:5432Addresses 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.

Non-HTTP ports

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:

built in
anthropic.com  *.anthropic.com  claude.ai  *.claude.ai  claude.com  *.claude.com
In progress

A 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#

ModePut-back
defaultA 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.
paranoidOnly 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:

built in
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.st

Built-in package registries#

Archives from these pass unscanned. Add others with registries.

built in
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.org

Being a registry doesn't put a host on the allowlist: list it under allow as well.

Examples#

A Kubernetes cluster#

policy.json
{"allow": ["kubernetes.docker.internal:6443"]}

Docker Desktop's API server, reachable from the proxy container. See Kubernetes.

A paranoid run against one API#

policy.json
{
  "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.