Clean Up Plaintext Secrets Left by AI Coding Agents

Ishannaik · reddit · 2026-07-12

agentsweep is an open-source CLI tool designed to find and clean up plaintext secrets saved to disk by AI coding agents. Examples provided by the author include Codex, Cursor, Claude Code, Cline, Aider, and Windsurf.\n\nThe Problem It Solves\n- After you paste API keys, DB URLs, .env files, or even wallet mnemonics to an agent, many tools write this data into local history files\n- These histories are repeatedly read by the agent for context, meaning plaintext secrets could resurface in subsequent files, commands, or replies\n\nFeatures\n- Uses about 191 secret detection rules (ported from gitleaks)\n- Adds extra support for detecting BIP-39 mnemonics\n- Runs in read-only scan by default; requires manual confirmation before rewriting\n- Supports in-place redaction, .bak backups, post-write verification, and full rollbacks\n- Works out of the box for about 30 agents\n\nThe project is MIT licensed, and the author clarifies they are not selling anything.

Original post →

More from coding & agent

coding & agent channel →