Open source · Rust · MIT / Apache-2.0

Your agent reads prod.
Your users' names stay home.

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.

Claude Code, Cursor, Codex, OpenCode psql, Heroku, Stripe, MCP Fails closed

// the problem

The best context for an agent is real data. That is also the riskiest.

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.

Same value, same token

Jean is PERSON_d86896 in every row and every command. The model can still group, join and spot the duplicate account.

Useful fields stay readable

Ids, amounts, statuses, dates and plans pass through. A Stripe customer's name is masked, a product's name is not.

Real values come back locally

ranon unmask turns the model's answer back into real names, on your machine, from a map that never leaves it.

// three promises

Built to fail on the safe side.

A privacy filter that leaks when it breaks is worse than none. ranon is designed around three rules that the test suite enforces.

Fails closed

If masking cannot run (bad state, invalid rules, a crash), the output is hidden. It is never passed through raw.

Stays on your machine

The token map, its secret salt and the name hashes live in a private local directory. No server, no account, no telemetry.

Writes back what it masked

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

One small binary, three ways to plug it in.

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.

ModeHowCovers
Agent hookranon hook claude as a Claude Code hookShell output of psql, heroku, stripe, plus the MCP tools you match
PATH shimpsql → ranon, first in the agent's PATHAny agent harness, including output redirected to a file
Filterranon psql … or … | ranon maskManual use and scripts
0

JSON documents

Stripe, APIs, MCP tools. Masked by key, with the parent object as context.

1

Tables

Every psql format. Masked by column name; ambiguous rows are hidden, not guessed.

2

Key/value pairs

JSON, Ruby hashes, Rails inspect, YAML-like lines.

3

Patterns

Emails, IBANs, French phone numbers and IP addresses, anywhere.

4

Names in free text

Full names matched against a salted, hashed dictionary built from your users table.

// what the agent reads

Masked where your data actually shows up.

Built-in rules cover common sources. Your own field names go in a local rules file, per source.

SourceWhat the agent reads
psql, heroku runNames, emails, phones, IBANs, addresses and birth dates as tokens; ids, amounts, statuses and dates readable
Stripe, Notion, Slack, MetabaseThe same in JSON, through the CLI or MCP tools
heroku logsEmails 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 textFull 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

One command per agent.

Hooks let ranon mask MCP results in Claude Code and Cursor. Elsewhere it sees shell commands only, and says so.

AgentInstallShell commandsMCP tools
Claude Coderanon init -ghookhook + write-back
Cursorranon init -g --agent cursorrewrittenhook
Codex CLIranon init -g --agent codexPATH shimnot masked
OpenCoderanon init -g --agent opencodePATH shimnot masked
Any otherranon init --agent shimsPATH shimnot masked

// limits

A filter, not a security boundary.

  • It masks results, not queries: a name you type in a where clause is seen by the model.
  • Aliases and computed columns (select email as e, first_name || ' ' || last_name) go through: select columns under their own names.
  • Values outside known columns and patterns, unknown names and lone first names in free text go through.
  • The agent runs as you, so it could read the token map. Real isolation needs a separate user or a sandbox.
Use it as a seatbelt. ranon catches the personal data that routine queries spill into the agent's context. For hard guarantees, give the agent a database role that can only read pseudonymized views. Everything that gets past is listed in the limits doc.

// install & forget

Two commands, then restart your agent.

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

// documentation

Read the details.