Home / Lessons / Set the boundaries / 16 of 27

Keep secrets out of sight

An agent can read files, terminal output and process details. A secret can be in all three.

  1. The key lives in a secret store, outside the repository.
  2. The agent reads the repository. No key there.
  3. At run time, the store hands the key to the process.
  4. The agent lists running processes, and the listing prints the key.
  5. So process output counts as a place secrets appear, and secret scans block it.

Plain-text secrets in a file beside the code are the obvious risk. The less obvious one is that a secret can reach the model even when the repository holds no such file.

The fix covers the whole path. A secret store keeps values outside the repository. Commands receive values only when they run. Documentation holds variable names, never values. Secret scans check changes before they land. And process output is treated as a possible source of secrets too.

How I do it

Values live in a secret store and are injected at runtime. My notes and docs only ever name the variable.

The rule

Assume anything an agent can print, it can read.

The skill I use for this: /02-vulnerability-scanner. Made by sudo3rs (Masriyan).

Read next

The ideas behind it

This lesson as plain text, for your agent. Or all 27 on one page.

Try “secrets”, “merge”, “handover” or “database”.