Your agent transcripts are sitting on disk in plain text

Your agent transcripts are sitting on disk in plain text

Jarvis Nelson Osorio

Here is an ordinary fact that still surprises people: when you use Claude Code, Codex or similar agent tools, the session often lands on disk as JSONL. API keys, cloud credentials and personal data can sit in those files in plain text, on the same laptop you used to generate them.

I wrote agentscrub — a local-first Rust CLI in the agent-session-scrubber repository — to find those secrets and redact the formats it can safely rewrite. I'm Jarvis Nelson Osorio. The tool runs offline. There are no accounts and no telemetry. It is not a cloud DLP product, and it is not a credential-revocation service. After a finding, you still rotate the secret at the provider.

What v0.1 actually does

Three commands cover the happy path. Copy fixtures first. Do not scrub the in-tree originals while you are experimenting:

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

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

The last command should report clean=true, remaining_findings=0, and exit 0. Scan output uses masked values and fingerprints only — no raw secrets. Dry-run is the default for scrub; --confirm is what writes.

Against your own agent home (the defaults also look under ~/.claude and, when configured, Codex and Cursor roots):

agentscrub discover
agentscrub scan --path ~/.claude --format json --output report.json

You need Rust 1.89 or later. The crate is not on crates.io or Homebrew yet.

Adapters, and the ones that refuse to write

  • claude_code — Read: yes; Redact: yes; Notes: JSONL sessions
  • codex — Read: yes; Redact: yes; Notes: JSONL sessions
  • cursor — Read: yes; Redact: no; Notes: JSONL + SQLite state.vscdb are scan-only. Rewrite is disabled on purpose.
  • generic_jsonl — Read: yes; Redact: yes; Notes: Configurable text fields
  • generic_json — Read: yes; Redact: yes; Notes: Single JSON documents

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

Retention is similarly conservative. retention.enabled is false by default. retention plan and status are read-only. retention apply refuses deletion while the flag is off.

Why the refusals matter

It would have been easier to claim "we rewrite every vendor store." I did not, because a half-safe SQLite mutation in a Cursor database is worse than a scan-only mode. The same instinct shows up in the write path that is enabled: atomic same-filesystem replace, an exclusive lock, a pre-write hash recheck, and a refusal to follow symlink targets.

Incomplete is not clean. A scan that could not finish exits 8. An unclean verify exits 5. Those codes exist so you do not paper over a partial run.

Redaction also does not erase backups, snapshots or copies on a provider's side. If a key appeared in a transcript, treat it as leaked and rotate it.

Where this sits

agentscrub is Apache 2.0. It is one piece of a larger set I published in November 2026. Agent Replay Lab redacts known secret key names and token shapes on write, as a first layer, and points you back here for after-the-fact remediation. mcp-pordego looks for inline secrets in MCP configs before a session even starts.

The files are already on your disk. The conservative move is to scan them locally, redact what the adapter supports, and rotate anything that was exposed.

Canonical article: https://jarvis-nelson-osorio.pages.dev/blog/jarvis-osorio-agentscrub-agent-session-scrubber/

More tools: https://jarvisosorio.com/open-source/

Report Page