Anything an agent reads becomes part of its context, and context travels: to the model provider, into session logs, and sometimes into a saved summary or a commit. The safest secret is one the agent never sees.
Where secrets leak from
- A
.envfile in the working folder. - A key pasted into the chat “just to make it work”.
- Output of a command that prints environment variables.
- A config file in the repository that was committed by mistake.
Steps
- Keep real secrets outside the repository folder, in a secret manager or the operating system keychain, and load them at run time.
- List
.envfiles in.gitignore, and commit an.env.examplewithout values. - Use the permission settings of your coding tool to deny reading secret files, and keep approvals on for commands that print the environment.
- Turn on secret scanning and push protection in your repository host, so a committed key is caught.
- Use separate keys for development with narrow scopes and low limits.
- If a secret was exposed, rotate it. Deleting the commit is not enough.
What Contextingo stores
Never put secrets in project records. Contextingo keeps its own access keys out of logs and audit data, and each person connects with their own personal key, which can be revoked. The security page lists the details.