Why AI-generated code fails code review in a different way

AI-generated code is ready for production when it has passed checks written from the specification before the code existed, when every mechanical check (formatting, types, security scanning, whether each added package exists) has run on a machine, and when a reviewer has read a change small enough to understand in one sitting and confirmed that its stated intent matches what was asked for. Reveneau writes all of its code with AI and releases a change only after it passes an eval suite written from the specification, because human review was built to catch a kind of failure that generated code does not show.
A pull request that causes trouble later can look clean at the time. It is tidy. It is consistently named. It has docstrings. It gets approved in four minutes with a thumbs up, and that approval is the problem.
Code review rests on an assumption nobody writes down: that careless work looks careless. While people wrote all the code, this held. A function doing four things, a variable called data2, a comment arguing with the code beneath it, three styles in one file because two people disagreed. These are signals. A good reviewer follows them to the defect, and the reason experienced reviewers are fast is that they recognise these warning signs instead of reading every line.
Generated code shows none of those signals. It applies the same clean style to the part that was carefully specified and the part that was invented from a plausible guess. Consistency stops being evidence of care.
What gets past review
Which defects appear, and how often, is the useful part, and it is measurable.
Veracode's Spring 2026 report on generated code security (published 24 March 2026, read 2026-11-11) says the company has evaluated over 150 large language models to date, on 80 coding tasks in four languages: Java, JavaScript, C#, and Python. It reports syntax correctness rates above 95 percent, and that "only 55% of generation tasks result in secure code". The average matters less than the difference between types of vulnerability. SQL injection passed at 82 percent, insecure cryptographic algorithms at 86 percent, cross-site scripting at 15 percent, and log injection at 13 percent.
Look at which classes did well. SQL injection is the one every developer has been trained on, the one with an obvious pattern, the one a reviewer spots because the string concatenation is right there. Cross-site scripting and log injection are the opposite: the defect is spread across a few lines that each look ordinary, and finding it means tracking where a value came from and where it is used. That takes longer than reading, and a reviewer on the tenth change of the afternoon reads.
So the failures are concentrated in the types of defect that reading at normal speed does not catch, and generation produces more of them.
The second measurable thing is code that is almost right. In Stack Overflow's 2025 Developer Survey (read 2026-11-11), 66 percent of respondents named AI solutions that are "almost right, but not quite" as a frustration, and 45.2 percent said debugging AI-generated code is more time-consuming. Obviously wrong code costs nothing: it is deleted in seconds. Almost-right code gets read, discussed and approved, and shows up later as the cause of an incident.
The three assumptions that stopped being true
That the author understood the change. Review has always been a conversation with someone who made decisions and can explain them. When a model produced the diff, nobody knows the reasoning. The reviewer ends up working out the requirement backwards from the implementation, which is the opposite of what review is for.
That effort limits volume. Writing code used to be slow enough to limit how much arrived for review. That limit is gone on the production side and unchanged on the review side. Attention cannot grow with volume: a reviewer facing four hundred lines reads the last hundred with less attention than the first, and approves anyway.
That style shows quality. Discussed above, and it is the one that removes an experienced reviewer's best tool.
What to do about it
Four changes, in the order they give results.
Move everything mechanical to a machine
A human should never be checking formatting, obvious null handling, or whether an error is silently ignored. Those are machine jobs and a machine does them at any volume. Every minute a reviewer spends acting as a linter is a minute not spent on the question of whether the change should exist.
Verify against the specification
The mistake is generating tests from the code. A suite written by reading the implementation asserts that the code does what it does, passes automatically, and proves nothing. It is worse than no suite, because it passes.
Checks have to come from what the software must guarantee, written before or independently of the code. The method is in writing specs an agent can verify, and the failure modes are catalogued in when evals give false confidence. The direct test: break something deliberately and confirm the suite notices. If it does not, the passing checks mean nothing, and it is better to learn that today.
Make the change state its own intent
If an agent opens the pull request, the description has to supply what the absent author would have: what was asked for, what approach was chosen, what was deliberately not done, and what the reviewer should look at most carefully. A diff with no stated intent leaves the reviewer guessing at the requirement.
We treat a missing rationale as a review blocker, the same as a failing test. It sounds bureaucratic, and it costs a few lines of text.
Limit the size automatically
Reject changes that are too large for a reviewer to understand all at once. Make it a rule that a bot enforces.
This rule protects every other change on this list, because a two thousand line diff defeats all of them. If the work cannot be split, that is worth knowing before it is written.
The checks a change passes before production
Put together, this is what makes AI-generated code production ready. Each check has an owner, and the owner is a machine wherever a machine can do the job.
| Check | Run by | What it catches |
|---|---|---|
| Evals written from the specification, before the code | the pipeline, on every change | code that does something other than what was asked |
| Formatting, types, static security analysis, secrets scanning | machines, on every change | the defect types with the lowest pass rates in Veracode's figures, such as cross-site scripting and log injection |
| Every added package exists and is the one intended | a machine, against the package registry | invented package names (see how to do a security review before launch) |
| A size limit | a bot | a change nobody can read whole |
| Stated intent in the change description | the author, person or agent | a reviewer working the requirement out backwards |
| A read for intent and consequences | the reviewer | a change that should not exist, and what breaks when it fails |
| A rollback plan and monitoring after release | the team | a defect that every check missed (see what a rollback plan looks like for AI-written features) |
How many checks the first row needs is in how many tests AI-generated code needs. At Reveneau, AI writes all of the code, and a change is released only after it passes the eval suite written from the specification. Jev, the decision model that grades the suite, runs it ten times faster than our previous grader did; that is our own figure, measured against that grader. We take responsibility for the whole project through production and after release.
What the reviewer is for now
Narrow the human job deliberately, and it gets better.
Should this change exist at all. Does it match what was asked for. How much breaks when it fails. What did somebody decide here that no test could express. What is missing that nobody would notice was missing.
That last question is the one only a person can ask, and it is the whole argument for keeping humans involved. A check verifies a rule someone thought of. It cannot notice a rule nobody thought of. Related reading is in what good code review looks like when nobody wrote the code and how to review AI-generated code.
The uncomfortable part
Some of this is a volume problem with no clever solution. If a team produces three times the change it did last year and has the same number of reviewers, something has to be reduced. What gets reduced is how carefully each change is read, and nobody says so, while the approval rate stays high.
The honest options are to slow production, add review capacity, or build verification good enough that a reviewer can accept work without reading every line. The third is the only one that keeps working as volume grows, and it is engineering work that has to happen before the volume arrives.
Review used to ask whether the code was written carefully. Now it has to ask whether it is correct, and those were never the same question.
Related guide: Enterprise AI coding governance.
Sources
- Veracode, Spring 2026 GenAI Code Security update, published 24 March 2026, read 2026-11-11: Veracode says it has evaluated over 150 large language models to date, on 80 coding tasks in four languages; syntax correctness rates exceeding 95 percent; only 55 percent of generation tasks result in secure code; SQL injection 82 percent, insecure cryptographic algorithms 86 percent, cross-site scripting 15 percent, log injection 13 percent.
- Stack Overflow 2025 Developer Survey, AI section, read 2026-11-11: 66 percent name "almost right, but not quite" as a frustration; 45.2 percent say debugging AI-generated code is more time-consuming.


