Skip to main content
Back to blog

DECEMBER 4, 2026

How to Review AI-Written Code: A Pull Request Guide

AI writes code faster than people can check it, so review is where quality is now won or lost. Review an AI-written pull request in a fixed order: intent, design, what is missing, tests, then the lines. Here is the order, the reasons and a checklist.

By Umar Abdullah · AI-Native Development

Light cover reading "It runs. Is it right?" beside a pull request for AI-written code with five review checks: intent, design, missing checks, tests and lines
December 4, 20268 min read

Short answer

Review an AI-written pull request in this order: what was it meant to do, does the design put each rule in the right place, what is missing, do the tests prove anything, and only then the lines themselves. Keep the change small enough that one person can understand all of it. The code will usually look clean. The problems we find are in what it does not do: the check nobody asked for and the failure nobody planned for.

Why is review the hard part now?

Writing code got cheap. Checking it did not.

LeadDev's AI Code Review Report 2026, on how 377 engineers and engineering leaders review code they did not write, was published in partnership with CodeRabbit. Its public summary page lists four key takeaways. 45% say review capacity is the biggest drag on delivery. 38% say reviews got slower, against 25% who say faster. Only 26% fully understand the AI code they review. And 68% do not always know which changes need deeper scrutiny. The report has a commercial partner, and the full text sits behind a login that we did not go past, so treat these as the headline figures only.

Google's announcement of the 2025 DORA report, which draws on survey responses from nearly 5,000 technology professionals and over 100 hours of qualitative data, points the same way from a different angle: "AI adoption does continue to have a negative relationship with software delivery stability." Its explanation is about volume: "Without robust control systems, like strong automated testing, mature version control practices, and fast feedback loops, an increase in change volume leads to instability."

More changes, larger changes, and reviewers who are not sure what they are approving. A second reviewer does not fix that. A better order of work does.

What is different about code an AI wrote?

Google's code review guide is, in our view, still the best short description of what a reviewer looks for. It assumes a human author. Three things change when the author is an AI tool. These are our observations from building with AI and from auditing AI-built products.

The surface is clean. Names are sensible, formatting is consistent, comments are polite. The signals reviewers use to spot careless work are missing, so a wrong change can look finished.

The gaps are in decisions, not syntax. In the 35+ audits we reported on in September 2026, 24 of them of codebases written mostly with AI tools, 18 had broken or missing authorization and 9 had a payment or billing bypass, such as a price taken from the browser. As we wrote there, the code does what it was asked to do; nobody asked for the check. A reviewer who reads only the lines in the diff will not see a check that was never written.

The author may not have read it. A human author has at least thought through the code they typed. With AI, the person opening the pull request may have accepted it after seeing it run.

This is why we split the work the way we do. In implementation, AI writes the CRUD, schemas, tests, migrations and glue code. Our senior engineers own where business rules live, what runs on the server, failure handling and the security-critical paths. Review is where that ownership is exercised.

What order should you review in?

The order below is ours. The quotations in it are from Google's guide, which uses "CL" for a change.

Step The question Why it comes here
1. Intent What was this meant to do, and is that the right thing? A perfect solution to the wrong task is still wrong
2. Design Is each rule in the right layer? Cheap to change now, costly after merge
3. What is missing Which checks and failure paths are absent? A fault we find again and again in AI-written code
4. Tests Would these tests fail if the code were broken? Tests written with the code can share its mistakes
5. Lines Do I understand every line, and is each one needed? Last, because steps 1 to 4 may send it back

1. Intent. Read the description before the diff. Google's first functional question is "Does this CL do what the developer intended? Is what the developer intended good for the users of this code?" If the description does not say what and why, send it back before reading further.

2. Design. "The most important thing to cover in a review is the overall design of the CL." For AI-written code we ask one design question first: where does each rule live? Prices, permissions and anything about user data belong on the server. If the change computes a total in the client or hides data in the interface instead of the query, stop there.

3. What is missing. For every new route or action, ask three questions. Who is allowed to call this, and where is that checked? What input is trusted, and where is it validated? What happens when the call it depends on fails? If the diff has no answer, the answer is that nothing happens.

4. Tests. Google's guide says tests should in general be added in the same change as the production code, and adds a line that matters more with AI: "Tests do not test themselves", it says, and a human must make sure they are valid. Its test question is the one to ask: "Will the tests actually fail when the code is broken?" When one tool writes both the code and the tests, our concern is that the tests confirm what the code does, not what it should do. Look for a test of the wrong user, the bad input and the failed dependency.

5. Lines. Now read all of it. Google's guide allows sometimes scanning "data files, generated code, or large data structures", warns against skimming human-written code, and then says "you should at least be sure that you understand what all the code is doing." We read that exemption as covering machine output such as generated files, and we treat code from an AI assistant as hand-written code that must be understood. Watch for what the guide calls over-engineering, code made "more generic than it needs to be". In our experience AI tools add options, helpers and abstractions nobody asked for. Check that every imported package is real and wanted; in our audits we check every import against the registry, because AI tools sometimes import packages that do not exist.

Diagram of the five-step order for reviewing AI-written code: intent, design, what is missing, tests and lines, with a note that any step can send the pull request back before the next begins
Diagram of the five-step order for reviewing AI-written code: intent, design, what is missing, tests and lines, with a note that any step can send the pull request back before the next begins

Ship faster with senior engineers

Direct collaboration, AI-augmented delivery, and no agency markup.

Get in touch

How big should the pull request be?

Smaller than the AI tool wants to make it. Google's guide on small changes gives a rough scale: "100 lines is usually a reasonable size for a CL, and 1000 lines is usually too large, but it's up to the judgment of your reviewer." It also gives the reviewer a tool: "reviewers have discretion to reject your change outright for the sole reason of it being too large."

DORA's guidance on working in small batches applies this to AI directly: "Avoid the temptation to generate massive pull requests; the cognitive load required to review a small chunk of machine-generated code may be higher per line than reviewing human-written code."

Our rule of thumb: one pull request does one thing, and the reviewer can hold all of it in their head. If an agent produced a large change in one go, ask it to split the work into a series, and review the first piece before the rest is built on it.

What does the author owe the reviewer?

Review starts with the author. Before asking anyone else to read an AI-written change, we expect the author to:

  • Read the whole diff themselves and be able to explain each part.
  • Delete what the task did not need: unused helpers, extra options, speculative abstractions.
  • Run the tests and the checks, and add a test that fails without the change.
  • Write a description that answers the two questions in Google's guide on change descriptions: what change is being made, and why.
  • Point at the risky parts: "this touches billing", "this changes who can see invoices".
  • Point 4 is from Google's guide. The rest are our recommendations. They cost the author minutes and save the reviewer much more.

    What should machines check, and what should people check?

    Use each for what it is good at. In our process, AI handles the volume work in security checking: static analysis, dependency scanning, CVE triage and secrets detection. Senior engineers do the threat modelling and own the secure code review sign-off. The same split works for ordinary review.

    • Leave to automation: formatting, lint rules, type errors, known vulnerability patterns, dependency checks, test runs. A reviewer should never spend attention on something a tool can fail the build for.
    • Keep for a person: whether the change should exist, where the rules live, what is missing, and whether the tests mean anything.

    An AI reviewer can be a useful first pass on a pull request. We would not make it the only reviewer, least of all when the same tool wrote the change. We wrote about one team's use of an AI reviewer in Codex at Ramp.

    Fewer mistakes arriving also helps. If the same review comment comes up twice, write the rule into the agent's instructions file, as we described in what to put in AGENTS.md.

    A checklist for the next AI-written pull request

  • The description says what changed and why. If not, return it.
  • The change does one thing and is small enough to understand fully.
  • Business rules, prices and permissions are decided on the server.
  • Every new route checks who is calling and whether they own the data.
  • Input is validated on the server, and failures of outside calls are handled.
  • Tests cover the wrong user, the bad input and the failed dependency, and would fail if the code were broken.
  • Nothing is there that the task did not need. New dependencies are real, maintained and wanted.
  • No secrets, tokens or personal data in code or logs.
  • You understand every line. If you do not, ask; do not approve.
  • The author can explain the change without the AI tool open.
  • Reviewing this way is part of how we run AI-augmented development: AI handles the repetitive execution, and senior engineers make the decisions. If you want that on your product, see our SaaS development service.

    Sources: Google Engineering Practices, What to look for in a code review, Small CLs and Writing good CL descriptions; DORA, Working in small batches; Google Cloud, Announcing the 2025 DORA Report, 23 September 2025; LeadDev, The AI Code Review Report 2026, public summary. All read on 4 December 2026. Entalogics figures are from our own audit reports.

    COMMON QUESTIONS

    Straight answers.

    Eight questions we get on every first call. If yours isn't here, it'll be the first thing we cover.

    The standard is the same, and the weak points differ. In our experience AI-written code is usually tidy and plausible, so style problems are rare and missing decisions are common: an ownership check nobody asked for, an error path that was never written. The reviewer has to look for what is absent, not only at what is on the page.
    Small enough to understand fully. Google's engineering practices say 100 lines is usually a reasonable size for a change and 1000 lines is usually too large, with the reviewer as the judge. DORA's guidance says the load of reviewing machine-generated code may be higher per line than for human-written code.
    Yes, for code that ships. Google's guide lets reviewers sometimes scan data files and generated code, and asks them to understand what all the code is doing. We read generated code there as machine output such as generated files, and we treat code from an AI assistant as hand-written code for this purpose.
    It can do a useful first pass: obvious bugs, style, known vulnerability patterns. In our process AI runs static analysis, dependency scanning and secrets detection, and a senior engineer owns the secure code review sign-off. We would not make an AI tool the only reviewer, least of all the tool that wrote the change.
    The people who approved it. Our recommendation is a simple rule: the author must be able to explain every part of the change without the AI tool open, and the reviewer approves only what they understand. If neither can explain it, it is not ready.
    Read their own diff first, cut anything the task did not need, run the tests, and write a description that says what changed and why. Google's guide asks a change description to say exactly that: what change is being made, and why. We also recommend saying which parts need the closest look.
    Do not speed up the reading. Shrink what has to be read. Keep changes small, let automated checks handle style and known patterns, write the team's decisions into the agent's instructions file so fewer mistakes arrive, and spend senior review time on changes that touch money, permissions and user data.

    Ready to Build Something Amazing?

    Let's discuss your project and see how we can help you achieve your goals with quality software at fair pricing.