Open source · Apache 2.0 · Built in Gothenburg

Your agent sees the code.
Not your secrets.

ZeroTrace is a local privacy firewall for AI coding agents like Claude Code, Codex, OpenCode and Cursor. It scrubs keys and personal data before they leave your machine — and restores them when responses stream back.

$ install
curl -fsSL https://raw.githubusercontent.com/chuanjin/zerotrace/main/install.sh | sh
agent
Claude Code
raw →
← restored
zerotrace · 127.0.0.1:9000
AES-256-GCM vault
SHA-256 audit chain
masked →
← masked
upstream
Anthropic / OpenAI
on your machinewhat the model sees
sk-ant-api03-9fQx…sk-ant-zt_7c1e4a92b0d3f6e8
anna.lind@acme.seuser_3b9f21c7@zt.local
19850312-4417PNR_a40e1d9c62b7
SE45 5000 0000 0583 9825 7466IBAN_e7f0c2318b5d

Privacy by architecture, not by policy.

01

Deterministic bidirectional masking

High-entropy pseudonyms replace API keys, emails, Swedish Personnummer and IBANs. The same entity always maps to the same pseudonym, so the model can still reason — it just never sees the secret. Streams are unmasked in real time, even across SSE chunk boundaries.

02

Zero-config agent proxy

A drop-in upstream replacement. Point ANTHROPIC_BASE_URL or OPENAI_BASE_URL at 127.0.0.1:9000 and your agent works exactly as before.

03

Tamper-evident audit trail

Every outbound interaction lands in an append-only SHA-256 hash chain, with prompts encrypted locally using AES-256-GCM. `zerotrace verify` detects tampering, reordering, insertion or deletion — offline.

04

Agent guardrails

A doom-loop breaker stops repeated identical failures with HTTP 429 Retry-After. Two-phase budget reconciliation tracks token reservations against real usage and releases budget on failed requests.

Running in under a minute.

One binary, written in Go. No account, no cloud, no telemetry. Your keys and audit log live under ~/.zerotrace.

1 · initialise keys & config
zerotrace init
2 · start the firewall
zerotrace serve
3 · route your agent
export ANTHROPIC_BASE_URL="http://127.0.0.1:9000/anthropic"
claude
4 · verify the audit chain
zerotrace status
zerotrace verify
zerotrace export-compliance

what it protects

Secret keys (sk-ant-…, sk-…, AKIA…, ghp_…), email addresses, Swedish Personnummer in 10 and 12-digit formats, and European IBANs, compact or spaced.

honest boundaries

Pattern matching is defence-in-depth with verifiable logging. It can't guarantee detection of every piece of unstructured confidential text, and it doesn't make an organisation GDPR-compliant on its own.