Your never reach the model.
A local hook scrubs every tool result before your coding assistant reads it. It catches vendor keys, the secrets you teach it from your .env, and, if you turn it on, random-looking values.
$ curl -sSL https://raw.githubusercontent.com/svn-arv/redacted/main/install.sh | sh
Nobody has to run a dangerous command.
The model knows not to run cat .env. Keys get in through ordinary output instead.
They ride along in ordinary output.
A committed key in git diff. A token in a log line. A stack trace that dumps the environment on its way out.
Some commands exist to print them.
heroku config, kubectl get secret, aws secretsmanager get-secret-value. Running them is the job, not a mistake.
Command guards read the wrong thing.
Deny lists and model judgment inspect the command string. An npm script, a make target, or a proxy CLI changes the string. The output is unchanged.
Once a secret is in context it is in the transcript on disk and in every request that follows. redacted does not judge commands. It scrubs the output, whatever produced it.
Three tiers, run in this order.
Signature and learned hits name what matched, as in [REDACTED:aws_access_key ...0001]. Keyed and entropy hits keep the key instead, as in KEY= [REDACTED ...abcd].
Vendor signatures
AWS, GitHub, Stripe, OpenAI, Anthropic, Slack, Twilio and more, matched on each key's prefix and shape. Add your own in engine.yml.
Learned secrets
redacted init learns the values you pick from your .env and stores only a sha256, a length and, for prefixed keys, a shape. It replaces the keyword rules of 0.7.
Entropy heuristic
Off by default. When enabled, a KEY=value pair is redacted if the value runs 16 to 128 characters, mixes lowercase, uppercase and digits, and reaches this entropy.
Some of the signatures.
The README lists all 46 patterns. Hover or tap a block to reveal it.
What it will not do.
Reach the network
A single Rust binary that runs on your machine. No calls out, no telemetry, no account.
Fail open
If the hook errors, the output is withheld rather than passed through raw.
Store a value
Stats keep a timestamp, the tool name and per-pattern counts. Learned secrets are stored as a sha256 and a length. Never the text itself.
Leave you guessing
The last four characters stay, so the two rotated AWS keys above read as ...0001 and ...0002 without exposing either.
Install, then init.
redacted init learns secrets from your .env, shows the config and asks before writing it, then registers the PostToolUse hook. Safe to run again.
$ curl -sSL https://raw.githubusercontent.com/svn-arv/redacted/main/install.sh | sh
$ brew tap svn-arv/tap $ brew install redacted
$ cargo install redacted-cli
$ redacted init
Add --local to register the hook for this project only, or --env PATH to pick the env file.