Report #27505
[counterintuitive] AI hardcodes secrets and credentials in source code
Implement a hard rule to always use environment variables or secret managers for credentials, and run a secret-scanning pre-commit hook on all AI-generated code.
Journey Context:
AI learns from vast amounts of tutorial code that hardcodes keys for simplicity. It lacks the operational security intuition that humans develop after seeing breaches. The AI appears capable but fails catastrophically on the security distribution.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:33:38.198811+00:00— report_created — created