Quickstart
From a clone of the repository to Claude Code running in the sandbox. Every command here is in the repository's Makefile or the redactproxy binary.
Tested on macOS with Docker Desktop only, with Docker 29.5 and Compose 5.1. The launcher uses the macOS Keychain and needs macvlan networks. Native Linux is untested, Windows is not supported, rootless Docker does not work. See platform support.
Prerequisites#
- macOS with Docker Desktop running.
- Go 1.26 (the module says
go 1.26.0) andmake. - A Claude subscription. An Anthropic API key also works, with a caveat in step 3.
- A clone of the repository.
1. Build the binary#
make build # go build -o bin/redactproxy ./cmd/redactproxy2. Build the images#
make imagesThis builds two images:
redactproxy-proxy:latestfrom the repository'sDockerfile.redactproxy-agent-base:latestfromdeploy/agent.Dockerfile: Node 22, curl, wget, git, openssh-client, python3 and Claude Code 2.1.311. Use your own base image with-agent-baseif the agent needs more tools, kubectl for example.
3. Sign the sandbox in#
bin/redactproxy login- It runs
claude setup-tokenin a container of the agent base image, on your terminal. Claude Code shows a link; sign in and paste the code. - Paste the token it then shows, once. It isn't echoed.
- The launcher stores it in the macOS Keychain: service
redactproxy, accountclaude-oauth-token. It is never written to a file on the host.
This step is optional: a first launch without any credential runs it by itself when you're at a terminal. The sandbox's login is its own. Claude Code's login on your host is not read or changed. The token is valid for one year; run login again when it expires.
The launcher also reads an Anthropic API key from the Keychain account anthropic-api-key (same service). With both present, the subscription token is used. There is no redactproxy command that stores an API key yet.
Whether Anthropic's terms allow a subscription token to be used through a proxy like this is not settled. The risk is yours.
4. Pick a policy#
The policy names the destinations the agent may reach. deploy/default-policy.json allows the public package registries (npm, Yarn, PyPI, the Go proxy, crates.io, RubyGems, Maven, Gradle, NuGet, Packagist) and nothing else. Copy it and add the hosts your task needs:
{
"mode": "default",
"allow": [
"registry.npmjs.org",
"api.stripe.com"
]
}Unknown keys are errors, so a misspelled key can't silently drop a rule. The full reference is on the policy page.
5. Launch#
bin/redactproxy launch -workspace . -policy-file deploy/default-policy.jsonIn order, the launcher:
- Takes Claude's credential from the Keychain (with none, it runs
login), then the store key, creating it on first use. - Refuses to start if this workspace's sandbox is already running, and tells you how to stop it.
- Loads or creates the proxy CA, then scrubs the workspace's secret files, the
-env-fileand any-mountfiles into an overlay of marker copies and stand-ins. - Builds the agent image from the base image with the CA installed in its trust stores.
- Writes the Compose file to the state directory and starts both containers.
- Runs the routes helper, then the self-test, and prints each check. Any failure stops the sandbox.
- Prints the hosts it won't inspect, if your policy has
passthroughentries, then the command to attach.
ready. Use it with: docker compose -p rp-<workspace>-<6 hex> -f ~/.redactproxy/<project>/compose.json exec agent claudeThe project name is rp-, the workspace folder's name and a short hash of its path. The state directory (-state-dir, default ~/.redactproxy/<project>) holds the encrypted store, the encrypted CA and the Compose file.
6. Attach#
Run the command the launcher printed. Claude Code starts in /workspace, with its first-run screens already marked done.
7. Stop#
docker compose -p <project> -f ~/.redactproxy/<project>/compose.json downName the generated Compose file with -f (it is in the state directory; use your -state-dir if you set one). Without it, Compose run from the repository clone would load the clone's own compose.yaml, an old development setup. There is no redactproxy subcommand for this. The store and CA stay in the state directory, so the next launch gives the same values the same markers and stand-ins.
Next steps#
- Give the agent credentials without showing them:
-env-file,-mount host:agent,-ssh-key. See launch flags. - Point it at a cluster: Kubernetes.
- Find values worth declaring:
bin/redactproxy discover -workspace .lists what it finds (source, key, length, never the value). See discover. - Shell completion:
bin/redactproxy completion zsh(orbash) prints a completion script.