An agent records what it reads and what its commands print. Search the stored transcripts and logs of this agent for secrets that are now in them.
This search is recorded too. If a command prints a secret, the secret is in a new transcript. Thus all matching must occur in a script that prints only masked results.
Find the stores: session transcripts, saved tool results, shell history that the agent writes, debug logs, memory files, and files that the agent made in temporary folders. If you cannot find the data folder of the harness, ask me. For each store give its location, its size, and the age of its oldest file.
Write a script that searches the stores for these patterns:
Authorization headers and session cookies;.env files;For each match the script prints only the file, the line number, the type of secret, the first 4 characters, and the number of other files that contain the same value.
For each type of finding, say how the secret got there: I pasted it, a command printed it (which command), the agent read a file (which file), or a tool returned it.
Examine the exposure. Are these stores synchronized to a cloud drive or a backup? Can other users of the machine read them? Are they in a repository? Does a "share session" or telemetry function upload them?
Recommend:
.env, a wrapper that masks output, or a shorter retention time.Rules:
Output: a table with these columns: type of secret, count, files, how it got there, action. Then the changes that prevent a repeat.