I built a local scrubber because agent sessions keep secrets
Jarvis Nelson OsorioI used to think of an AI coding session as something that lived in a window. Then I started looking at the files the tools leave behind.
They are ordinary files. JSONL transcripts. Sometimes a SQLite database. They are also, often, a second copy of whatever you pasted or whatever the agent called: API keys, cloud credentials, names, emails. Nobody set out to build a secret store. The session logger just wrote down what happened.
I'm Jarvis Nelson Osorio, a tech entrepreneur and AI builder. I published agentscrub because I wanted a way to deal with those files without uploading them to anyone. It is a Rust command-line tool. It runs entirely offline. There is no account and no telemetry. You point it at a folder, it discovers session files it recognizes, it scans for secrets and personal data, and — if you ask it to, and only after a dry run — it redacts the formats it knows how to rewrite safely.
The important word in that sentence is safely. For Claude Code and Codex JSONL, redaction is supported. For Cursor, discovery and scan work, and rewrite is refused. I would rather print a clear refusal than mutate a vendor database I cannot yet guarantee. Deleting old sessions through a retention command is also flagged off by default.
When the tool reports a finding, it never prints the raw secret. You see a masked value and a fingerprint. When it writes, it uses an exclusive lock and an atomic replace on the same filesystem, and it will not follow a symlink. If a file is malformed, it is skipped and reported, not "fixed" in silence.
I also need to be plain about what the tool is not. It will not revoke a key for you. If a credential appeared in a transcript, you rotate it at the issuer. Redaction does not reach your backups, your snapshots, or any copy a provider already has. Install it from the GitHub repository; it is not on crates.io yet.
This is unglamorous work, and that is the point. Trust and safety for agents does not start with a policy document. It starts with the text already sitting in a home directory. agentscrub is Apache 2.0, and it is part of a small November set of open-source tools I shipped for memory, MCP scanning, replay, outcome checks and agent-to-agent deal flow.
If you only do one thing after reading this, copy a fixture from the repo, run discover, scan, a dry-run scrub, then verify. See a clean report on a file you control before you ever point the tool at ~/.claude.
The canonical version of this story is https://jarvis-nelson-osorio.pages.dev/blog/jarvis-osorio-agentscrub-agent-session-scrubber/. The rest of the tools live at https://jarvisosorio.com/open-source/.