Stop your coding agent leaking secrets across sessions
A developer built VIGIL, a guard in front of Claude Code's tools; he reports it stopped all six test attacks and redacted a secret from a real DNS update.
Done with Claude Code
What they did
A developer noticed his coding agent could read a secrets file one day, then send it to a website days later after reading a booby-trapped guide. He built VIGIL, a checker that runs before every Claude Code action. It remembers which sensitive values the agent has seen in past sessions. When a new action would send one out, it either removes just that value or blocks the whole action.
How it went
He reports all six test attacks were stopped when the history was available. In one case it blanked out a token in a DNS update and let the rest go through. Replaying his own agent history also revealed a bug that flagged harmless values as secrets.
Worth knowing
Checking each agent action on its own misses attacks that span days; the risk is in how a file read and a later web request connect.
Try it yourself with Claude Code
Before each tool call you make in this project, check whether any value you read earlier from [sensitive files, e.g. .env] appears in the call's arguments. Keep a running log of those values (store only a fingerprint, not the value). If a call would send one to an outside address, stop and show me the call, which argument carries it, and whether removing that argument alone would make it safe. Wait for my approval before running it.Swap the highlighted [parts] for your own details.
Source: DEV Community · Aaditya Rawat · Oct 19, 2026
Written with AI assistance from the original post and checked against our editorial guidelines. Results are as reported by the source, not independently verified. Spotted a mistake? Tell us.