WeaknessASC-2026-0052Other weakness
Secrets written into code and commits by agents
MediumFixed
Agents copy keys from the environment into code, configuration, logs or commit messages while trying to make something work.
How to detect it
- Secrets in diffs produced by agents
- Keys in generated test files or examples
How to resolve it
- Run pre-commit and server-side secret scanning
- Keep real secrets out of the agent's environment
How to investigate
- Find every commit and log with the secret
- Rotate it and rewrite history if needed