This keeps happening
AUG 2025 · NX
Malicious Nx releases on npm made local AI coding CLIs hunt for secrets, then posted them to public GitHub repos.
sourceMAR 2026 · GITGUARDIAN
28.6M new secrets leaked on public GitHub in 2025; Claude Code co-authored commits leaked at about twice the base rate.
sourceAUG 2026 · ZENITY LABS
Copycat agent skills on the skills.sh registry were later changed to make agents collect SSH keys and cloud credentials.
sourceNOV 2026 · GITGUARDIAN
Claude Code keeps approved commands, inline secrets included, in a local file. Many of those files ended up on GitHub.
sourceOCT 2025 · LEGIT SECURITY
Hidden text in a pull request could make GitHub Copilot Chat leak secrets and private code. Since fixed.
sourceJUL 2025 · TRACEBIT
A poisoned README could make Gemini CLI silently send the user's environment variables to a server. Since fixed.
sourceNOV 2025 · PROMPTARMOR
Hidden text on a web page could steer Google's Antigravity agent into reading .env and sending the credentials out.
sourceMAY 2025 · INVARIANT LABS
A planted public issue could steer an agent using GitHub's MCP server into leaking private repo data into a public PR.
sourceJAN 2025 · WIZ RESEARCH
DeepSeek left a database open to the internet with over a million log lines, including chat history and API keys.
sourceMAY 2025 · OPENAI
A US court made OpenAI keep ChatGPT and API output logs, deleted chats included, from May to late September 2025.
source
Public reports. Links go to the sources.
redact-proxy lets it use them without seeing them. So you can let it run.
A scripted agent session as the model sees it. The agent reads .env and gets markers, and a stand-in for the address. A request to api.stripe.com, which is allowlisted and is the key's own host, carries the key's marker; the proxy puts the real key in the Authorization header. A request that posts .env to an unknown host is dropped because the host is not on the allowlist.
Illustration. Example values.
Same files. Two views.
On your disk, the real values, which only the proxy also holds. Inside the sandbox, what the agent and the model work with.
The sandbox never mounts your folder. It gets a copy of the workspace, and of the credential files you hand over, with every secret replaced. Your files stay as they are.
Values a program only passes along become markers. Values a program parses (certificates, keys, addresses, host names) become working stand-ins, so kubectl get nodes still answers.
On your disk
# .env STRIPE_KEY=sk_live_51Mz9QeLkT2vXw8RbNcYd4Hu DB_PASSWORD=hunter2-Winter-2019! DB_HOST=10.0.4.17 BILLING_API=https://billing.corp.internal/v2 ONCALL=[email protected] # ~/.kube/config server: https://k8s.corp.internal:6443 certificate-authority-data: LS0tLS1CRUdJTi…k3Qa client-certificate-data: LS0tLS1CRUdJTi…8fWe client-key-data: LS0tLS1CRUdJTi…Jx0c
Inside the sandbox
# .env STRIPE_KEY=__redacted_apikey_8eb80264f15a26eaa6875de564eb49e1__ DB_PASSWORD=__redacted_password_57dc4955e32132665df07657654a54df__ DB_HOST=198.19.77.4 ← stand-in: parses, connects BILLING_API=https://h8fa466205c371928.redacted.test/v2 ONCALL=__redacted_email_5a3a3f306dfa535bcf2b168a8fa2385b__ # /home/sandbox/.kube/config server: https://h1ab0c5889561f699.redacted.test:6443 # certificate-authority-data: left out client-certificate-data: LS0tLS1CRUdJTi…Q2xR ← stand-in: dummy pair client-key-data: LS0tLS1CRUdJTi…v7Ag ← stand-in: dummy pair
- marker: typed, no value inside
- stand-in: valid format, not your value
- real value: proxy only
What replaces a secret
A marker, or a stand-in that works.
Marker · most values
Passwords, API keys, tokens, personal data. The type says what was removed, so the model still knows it holds an API key and not a password. The value is not in it.
The ID is a keyed HMAC-SHA256 of the value, cut to 128 bits: the same value gets the same marker every time, and a short password can't be brute-forced back out of it. Plain ASCII, so it survives a shell, a URL, a header or JSON.
Stand-in · what programs parse
A program that parses an address or checks a key pair breaks on a marker. So these get working fakes instead:
- IP address → an address from a reserved range. A connection to it goes to the real one.
- Host name → a name under
.redacted.testthat resolves to the real host. - JWT → a token that still decodes, its secrets redacted.
- Client certificate + key → a dummy pair signed by the proxy's CA. Upstream, the proxy presents your real certificate, only to the server it belongs to.
The same value gets the same stand-in on every launch.
One way out.
Two containers, a network namespace each. The agent's only network leads to the proxy, and every packet it sends arrives there, whatever address it dials.
The agent runs in a sandbox and holds only markers. Every request goes through the proxy.
- 01 · before the session
Copy with markers
The sandbox gets a copy of your workspace and credential files with markers and stand-ins. The real values go into the proxy's encrypted store.
- 02 · every model call
Markers only
The sandbox holds no real values, so the model gets none. A known value that still shows up in clear, base64 and escaped forms included, goes out as its marker. You get an alarm.
- 03 · at the network edge
Put back by destination
A marker turns real only on the way to the host its value belongs to, in an auth field. Anything else waits for your approval on the console.
- 04 · on the way back
Redact the response
A token a host hands out mid-session becomes a marker on arrival, and goes back only to that host. A newly learned value re-redacts the text around it.
Built to be left alone.
Long unattended runs need a boundary that holds without you watching, and tools that keep working inside it.
One way out
Agent and proxy share only an internal macvlan network. A helper points the agent's default route at the proxy; with no capabilities, the agent can't change it. Before that, it reaches nothing.
Network →DNS can't carry data out
Every lookup gets a synthetic address from 198.18.0.0/16 and nothing is forwarded. The gateway maps the address back to the name.
DNS sinkhole →Allowlist on the real destination
Every connection is checked by where it really goes; anything not on your policy is refused. Loopback and cloud metadata addresses are never dialled, whatever the policy says.
Policy →Any model, one door
Anthropic, OpenAI, Gemini and others, or a Claude subscription. The sandbox holds the key's marker; the proxy adds the real key toward that provider only.
Model endpoint →Put back by rule
A value goes back only to the host it belongs to, in an auth field. Anything else waits for your yes on a live console. Personal data is never put back.
Put-back →kubectl works
Kubeconfig certificates get stand-ins; the real client certificate is presented upstream. Secrets come back as markers. Watches, logs -f and exec stream, redacted line by line.
Git without .git
The agent's git is a shim. The proxy runs real git on your repository and redacts the output. Commits land in your repo. Push and pull go through the proxy, with your token.
Git →Keys stay in the proxy
SSH keys stay there; the agent gets a list-and-sign socket. AWS requests and service-account tokens are signed again with the real key as they leave. Model keys are never written to disk.
Signing →Checked at every launch
A self-test tries to get around the proxy: direct DNS, Docker's own resolver, IP literals, Anthropic directly, UDP, IPv6. One failure stops the sandbox.
Self-test →Where it stops.
No tool stops everything. Here is where this one stops.
Holds
- Fails closed
- What the proxy can't read, it refuses.
- Markers only
- The sandbox holds no real values. A known one in clear raises an alarm.
- Personal data stays out
- Emails, phone and card numbers are never put back.
- No way around it
- The agent can't route traffic past the proxy.
Does not stop
- What slips past all three
- It checks common secret files and folders, known formats (base64 too) and your own list. What none of them catch stays real.
- Hosts you allowlist
- If they run code, they can be told to leak. Keep the list short.
- Hosts you mark uninspected
- SSH and other non-HTTP traffic passes there unread. Elsewhere it is refused.
- Some tools
- Databases don't work. gRPC,
kubectl cpandport-forwardneed an uninspected host. - Your source code
- The model still sees it. That's how it works.
macOS with Docker Desktop, and Linux.
Windows is not supported. Rootless Docker doesn't work.
Run it.
Build the binary and the two images, export a model key, launch in your project. You need Docker, Go 1.26 and OpenCode.
Full quickstart# bin/redactproxy
make build
# the proxy and sandbox images
make images
# or OPENAI_API_KEY, GEMINI_API_KEY, …
export ANTHROPIC_API_KEY=…
# in your project; no flags needed
bin/redactproxy launch