The number that stagnates
The Veracode 2026 GenAI Code Security Report reaches a sobering conclusion: the security rate of AI-generated code stagnates at 56 percent – practically no improvement over the prior year's report. Especially surprising: models trained specifically for software development aren't any safer than general-purpose language models.
The Cobalt AI benchmark: generating vs. reviewing
A benchmark study by Cobalt AI from April 2026 examined seven common AI assistants and found a consistent pattern: more than half of generated code contains at least one exploitable security vulnerability – specifically, the same models produced vulnerable code in 55.8 percent of cases in generation mode. The surprising part: in review mode, those same models correctly identified their own vulnerabilities 78.7 percent of the time.
Generating and reviewing are two different skills
This gap between 55.8 and 78.7 percent is the actually important finding: a model that reliably catches a vulnerability in review mode still regularly produces that same vulnerability in generation mode. Blindly trusting generated code is therefore risky – deploying the same AI as a second, independent check is considerably more effective.
The most common vulnerabilities
Concretely, certain error classes keep recurring: hardcoded credentials directly in the code, missing authorization logic on new endpoints, SSRF vulnerabilities (server-side request forgery), unvalidated user input, missing security headers, and hallucinated dependencies – the last of these is the subject of the next module in this course.
Practice section: use review mode systematically
The practical consequence of the generate-vs.-review gap: every AI-generated code section should be checked in a second, explicit step specifically for these six vulnerability classes – ideally by explicitly asking the same or a different model ("check this code for hardcoded credentials, missing authorization, SSRF, unvalidated input, missing security headers, and invented dependencies"), not by simply trusting the first result.