Working is not the same as safe
A model trained on public code learns the patterns that are common, and common code is not the same as secure code. It also optimizes for the request in front of it. "Return the user's orders" says nothing about checking that the caller owns those orders, so the generated code often does not check.
| Study | Method | Finding |
|---|---|---|
| Pearce et al., IEEE Symposium on Security and Privacy 2022 | 89 scenarios built around high-risk CWEs, 1,689 programs from GitHub Copilot | About 40% vulnerable |
| Veracode GenAI Code Security Report, 2025 | Security-relevant tasks given to over 100 LLMs in Java, JavaScript, Python and C# | OWASP Top 10 flaws in 45% of tests |
The studies are years and model generations apart, and Veracode reports that larger, newer models did not improve security. Gains in general coding ability did not carry over into code that resists attack.
Key idea: Treat generated code as code from a fast, well-read contributor who was never told the threat model.

