AI / ML

How to review AI-generated code before it reaches production

Qorinx Engineering · 9 min read · Updated 2026
How to review AI-generated code before it reaches production

If agents write most of your diffs, you cannot review AI-generated code the way you reviewed a colleague's pull request. Reading every line does not scale, and skipping review ships bugs nobody understands. What works is a different split: humans check intent, tests and blast radius on every change, and a senior engineer reads line by line only where a mistake costs money, data or trust.

This matters now because the numbers moved this month. Anthropic published how its own merge volume went from roughly 2,500 changes a day in May 2026 to over 30,000 a day in September, and said coding is no longer its bottleneck. Everything built for human speed is. If you are a founder building with Claude Code or Cursor, or hiring a team that does, the same pressure is coming for your repo, just smaller.

Why is reviewing AI-generated code suddenly the bottleneck?

Writing code got cheap. Checking that it is right did not. The clearest primary source we have seen on this is Anthropic's engineering post, Redesigning source control at Anthropic. In it the team says the bottleneck is now the developer infrastructure built for human scale, namely source control, builds and CI. They also say their engineers still review every change request, but they now examine the intent of the change instead of reading every line.

Treat that as a data point from an unusual company, not a template. Anthropic says so itself: it uses Claude to write software far more than almost anyone, and it does not expect most organizations to hit these limits soon. Your repo is not a 100 GB monorepo. But the direction of travel is the same, and it shows up well before the scale does.

A second signal came from a firm-level study of 718 companies through March 2026, covered by Ars Technica on October 12 and discussed at length on Hacker News (364 points, over 300 comments). As reported, teams using coding agents produced about 30% more lines of code and 23% more pull requests. Review time rose by roughly 49%, the share of pull requests with requested changes nearly doubled, and there was no statistically significant increase in completed issues or epics. Autocomplete-style assistants barely moved review at all. Agents did.

Two caveats before anyone quotes those figures in a board deck. The study is observational, so it does not prove agents caused every extra review minute. And we read the findings through coverage and summaries of the paper, not as our own measurement. The pattern, though, matches what practitioners in that thread described: more output, review as the place where quality problems get caught, and a queue that grows.

For a founder, the conclusion is simple. If your plan to ship faster is "let the agent write more", you have only fixed the cheap half of the pipeline. The expensive half is deciding what is safe to merge.

What goes wrong in code an agent wrote?

Agent-written code rarely fails the way a junior's code fails. It compiles, it looks tidy, and it often passes its own tests. The failures are quieter, and they are worth knowing by name because they decide where your review time goes.

  • Broken system rules. Anthropic's engineers describe agents violating core constraints to satisfy a pattern that should never have been allowed. Their example: several systems tried to find when a change merged by reading the commit log line by line, instead of asking the code review tool. It worked, and it was wrong for the system.
  • Over-engineering. Models asked to be defensive add validation, retries and abstractions for threats that do not exist. The same post describes a review that was overly defensive about trusting another internal service, which pushed Claude to add excessive validation and complexity.
  • Tests that bless the bug. Tests written by the same agent tend to confirm what the code does, not what it should do. One engineer on the Hacker News thread said that in every defect serious enough to need a formal root cause analysis this year, AI-generated tests asserting the broken behavior as correct were a contributing factor. That is one person's experience, not a statistic, but it is a pattern we would check for in any codebase.
  • Scope creep inside a diff. A change that was meant to fix a form validation also touches a permissions helper. Nobody asked for it, and nobody notices in a 900-line diff.
  • The classic holes. Exposed keys, missing authorization on endpoints, open database rules and no rate limits are still the most common serious findings in AI-built apps. We keep that list in the vibe-coding security checklist we run on every rescue, and it is still the first thing we check.

Notice what these have in common. None of them is a typo. They are decisions, and a reviewer who only reads syntax will miss all of them.

A review process that works when agents write the diff

Here is the process we would put in place for a small product team. It assumes you have at least one engineer who can say no to the agent, because that turns out to be the real job.

  1. Write the intent before the code. Every change starts with a short description: what it should do, what it must not touch, and how you will know it works. A reviewer cannot judge intent that was never written down. Keep it to a paragraph.
  2. Make the agent show a failing test first. Ask for a test that fails on the current code, then the change that makes it pass. A red-then-green run is hard to fake, and it forces the agent to state what correct looks like before it writes the fix. Then read the tests more carefully than the code.
  3. Keep diffs small. If a change touches more than one concern, send it back. Small diffs are the cheapest review control there is, and agents are happy to split work when you ask.
  4. Let CI do the boring checks. Linting, type checks, the test suite, dependency and secret scanning, and a build, all on every pull request. Nothing merges on a red run, including changes you wrote yourself.
  5. Set rules by path, not by mood. Anthropic's review tooling can tell comment-only edits apart from sensitive logic changes, so human attention goes to the second kind. You can approximate that cheaply with code owners: authentication, payments, permissions, migrations and anything that sends email or money always need a named human approver.
  6. Read line by line where a mistake is expensive. For the five or six paths that touch identity, money and customer data, a senior engineer reads every line. For a settings page, skim the intent and the tests.
  7. Test after merge, too. Anthropic dropped the classic global merge queue at its scale and invested in post-merge and pre-deploy automated testing instead, accepting that concurrent changes can conflict. You do not need that. But a staging deploy and a smoke test before production is the small-team version of the same idea.

This is the same thinking we apply when we build. Tests and CI are standard on every build we ship, not an add-on, and our vibe code review has a senior engineer go through the code and explain it back to the founder in plain language.

Can another AI review the code?

Yes, and you should let it. A second model pass catches a lot of cheap mistakes before a human spends time on them. Simon Willison, who has been trying adversarial review in his own projects by playing one model against another, says in his write-up of the Anthropic post that the note about it being effective but myopic matches his own experience.

That matches Anthropic's own note that adversarial review sometimes pushed Claude into over-engineering in response to hypothetical concerns. A reviewer model is good at finding things that look wrong in the diff. It is weak at asking whether the change should exist at all, because the diff is all it was shown.

So use AI review as a filter, not a verdict. Run it before the human sees the pull request, ideally with a different model than the one that wrote the code, and tell it what to look for: broken invariants, missing authorization, swallowed errors, tests that assert nothing. Then keep a person on the question no model answers well: is this the right thing to build?

If your team is already using these tools informally and you want the rules written down and enforced in CI, that is what our AI development enablement service covers. For a handful of engineers you probably do not need a program, just the seven steps above.

What guardrails does the agent itself need?

Review catches what the agent wrote. It does not stop what the agent does while it works. Coding agents run commands, read files and call paid APIs, so the blast radius of a bad run is bigger than a bad diff.

  • Scope its credentials. Give the agent a development database, a test payment account and keys that can only do what the task needs. Never hand it production secrets because it was convenient.
  • Break the trifecta. An agent that can read your private data, process untrusted content such as web pages or user input, and send data outward is exposed to prompt injection. Simon Willison calls this combination the lethal trifecta. Remove at least one of the three, usually the outbound network access.
  • Put a hard cap on spend. Simon argued on October 3 that pay-by-usage services need default hard budget caps, not warning emails, because agents make it easy to spin up things that bill. He also noted that AWS launched spending limits in mid-September 2026. Check what your cloud and AI providers actually offer, and set the cap before you need it.
  • Log what it did. If an agent changes something in production, you should be able to see what, when and why. Without that, an incident turns into guesswork.

When should you pay for a senior review, and when not to?

Not every project needs one. If you are building a throwaway prototype, an internal script, or a landing page with no accounts and no payments, run the checklist yourself and move on. Paying for review before anyone depends on the product is wasted money.

Bring in a senior reviewer when one of these is true:

  • Real users, real data or real money will touch the system within weeks.
  • You cannot explain, in your own words, what a core part of your app does or why it is built that way.
  • The product was built mostly by an agent or a no-code generator, and nobody on your side can read the code.
  • A raise, an acquisition or an enterprise customer is coming, and someone will ask about security and code quality.
  • The codebase is growing fast and the person approving changes is also the person writing them.

The last point is the one founders miss. When the same agent writes and approves the diff, you do not have review, you have a log of what happened. If the product is already past the prototype stage and something feels off, our AI rescue service is the route for fixing what a review turns up.

For related reading on shipping AI features safely, see shipping LLM features that survive contact with real users.

If you want a senior engineer to review AI-generated code before real users depend on it, our vibe code review is a fixed-price audit: a prioritized report in plain English and the critical fixes made in your codebase. We sign an NDA first, scope the codebase and quote a fixed price in writing, and you decide what happens next.

Got a project that needs this thinking applied?

Bring the problem. Fixed quote, real deadline, senior engineering.

Book a free 30-minute call