agentscrub, a local-first CLI for agent session secrets and PII by Jarvis Osorio

agentscrub is a local-first Rust CLI by Jarvis Osorio that discovers, scans and redacts secrets and PII in AI agent session transcripts. It runs offline, with no accounts and no telemetry. The GitHub repository is agent-session-scrubber.

View the GitHub repository

The current version is 0.1.0, released under the Apache License 2.0. It requires Rust 1.89+. It is not on crates.io or Homebrew yet — install from the GitHub repository.

Dry-run redaction is the default. Cursor sessions can be discovered and scanned, but rewrite is refused until SQLite/transcript mutation is proven safe. Retention planning is available; retention.enabled is false by default, and retention apply refuses deletion while that flag is off. This is not a credential revocation service — rotate secrets at the provider after a finding.

Problem

Agent transcripts (Claude Code, Codex, Cursor, and generic JSONL) often store API keys, cloud credentials and PII in plain text on disk. agentscrub finds them locally and can rewrite supported formats safely (dry-run by default).

Install

git clone https://github.com/JarvisOsorio/agent-session-scrubber.git
cd agent-session-scrubber
cargo install --path .
# or: cargo build --release && ./target/release/agentscrub --help

Commands

CommandPurpose
discoverList recognized session files
scanDetect secrets/PII; exit 8 if the scan is incomplete
reportRe-render a saved JSON report (or re-scan)
scrubDry-run redaction by default; --confirm to write
verifyPost-remediation check
retentionstatus / plan / apply / verify (apply refuses while the flag is off)
configShow effective config

Exit codes: 0 ok · 1 general · 2 bad args · 3 unsupported · 4 permission · 5 validation / unclean verify · 6 remediation · 7 policy · 8 incomplete scan. Incomplete is not clean. Unclean verify exits 5.

Quick start (fixtures)

Copy fixtures first — never scrub the originals in-tree during experiments:

mkdir -p /tmp/agentscrub-demo/.claude
cp tests/fixtures/claude/session_secrets.jsonl /tmp/agentscrub-demo/.claude/

agentscrub discover --path /tmp/agentscrub-demo
agentscrub scan --path /tmp/agentscrub-demo --format terminal
agentscrub scrub --path /tmp/agentscrub-demo/.claude/session_secrets.jsonl
agentscrub scrub --path /tmp/agentscrub-demo/.claude/session_secrets.jsonl --confirm
agentscrub verify /tmp/agentscrub-demo/.claude/session_secrets.jsonl --format json
# expect: clean=true, remaining_findings=0, exit 0

Scan output is masked values and fingerprints only — no raw secrets. Fixtures under tests/fixtures/ are synthetic only.

Adapters (v0.1)

AdapterReadRedactNotes
claude_code✓✓JSONL sessions
codex✓✓JSONL sessions
cursor✓✗JSONL + SQLite state.vscdb scan only — rewrite intentionally disabled
generic_jsonl✓✓Configurable text fields
generic_json✓✓Single JSON documents

Unsupported or malformed files are skipped and reported, never silently modified.

Security posture

Source and license

Identity: Jarvis Osorio · Jarvis Nelson Osorio · AI work · Official profiles

Updated: November 13, 2026 (America/New_York)