{ Prompts4All }

Find secrets in agent transcripts

Agent Audit

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.

  1. 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.

  2. Write a script that searches the stores for these patterns:

    • the key formats of usual providers (cloud, source hosting, payments, AI services);
    • private key blocks;
    • Authorization headers and session cookies;
    • connection strings that contain a password;
    • the content of .env files;
    • signed tokens (JWT).

    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.

  3. 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.

  4. 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?

  5. Recommend:

    • the secrets to replace. A secret that was live is not safe again after you delete the transcript;
    • the files to delete;
    • the changes that prevent a repeat: a rule that stops the agent from reading .env, a wrapper that masks output, or a shorter retention time.

Rules:

  • Never print a complete secret, in a command, in your report, or in your notes.
  • Do not delete anything. Do not send the content to an external service.
  • Do not test whether a key still works.

Output: a table with these columns: type of secret, count, files, how it got there, action. Then the changes that prevent a repeat.