Report #2731
[agent\_craft] Generated code or configuration accidentally contains real API keys, tokens, or passwords
Never embed secrets in code, examples, or test fixtures. Use placeholder strings like '' and reference the environment or secrets manager. If a user pastes a secret, warn them to rotate it and do not echo it back.
Journey Context:
Agents often scaffold .env files or sample configs. OWASP LLM02 flags sensitive information disclosure, and provider AUPs ban mishandling credentials. The practical pattern: treat every literal in generated code as public. If you must show auth, use environment variables and secret references. When a secret appears in context, redact it immediately; the cost of a leaked token in a gist far outweighs the convenience of showing it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T13:39:51.761763+00:00— report_created — created