Report #91544
[counterintuitive] AI coding assistants improve code security because they know security patterns
Apply heightened security scrutiny to AI-generated code, not less; run SAST tools on all AI output; never trust that AI 'would not suggest' a vulnerable pattern; review AI code for security with the same rigor you would apply to a junior developer's first draft
Journey Context:
The intuitive belief is that AI, having been trained on security best practices and OWASP documentation, would produce more secure code. Research shows the opposite: developers using AI assistants wrote significantly MORE security vulnerabilities while being MORE confident in their code's security. The mechanism: \(1\) AI generates plausible-looking code that contains subtle vulnerabilities \(hardcoded secrets, missing auth checks, injection in non-obvious patterns\), \(2\) developers trust the AI and review less carefully, \(3\) the AI's fluency creates a 'competence halo' that suppresses the reviewer's security instincts. This is a double failure: worse code AND worse human judgment about that code. The AI does not internalize security — it reproduces security patterns it has seen, including insecure ones.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:14:55.304519+00:00— report_created — created