ranon sits between your coding agent and the commands it runs. Names, emails, IBANs and addresses become stable pseudonyms before the model sees them. The agent still joins, counts and debugs. The personal data never leaves your machine.
$ psql -c "select * from users limit 3"
id | first_name | last_name | email | plan ----+------------+-----------+--------------------+------ 42 | Jean | Dupont | jean@example.com | pro 43 | Marie | Martin | marie@example.com | free 44 | Jean | Petit | jpetit@example.com | pro
id | first_name | last_name | email | plan ----+---------------+---------------+--------------+------ 42 | PERSON_d86896 | PERSON_55fc2c | EMAIL_d2f401 | pro 43 | PERSON_1b7e09 | PERSON_c40a3f | EMAIL_7a91ce | free 44 | PERSON_d86896 | PERSON_e2f58b | EMAIL_93b0d4 | pro
// the problem
Coding agents are most useful when they can query a read replica, open a production console or call an API. That output is full of customers: names, emails, phone numbers, bank details. Every line goes to a model provider. ranon lets you keep the access and drop the exposure.
Jean is PERSON_d86896 in every row and every command. The model can still group, join and spot the duplicate account.
Ids, amounts, statuses, dates and plans pass through. A Stripe customer's name is masked, a product's name is not.
ranon unmask turns the model's answer back into real names, on your machine, from a map that never leaves it.
// three promises
A privacy filter that leaks when it breaks is worse than none. ranon is designed around three rules that the test suite enforces.
If masking cannot run (bad state, invalid rules, a crash), the output is hidden. It is never passed through raw.
The token map, its secret salt and the name hashes live in a private local directory. No server, no account, no telemetry.
In Claude Code, when the agent posts to Notion or Slack, tokens become real values again just before the call, and you approve it.
// how it works
Inspired by rtk: ranon works as an agent hook, a command proxy or a plain stdin filter. Every output then goes through five passes, from the most structured to the least.
| Mode | How | Covers |
|---|---|---|
| Agent hook | ranon hook claude as a Claude Code hook | Shell output of psql, heroku, stripe, plus the MCP tools you match |
| PATH shim | psql → ranon, first in the agent's PATH | Any agent harness, including output redirected to a file |
| Filter | ranon psql … or … | ranon mask | Manual use and scripts |
Stripe, APIs, MCP tools. Masked by key, with the parent object as context.
Every psql format. Masked by column name; ambiguous rows are hidden, not guessed.
JSON, Ruby hashes, Rails inspect, YAML-like lines.
Emails, IBANs, French phone numbers and IP addresses, anywhere.
Full names matched against a salted, hashed dictionary built from your users table.
// what the agent reads
Built-in rules cover common sources. Your own field names go in a local rules file, per source.
| Source | What the agent reads |
|---|---|
| psql, heroku run | Names, emails, phones, IBANs, addresses and birth dates as tokens; ids, amounts, statuses and dates readable |
| Stripe, Notion, Slack, Metabase | The same in JSON, through the CLI or MCP tools |
| heroku logs | Emails and IP addresses in request parameters |
| Data files, browser pages | .csv, .json, .log files read by the agent; source code and screenshots are left as they are |
| Free text | Full names of people in your users table, and of anyone ranon already masked in a column (a Slack author, a Stripe customer) |
// works in your agent
Hooks let ranon mask MCP results in Claude Code and Cursor. Elsewhere it sees shell commands only, and says so.
| Agent | Install | Shell commands | MCP tools |
|---|---|---|---|
| Claude Code | ranon init -g | hook | hook + write-back |
| Cursor | ranon init -g --agent cursor | rewritten | hook |
| Codex CLI | ranon init -g --agent codex | PATH shim | not masked |
| OpenCode | ranon init -g --agent opencode | PATH shim | not masked |
| Any other | ranon init --agent shims | PATH shim | not masked |
// limits
// install & forget
Linux or macOS, Rust 1.88+. --dry-run shows what changes before writing it, --uninstall removes it.
$ cargo install --git https://github.com/ludovicl/ranon $ ranon init -g # Claude Code; other agents: --agent cursor|codex|opencode $ ranon doctor # checks binary, rules, state and hooks