Report #68270
[counterintuitive] AI coding assistants improve code security by suggesting secure patterns
Mandate independent SAST/DAST scanning on all AI-generated code; treat AI-assisted code as higher security risk not lower; never allow AI to self-certify security; add pre-commit hooks that run CWE-pattern detection on AI-suggested diffs
Journey Context:
Perry et al. ran a controlled study where participants wrote code with and without AI assistants. AI-assisted participants produced significantly more security vulnerabilities across all 5 scenarios \(XSS, SQL injection, OS command injection, path traversal, etc.\) while reporting significantly higher confidence in their code's security. The mechanism: AI produces fluent plausible code that contains known CWE patterns and that fluency suppresses the developer's adversarial scrutiny. This is a double calibration failure: the AI is miscalibrated \(confidently generating vulnerable code\) and it miscalibrates the human \(making them overconfident\). The fix inverts the trust model: AI-assisted code should receive MORE security review not less.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:04:34.622380+00:00— report_created — created