A key’s day

Part 4 recap · Agents

Agents: the short version

An agent copies what it can reach. Give it access, not the key.

Take the full lesson Part 5 recap: Coverage

Where the copies are

Issued by the payment service, kept in the vault, then 6 copies:

  1. Agent settings file
  2. Agent chat history on the laptop
  3. Web AI chat
  4. Code server
  5. Team chat
  6. Attacker’s public repository

The day, step by step

  1. Meet the key · 9:00 AM Meet the key.
  2. Agent settings · 9:20 AM Pasted into the agent’s settings file.
  3. Agent chat · 10:05 AM The agent read the key back.
  4. Web AI chat · 10:40 AM Pasted into a web AI chat.
  5. Agent commit · 11:15 AM The agent committed the settings file.
  6. Team chat · 1:30 PM Posted in the team channel.
  7. Bad package · 2:15 PM A bad package turned her agent into a searcher.
  8. Detect · 2:40 PM TruffleHog finds the copies.
  9. Verify · 2:42 PM Is it still live?
  10. Analyze and notify · 2:55 PM The right owner gets the alert.
  11. Rotate · 3:30 PM Swap in a new key.
  12. Confirm · 3:45 PM Confirmed: the old key is dead.

How it ended

Swap in a new key. Every copy, including the public one and the web chat, stops working at once.

Confirmed: the old key is dead. The agent can repeat the old key all it likes. It no longer opens anything.

Try it with TruffleHog open source

Install TruffleHog first; its README lists the options. Run these only on folders, images and buckets you’re allowed to scan.

  1. Settings. Scans the files you name, such as an agent’s settings file, before anyone shares them.

    trufflehog filesystem .mcp.json
  2. Commit. Runs as a pre-commit hook, so a commit an agent makes is checked like anyone else’s.

    trufflehog git file://. --since-commit HEAD --fail

Keep going