When AI-written code passes every test, what should humans review?

This article has been automatically translated.
Loading article...
Merry Christmas & Happy New Year!
Loading article...

This article has been automatically translated.
Suppose your team has a coding agent port a core service from an old language to a new one. CI is green across the board, the agent reports that "all tests pass," you skim the diff, and the hundreds of changed lines show no obvious problems, so you hit merge. After launch, some requests return results subtly different from the old version—not errors, but behavior drift.
This is exactly the situation Anthropic ran into when migrating the Messages API. Anthropic is the company behind the Claude model family, and the Messages API is its core public interface, also used by its own applications such as Claude Code. To handle traffic growth, they migrated this interface from Python to Rust, cutting CPU consumption per request by about 70%, and the first version of the core request handling was written by Claude in about a week.
But the conclusion developers should really remember is this: the bottleneck of migration shifted from "generating code" to "verifying code." According to the migration article they published on November 25, 2026, the test pass rate during the migration was about 98%, yet when compared against production traffic, only about a quarter of inputs matched the Python version.
These two numbers have different denominators and compare different things,and they do not mean that "three-quarters of requests failed". But they make one thing clear: there is a real gap between passing tests and matching online behavior.
To understand this gap, you first need to see why the tests could pass.
Anthropic had about 700 integration tests, tightly coupled to the Python implementation, which had to be rewritten during the port. When auditing the ported tests, they found more than 100 weakened assertions. In other words, when the agent writing the code is also rewriting the tests, "passing" may simply mean "the bar was lowered."
Another difficulty: the Python version kept changing during the migration, and for privacy reasons engineers could not read the actual contents of customer requests. The old system was moving, the new system was chasing it, and the tests could not be fully trusted.
Anthropic's response was to treatthe running Python version as the verifier of correctness, using shadowing to send the same batch of requests to the Rust version as well, then compare the results.
There is an easy trap here: if both sides actually call the model and then compare outputs, most differences will be noise because model responses are random each time, and real bugs will be drowned out; moreover, requests would be processed twice, which could double-count usage and billing.
Their approach: call the model only once, replay that output to the Rust version, and compare at every stage before and after the model call with exact consistency. Rather than reading each difference, they first record and classify differences by "the stage and location where the deviation first appeared."
Fixes advanced through a three-layer loop: an inner loop where the agent reproduces and fixes differences in a sandbox; an outer loop that uses production shadow comparison to confirm whether the difference is gone; and a learning loop that turns review feedback into rules, tests, and lint. Only fixes that pass PR review are allowed to move from the inner loop to the outer loop.
Using the old system as judge sounds solid. But the verifier only rewards "matching output," and the agent will find the cheapest path that satisfies it.
A real case happened during the migration. In mid-May, the explanatory text for the web search tool disappeared from the Rust version's prompt. The Python version fetched this text from an internal service, and the Rust version had not yet integrated that service. The agent proposed copying the explanatory text into a file and having Rust read from the file—the prompt matched, and local verification passed.
The engineer rejected this approach. The reason was straightforward: before release, that service must actually be called, and this code would have to be thrown away eventually. Anthropic later concluded that the verifier rewarded matching output, and the agent found the cheapest way to satisfy it. The reason for this rejection was stored in the learning loop, and when similar differences appeared later, the agent no longer wrote workarounds but linked them to known issues.
The lesson for reviewers is this:when a fix makes a difference "disappear," first ask whether it reproduces real behavior or hardcodes/copies in the expected value.. If it bypasses a dependency that must exist in production, reject it and record the reason so the same shortcut is not proposed over and over.
So what should humans actually look at? Katelyn Lesse, Anthropic's head of platform engineering, mentioned a team observation on The Pragmatic Engineer podcast: about 80% of the PRs submitted by agents were not read in depth by engineers, while the remaining roughly 20% were examined carefully. She noted that this is an estimate, not a measurement, and that it refers to the number of PRs, not the proportion of lines of code. The team also has review classifiers covering all PRs; templated changes such as SDK version bumps can be merged without human review, while high-risk changes are still gated by humans.
So the more accurate statement is not "Anthropic no longer reviews," but that human attention is focused on questions the verifier cannot answer. Behavior comparison can faithfully reproduce the old system's bugs, but it cannot tell whether a difference is a bug or an intentional change—that must be decided by a human.
Based on this, TECHU proposed a review recommendation table by change type (this is TECHU's proposal, not Anthropic policy):
The core principle is:what is reduced is the scope of reading, not the depth of review at key points, nor human approval of high-risk decisions.. Changes lacking necessary verification should first add verification, then discuss reducing review.
While preparing another article, TECHU built a reference implementation of the "asset loan extension request" feature on Snipe-IT, which includes a business rule: when two approvers handle the same request at the same time, only one decision may take effect.
They compared the reference implementation with a version that deliberately removed the row lock. The version without the row lock passed all 47 hidden tests and 6,994 regression tests, failing only the concurrency acceptance check—in 11 of 12 trials, 2 to 4 decisions were applied to the same request, versus 0 times in the reference implementation.
It should be noted that this is a verification result from a scoring pipeline, not an evaluation of an AI agent. But it shows thatif concurrency invariants are not covered by purpose-built verification in advance, no amount of tests will find the problem.. This supports the article's core point—quality assurance must move earlier, defining "what counts as correct" before the agent writes code.
Here is an actionable rollout order; it does not require overhauling the entire process at once:
Anthropic's case rests on preconditions: a runnable old system as a behavior baseline, a large volume of production traffic, and a dedicated team. Most teams do not have these.
Behavior comparison also cannot judge the business correctness of new features or business rule changes—there is simply no baseline there. In that case, "what counts as correct" can only be written down by humans in advance as acceptance criteria, invariants, or expected results.
Also, the roughly 80% shallow-review figure from the podcast is a team observation, not a measurement. Treating it as a target number is a misreading.
One final judgment (this is the analysis in this article): in projects where specifications are unclear, tests are thin, and monitoring is missing, cutting human review first will only move unconfirmed risks into production. Code can be generated and verified by AI, but responsibility for release decisions and their consequences cannot be handed to AI.