agentscrub: Jarvis Osorio's local-first CLI for secrets and PII in AI agent sessions
By Jarvis Nelson Osorio · November 16, 2026
AI coding agents keep transcripts. Those transcripts are useful — and they often store API keys, cloud credentials and personal data in plain text on disk. agentscrub, the command in Jarvis Osorio's open-source repository agent-session-scrubber, is a local-first Rust CLI that discovers, scans and redacts secrets and PII in AI agent session transcripts. It runs offline, with no accounts and no telemetry.

The facts The current version is 0.1.0, released under the Apache License 2.0, and it requires Rust 1.89+. It is not on crates.io or Homebrew yet, so you install it from GitHub:
git clone https://github.com/JarvisOsorio/agent-session-scrubber.git
cd agent-session-scrubber
cargo install --path .Safety defaults first The design choices are conservative on purpose:
- Dry-run redaction is the default. Nothing is written until you pass --confirm.
- Cursor sessions can be discovered and scanned, but rewrite is refused until SQLite and transcript mutation is proven safe.
- Retention planning exists, but retention.enabled is false by default and retention apply refuses deletion while that flag is off.
- Scan output shows masked values and fingerprints only — never raw secrets.
Jarvis Osorio is also clear about what it is not: it is not a credential revocation service. After a finding, rotate the secret at the provider. Redaction does not erase backups, snapshots or provider-side copies.
Commands - discover — list recognized session files - scan — detect secrets and PII; exits 8 if the scan is incomplete - report — re-render a saved JSON report, or re-scan - scrub — dry-run redaction by default; --confirm to write - verify — post-remediation check - retention status, plan, apply and verify - config — show the effective config
The exit codes are worth knowing, because they make agentscrub scriptable: 0 ok, 1 general, 2 bad args, 3 unsupported, 4 permission, 5 validation or unclean verify, 6 remediation, 7 policy, 8 incomplete scan. The README puts it bluntly: incomplete is not clean.

Supported formats In v0.1, the claude_code and codex adapters read and redact JSONL sessions. The cursor adapter reads JSONL plus the SQLite state.vscdb but rewrite is intentionally disabled. generic_jsonl handles configurable text fields and generic_json handles single JSON documents. Unsupported or malformed files are skipped and reported, never silently modified.
Security posture agentscrub uses no network for scan, scrub or verify. It never logs raw secrets. Writes use an atomic same-filesystem replace, an exclusive lock and a pre-write hash recheck, and symlink targets are refused for modification.
Try it safely The README recommends copying the synthetic fixtures before experimenting — never scrub the originals in-tree. Copy tests/fixtures/claude/session_secrets.jsonl to a temp folder, run discover, scan, scrub, then scrub --confirm, and finally verify with --format json. You should see clean=true and remaining_findings=0.

It pairs naturally with Agent Replay Lab, whose README suggests agentscrub for after-the-fact cleanup of recorded stores. Read more on jarvisosorio.com, in Jarvis Osorio's LinkedIn article "Agent Session Scrubber: Why I Open-Sourced a Sanitization & Pruning Engine for AI Coding Runtimes" (November 14, 2026), and on GitHub.