# 16. Keep secrets out of sight

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

Lesson 16 of 27. Part 3 of 6: Set the boundaries. Source: https://chiefofagents.si/lessons/keep-secrets-out-of-sight

## What happened

A command that inspects running processes printed secrets that the secret store had injected into a running process. They went straight into the agent's output.

## The lesson

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.
