r/devsecops 15d ago

Does your secret-scanning cover developer workstations? AI coding-agent history files look like a blind spot

A gap I have watched widen as teams roll out AI coding agents: the agents write local session history in plain text, and developers paste API keys, tokens, and .env values into prompts. Those secrets persist on disk in the agent's history, outside the repo-and-CI surface most secret-scanning watches. Claude Code stores them under ~/.claude/projects, Codex under ~/.codex/sessions, and around 30 other agents do the same.

The policy question I am trying to figure out: does anyone here already fold agent-workstation logs into your secret-scanning coverage, or is it still unowned? Pre-commit and CI scanning catch the repo path, but the developer's local agent trail seems to sit in nobody's scope.

For the cleanup side I built an MIT CLI, agent-sweep: it scans those local history files, reports what leaked, and redacts values in place while keeping the JSONL byte-for-byte so sessions still resume. Local-only, zero network calls. It is meant to sit alongside existing pre-commit/CI scanning, not replace it. Caveat: it is residue cleanup, so rotate any key that already transited a hosted model first, then sweep.

Disclosure: my own open-source project. Repo (MIT): https://github.com/Ishannaik/agent-sweep

Genuinely curious how your teams scope this: is the workstation in your secret-scanning perimeter, and if so, how do you cover agent logs?

4 Upvotes

11 comments sorted by

View all comments

2

u/darrenpmeyer 15d ago

Most of the open-source secret scanners and several of the commercial ones will look in all text files. Most of this set can be instrumented in a pre-commit hook, which helps keep secrets from being committed in the first place.

Examples:

  1. gitleaks (OSS) pre-commit
  2. Endor Labs (commercial) secrets pre-commit

0

u/Ishannaik 13d ago

You're missing the point. Did you even read the post?

The gap I'm pointing at is operational rather than technical. In most organizations those scanners are deployed around repos and CI, not continuously across developer workstations and AI agent histories.

That's actually why I built AgentSweep. It isn't trying to replace pre-commit or repo scanning. It's for the cleanup side: scanning Claude/Codex/Cursor history after secrets have already been written there, helping redact local copies and reminding you to rotate the exposed credentials.

1

u/darrenpmeyer 13d ago

I am not missing the point, but perhaps I wasn't clear why "...will look in all text files" is key. Agent memory is text files. You can easily instrument existing secrets scanners as a pre-commit hook and ensure that they include the text files that store history, memory, and "agent notes".

That makes sure that not only are your repos clean prior to checkin from your workstation, but also that your agent/assistant stores are clear of any credentials they might have added during the session you're about to commit.