Tech #024•27 min read•21 October 2026 , Wednesday

AI Writes Code Faster Than Humans Can Review It. Build the Pipeline That Keeps Up.

AI agents can open pull requests far faster than any team can read them carefully. Hiring more reviewers won't close the gap. A layered verification pipeline will: one where machines check everything machines can check, and people spend their attention only where judgment is needed.

Rajnish Kumar
Rajnish Kumar

Editor-in-Chief & Founder

AI Writes Code Faster Than Humans Can Review It. Build the Pipeline That Keeps Up. — Tech dispatch hero image

#01Why Code Review Breaks When Agents Join the Team

Code review was designed for a human pace. One developer writes a change over a day or two, opens a Pull Request, and a teammate reads it, asks a few questions, and approves it. The writer and the reviewer move at roughly the same speed, so the system stays in balance. Nobody had to design for the case where one side suddenly gets five times faster.

AI coding agents create exactly that case. An agent can write a feature, a refactor, and a set of tests in the time it takes a human to read one of them. The writing side of the process speeds up. The reading side doesn't. A large Harvard study of 718 companies, published this year, measured the result: after adopting AI agents, teams opened 23% more pull requests, review time per pull request rose 49%, and the amount of finished software did not meaningfully change. The code didn't disappear. It joined a queue.

A helpful way to picture this is airport security. Imagine an airport where every bag is opened and checked by hand by one officer. That works fine when ten passengers arrive an hour. Now a new terminal opens and two hundred arrive an hour. You could hire twenty more officers. But a real airport does something smarter: it puts every bag through an X-ray machine first, sends most bags straight through, and has officers open only the few the machine flags. The officers' skill is spent where it matters, and the line keeps moving.

That's the shift this article is about. Code review, as most teams run it, is the one officer opening every bag. What AI-era teams need is a verification pipeline: a series of automated gates that every change passes through, with human review reserved for the decisions that only humans can make. Code review doesn't go away. It becomes one layer of a bigger system, instead of the whole system.

When writing code gets five times faster, reading it the old way becomes the slowest part of the factory.

#02Why More Reviewers Alone Won't Fix It

The first instinct is to add review capacity: ask more engineers to review, rotate everyone onto review duty, or hire. The Harvard study saw companies do exactly this. The share of engineers doing code reviews went up 14%. It didn't fix the problem, and there are three reasons why it can't on its own.

First, careful review is slow, and it doesn't speed up with effort. The best-known industry data comes from a study of code review at Cisco, published by SmartBear. It found that reviewers find the most defects when they look at no more than about 200 to 400 lines at a time, at a pace of roughly 300 to 500 lines an hour, and that effectiveness drops sharply after 60 to 90 minutes of continuous reviewing. Those are human limits, not process limits. If an agent produces 3,000 lines a day for one reviewer, that reviewer will either take all day or skim. Skimming is worse than not reviewing, because it creates false confidence.

Second, human reviewers spend much of their attention on things machines could check. Is the formatting right? Does it compile? Do the types line up? Is there an unused import? Did a test fail? Every minute a person spends on those questions is a minute not spent on the questions only a person can answer, like "is this the right design?" and "does this actually solve the customer's problem?"

Third, AI-generated code tends to need more review per change, not less. In the Harvard data, the share of pull requests sent back with requested changes nearly doubled, and comments per pull request rose 35%. Agent-written code often looks clean and confident while hiding problems underneath: a missed edge case, a pattern that doesn't fit the codebase, or a quiet change to something outside the task. And that same study found the bottleneck continued even after companies started using AI tools to help review. A faster reader is still a reader.

So the fix isn't more people reading more lines. It's making sure that by the time a change reaches a human, every mechanical question has already been answered, the change is small enough to understand, and the person reviewing it is the right person for that kind of risk.

Adding reviewers to a review bottleneck is like adding lanes to a traffic jam: it helps for a week, then fills up again.

#03The Verification Pipeline: Five Gates

A verification pipeline is the set of checks every change passes through between "an agent wrote this" and "customers are using this." In practice, it has five gates. The rest of this article walks through each gate in turn, but it helps to see all five side by side first, summarized below.

The gates are ordered on purpose. The cheapest, fastest, most automatic checks come first, so that bad changes are stopped early, before anyone spends human attention on them. The expensive gate, human judgment, comes late, and only for changes that actually need it. The last gate exists because no amount of checking before merge catches everything, so the release itself must be built to limit damage.

Each gate also answers a different question. Gate 1 asks "can anyone review this?" Gate 2 asks "does it work?" Gate 3 asks "is it safe?" Gate 4 asks "is it right?" Gate 5 asks "what if we're wrong anyway?" A change only reaches customers after it has a good answer to all five.

Every gate should answer one question, and the cheapest questions should always be asked first.

GateThe question it answersMostly done byExample checks
1. ShapeCan anyone review this?Rules and automationSize limits, one purpose per change, clear description
2. Machine checksDoes it work?CIBuild, types, lint, tests, coverage of changed lines
3. Security and supply chainIs it safe?Security toolsSecret scanning, code scanning, dependency review
4. Risk routing and human reviewIs it right?People, routed by riskDesign, intent, edge cases, ownership
5. Release controlsWhat if we're wrong anyway?Deployment systemMerge queue, feature flags, canary, automatic rollback

#04Gate 1: Shape — Small, Single-Purpose Changes

The most effective review improvement has nothing to do with reviewers. It's making changes smaller. A 100-line change that does one thing can be reviewed properly in a few minutes. A 1,500-line change that does five things can't be reviewed properly at all; it can only be skimmed.

Google's public engineering guidelines put this plainly: "100 lines is usually a reasonable size" for a change, "and 1000 lines is usually too large." The same guide gives the reasons. Small changes are reviewed faster, because a reviewer can find "five minutes several times" instead of blocking out an hour. They are reviewed more thoroughly. They introduce fewer bugs, because their effect is easier to reason about. And they are easier to roll back. Google's guidelines even say a reviewer may reject a change "for the sole reason of it being too large."

This matters even more with agents, because agents naturally produce large changes. Ask an agent to "add user export," and it may update the database layer, the API, the UI, the tests, and three unrelated helper functions it decided to tidy along the way. Google's DORA research team noticed this pattern in its 2024 report, which estimated that a 25% increase in AI adoption was associated with a small drop in delivery throughput and a larger drop in stability. A common reading of that result, including by DX's Laura Tacho, is that AI tends to grow batch sizes, and larger changes carry more risk. DORA's own advice was the old one: keep batches small.

So make size and scope a rule, not a hope. Tell agents explicitly to produce one change per pull request, and to split larger work into a stack of small changes, each building on the last. Google calls this "stacking." Ask every agent pull request to include a short structured description: what changed, why, how it was verified, and what it deliberately did not touch. And enforce the rule in CI, so an oversized change fails immediately and goes back to the agent to split, before any human looks at it.

The example below shows a simple CI check that blocks pull requests above a size limit unless someone adds an explicit label.

A change that's too big to understand isn't reviewed. It's approved on trust.

yaml
# .github/workflows/pr-size.yml
name: pr-size
on: pull_request
jobs:
size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- name: Fail if the change is too large to review well
if: ${{ !contains(github.event.pull_request.labels.*.name, 'large-change-approved') }}
run: |
CHANGED=$(git diff --numstat origin/${{ github.base_ref }}...HEAD \
-- . ':(exclude)*.lock' ':(exclude)**/generated/**' \
| awk '{ added += $1; removed += $2 } END { print added + removed }')
echo "Lines changed: $CHANGED"
if [ "$CHANGED" -gt 400 ]; then
echo "This PR changes $CHANGED lines. Split it into smaller, single-purpose PRs."
exit 1
fi

#05The Agent's Half of the Job: Produce Work That's Easy to Verify

Most advice about reviewing AI code focuses on the reviewer. But a lot of the review burden is decided earlier, by how the agent was asked to work. An agent left to its defaults will often write one large change, describe it in a vague sentence, and leave the reviewer to figure out the rest. The same agent, given clear working rules, can produce changes that are far easier to check. Those rules cost nothing to write, and they apply to every change the agent ever makes.

Most coding agents now read a project-level instructions file before they start work. Different tools use different names, such as AGENTS.md or CLAUDE.md, but the idea is the same: a short document in the repository that tells the agent how this team works. This file is the cheapest place to shape agent output for review. Put the review rules there, not only in the CI configuration, so the agent follows them before CI ever has to reject anything.

Four rules make the biggest difference. First, plan before coding for anything beyond a small fix, and wait for the plan to be approved. Second, keep each pull request to one purpose, and split larger work into a stack. Third, never change a test's expected result to make it pass; if a test seems wrong, stop and say so. Fourth, don't add new dependencies without asking. Each rule removes a whole category of review work, and each one also has a matching check in a later gate, so a rule the agent forgets is still caught.

The other half is the pull request description. A human-written description is often short because the author and the reviewer share context. An agent-written change has no shared context, so the description has to carry it. A good template asks for what changed, why, how it was verified, what the agent deliberately did not change, and anything the agent was unsure about. That last field is surprisingly valuable. An agent that writes "I wasn't sure whether expired discount codes should still apply to existing carts" has just told the reviewer exactly where to look.

Put together, the pull request template every agent change should fill in is listed below, followed by a summary of the four working rules: what to write in the agent's instructions file, why each rule helps the reviewer, and which later gate catches the agent if it forgets.

The cheapest review is the one the agent made easy before a human ever opened it.

  • What changed: a short summary in plain words, not a list of files.
  • Why: the ticket or problem this change solves.
  • How I verified it: the commands run and the tests added or updated.
  • What I deliberately did not change: related code the agent left alone on purpose, and why.
  • Where I was unsure: any assumption or open question the reviewer should check first.
Rule in the instructions fileWhy it helps the reviewerBackup check if the agent forgets
Write a short plan first for anything beyond a small fix, and wait for approvalA wrong approach is caught in two minutes, before any code existsHuman review of the plan
One purpose per pull request, under about 400 changed linesEach change can be read properly in one sittingGate 1: the size check in CI
Never edit a test's expected values or skip a test to make it passPassing tests still mean the code worksGate 2: the test-change check
Never add or upgrade a dependency without askingNo hallucinated or unneeded packages slip inGate 3: the new-dependency check

#06Gate 2: Machine Checks — If a Machine Can Check It, a Human Shouldn't

The second gate is Continuous Integration: the automated checks that run on every change. Most teams already have some CI. The difference in the AI era is how complete it needs to be. The goal is simple to state: by the time a human opens a pull request, every question a machine can answer should already be answered.

The basics are the build, type checks, linters, formatters, and the test suite. These should be required, not advisory. A pull request that fails any of them should not even appear in a reviewer's queue. Many teams also add a check that the changed lines are covered by tests, which is more useful than a project-wide coverage percentage, because it focuses on what this change actually did.

With agent-written code, there is one extra problem: the tests themselves. An agent asked to make failing tests pass will sometimes do it the wrong way, by weakening an assertion, skipping a test, or special-casing the exact inputs the test uses. We covered this in detail in Not Every Action Is Equal: The Risk Ladder Every AI Agent Needs. For the pipeline, it means test changes need their own checks. Flag any pull request that changes both code and the tests for that code. Flag new skip markers, deleted tests, and lowered thresholds. And where possible, keep a set of tests the agent never sees, run only in CI.

A deeper way to check test quality is Mutation Testing. A mutation testing tool makes small deliberate changes to your code, like flipping a > to >= or removing a line, and reruns the tests. If the tests still pass after the code was broken, the tests weren't really checking that code. Running full mutation testing on every change is slow, but running it only on the files a pull request changed is often practical, and it's one of the few automatic ways to tell whether an agent's new tests actually test anything.

The example below shows a CI job that runs the required checks and flags risky test changes for a human to look at.

CI's job isn't to make reviewers' lives easier. It's to make sure reviewers only see changes worth their time.

yaml
# .github/workflows/verify.yml
name: verify
on: pull_request
jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm test -- --coverage --changedSince=origin/${{ github.base_ref }}
- name: Flag weakened or skipped tests
run: |
DIFF=$(git diff origin/${{ github.base_ref }}...HEAD -- '**/*.test.*' '**/*.spec.*')
if echo "$DIFF" | grep -E '^\+.*\b(it|test|describe)\.(skip|only)\b|^\+.*xit\(' ; then
echo "::error::Skipped or focused tests added. A human must approve test changes."
exit 1
fi
if echo "$DIFF" | grep -E '^-.*\b(expect|assert)' > /dev/null; then
echo "::warning::Assertions were removed. Request test-owner review."
fi

#07Let Reviewers See It Running

Reading a diff is a slow way to understand a user-facing change. A reviewer looking at 150 lines of UI code has to imagine how the screen will look and behave. With agents producing more of these changes, that imagining becomes a real cost. A better approach is to let the reviewer see the change running, before it merges.

A Preview Environment is a temporary copy of the application, built and deployed automatically for each pull request, with its own link. Many hosting platforms create these by default for every branch. The reviewer clicks the link, tries the feature, and sees immediately whether it works the way the ticket described. Many questions that would take ten minutes of reading take thirty seconds of clicking. And the preview catches a kind of problem that diffs hide well: the change that is technically correct but feels wrong to use.

Previews can do more than wait for a human to click. Automated end-to-end tests can run against the preview, using a real browser to walk through key flows like sign-up or checkout. Visual comparison tools can take screenshots of important pages and highlight any pixel-level change from the main branch, which catches the agent that "tidied up" a shared style and quietly changed ten other screens. For APIs, contract tests can check that responses still match what other services and mobile apps expect, so an agent can't rename a field without someone noticing.

There are two cautions. Preview environments should never use real customer data or production credentials; they should run on seeded test data, with separate keys. And they cost money to run, so they should shut down automatically when the pull request closes. Within those limits, previews turn review from imagination into observation, which is faster and catches more.

Reading a diff tells you what changed. Clicking a preview tells you whether it works.

#08Gate 3: Security and Supply Chain

The third gate asks whether a change is safe, and it needs its own tools, because security problems are exactly the kind that look fine in a quick read. Veracode's 2025 GenAI Code Security Report tested more than 100 AI models on 80 coding tasks designed around known weakness types, and found that the generated code introduced a security flaw in 45% of cases. When the models had a choice between a secure and an insecure way to do something, they picked the insecure one 45% of the time. That doesn't mean 45% of all AI code is insecure. It does mean security can't be left to whoever happens to review the change.

Three automatic checks cover most of the risk. The first is secret scanning. AI agents sometimes paste a real API key from an example or config file into code. GitHub's push protection, for example, scans changes during the push itself and blocks it if a known type of secret is found, before the secret ever lands in the repository. The second is code scanning, also called Static Analysis: tools like CodeQL or Semgrep that read code for known dangerous patterns, such as SQL built from user input or unsafe file paths, and report them on the pull request. The third is dependency review: checking every new or upgraded package for known vulnerabilities and unacceptable licenses before it's allowed in.

Dependencies deserve special attention with AI, because of a problem researchers call package hallucination. AI models sometimes recommend packages that don't exist. A USENIX Security 2025 paper by Joseph Spracklen and colleagues tested 16 code-generating models across 576,000 code samples and found that, on average, 19.7% of recommended packages didn't exist, with commercial models doing much better than open-source ones. Worse, the same fake names came back again and again for the same prompts. That creates an attack called Slopsquatting: an attacker registers the fake name that models keep suggesting, fills it with malware, and waits for an agent to install it.

The defense is simple and strict: no new dependency enters the codebase automatically. Any pull request that adds a package should fail a check unless that package is on an approved list or a human explicitly approves it. That one rule blocks hallucinated packages, typo-squatted packages, and unnecessary dependencies at the same time.

The example below shows a small check that fails when a pull request adds a package that isn't already approved.

An agent that adds a dependency has changed your supply chain, and a supply chain change deserves a human decision.

typescript
// scripts/check-new-deps.ts — run in CI on every pull request
import { execSync } from "node:child_process";
import { readFileSync } from "node:fs";
const base = process.env.BASE_REF ?? "main";
const before = JSON.parse(execSync(`git show origin/${base}:package.json`).toString());
const after = JSON.parse(readFileSync("package.json", "utf8"));
const approved = new Set(JSON.parse(readFileSync(".github/approved-packages.json", "utf8")));
const names = (pkg: any) => new Set([...Object.keys(pkg.dependencies ?? {}), ...Object.keys(pkg.devDependencies ?? {})]);
const added = [...names(after)].filter((n) => !names(before).has(n));
const unapproved = added.filter((n) => !approved.has(n));
if (unapproved.length > 0) {
console.error(`New packages need human approval: ${unapproved.join(", ")}`);
console.error("Check each one exists, is the intended package, and is actually needed.");
process.exit(1);
}
console.log(added.length ? `New approved packages: ${added.join(", ")}` : "No new packages.");

#09Gate 4: Risk Routing — Send Each Change to the Right Level of Review

By the time a change reaches gate 4, it's small, it builds, its tests pass, and the security tools found nothing. Now comes the expensive part: human judgment. The key idea of this gate is that not every change deserves the same amount of it.

A change that fixes a typo in documentation and a change that alters how refunds are calculated should not wait in the same queue for the same kind of review. Yet in most teams, they do. Both need "one approval from anyone." That wastes senior engineers' time on trivial changes, and it lets risky changes through with a light review from whoever was free.

Risk-Based Review fixes this by sorting each change before it reaches a person, using rules about what it touches. Documentation, tests, and internal tooling are low risk. Ordinary product code is medium risk. Authentication, payments, permissions, data migrations, infrastructure, and anything security-related are high risk. The risk level decides who must review and how many approvals are needed. GitHub's CODEOWNERS file is the simplest tool for this: it maps folders to the people or teams who own them, and with branch protection turned on, changes to those folders can't merge without an owner's approval.

There is one extra rule worth adding for agent-written code: the more of a change an agent produced without close human involvement, the more weight the review should carry. A human who wrote a change and used AI for small suggestions is the author and knows every line. An agent that wrote a whole feature has no one who knows every line until a reviewer reads it. For high-risk areas, that means the reviewer is effectively the first human author, and should be someone who knows that part of the system well.

The table below shows a simple routing scheme.

A one-line docs fix and a change to refund logic should never wait in the same line.

Risk levelTypical pathsReview requiredCan merge automatically after checks?
Lowdocs/, test-only changes, internal scriptsOne approval, any engineer, or an AI reviewer plus spot checksYes, for very low-risk paths if your team agrees
MediumOrdinary application codeOne approval from the owning teamNo
HighAuth, payments, permissions, migrations/, infrastructure, security configTwo approvals, including a code owner; design notes requiredNo, never

#010What Humans Should Actually Review

If machines handle the mechanical questions, what's left for people? The answer is everything that requires knowing what the change is for. That's a narrower job than traditional review, and a more valuable one.

The most important question is whether the change does what was actually asked. Agents are very good at solving the problem as written and surprisingly willing to solve a slightly different one when the original is hard. So the reviewer should start from the task or ticket, not from the code, and check that the change matches the intent, not just the words. The second question is design: does this fit how the system is built, or does it work around it? An agent can introduce a new pattern that technically works but splits the codebase into two ways of doing the same thing. The third is the unhappy path: what happens when the input is empty, the network fails, or the user does something unusual? AI code often handles the main path well and the edge cases poorly.

The fourth question is the one reviewers most often miss: what isn't in the diff? Agents sometimes skip work that should have been done, like updating a related cache, a permission check in a second endpoint, or documentation. A reviewer reading only the lines that changed won't see what should have changed but didn't.

There is also one change in where review happens. For larger tasks, the most efficient moment for human judgment is before the code exists. Ask the agent to write a short plan first: what it will change, in which files, and how it will verify the result. A human reviewing a ten-line plan can catch a wrong approach in two minutes. The same mistake found in a finished 800-line change costs an hour to review and another hour to redo.

The list below sums up a reviewer's checklist for agent-written code.

Machines can tell you the code works. Only a person can tell you it's the code you should have written.

  • Intent: Does the change solve the problem in the ticket, not a nearby easier problem?
  • Design: Does it follow the codebase's existing patterns, or invent a new one?
  • Edge cases: Empty inputs, failures, retries, permissions, and concurrent use.
  • Missing work: Related places that should have changed but didn't.
  • Tests that mean something: Do the new tests check behavior, or just run the code?
  • Future readers: Will someone understand this in a year without the agent's chat history?

#011Using AI Reviewers Without Trusting Them Blindly

AI code review tools are now common, and they are genuinely useful. They can summarize a large change, point out likely bugs, notice inconsistent naming, and explain unfamiliar code to the human reviewer. Used well, they make the human faster. The risk is using them as a replacement for the human instead of an assistant to one.

The Harvard study is a useful warning here. The review bottleneck it measured continued even after companies adopted AI tools to help with review, because human reviewers still made the final call. That isn't a failure of the tools. It reflects what review is for. Someone has to be accountable for deciding that a change is right, and that decision depends on context, like business goals, team conventions, and past incidents, that an AI reviewer usually doesn't have.

A few rules keep AI review in its proper place. Never let the agent that wrote a change approve it, and preferably don't let the same model or the same session review it either, because it shares the same blind spots. Treat AI review comments as a first pass that a human confirms or dismisses, not as a gate that can block or approve on its own for anything above low risk. Give the AI reviewer the same context a human would have, like the ticket, the plan, and the relevant files beyond the diff, or its comments will be shallow. And watch its accuracy: if most of its comments are dismissed, it's adding noise, and noise is the last thing a busy review queue needs.

In the five-gate model, AI review belongs inside gate 4 as a helper, not as a gate of its own. It speeds up the human. It doesn't remove the human.

An AI reviewer can make a human faster. It can't make the human unnecessary.

#012Gate 5: Release Controls — Merging Is Not Shipping

Even with all four gates, some problems will reach the main branch. Tests miss things. Reviewers miss things. The last gate accepts that and asks a different question: if we're wrong, how small can we keep the damage, and how fast can we undo it?

The first tool is a merge queue. When many changes merge each day, two pull requests can each pass their checks alone and still break the build when combined. GitHub's merge queue solves this by testing each change together with the latest main branch and the changes ahead of it, so that the merged result must "pass all required status checks when applied to the latest version of the target branch." With agents opening many more pull requests, this stops the main branch from breaking several times a day.

The second tool separates merging from releasing. Feature Flags let new code be deployed while staying switched off, then turned on for a small group of users first. That way a mistake affects a few users, not all of them. As we explained in Your Feature Flag Is Off. Your Code Is Still Running., a flag doesn't undo everything a deployment does, so database changes and background jobs still need their own care.

The third tool is a Canary Release: the new version goes to a small slice of traffic first, while monitoring compares its error rates and latency with the old version. If the new version looks worse, the deployment stops and rolls back automatically, without waiting for a human to notice. This is the safety net that makes faster merging acceptable. When rollback is quick and automatic, the cost of a missed problem drops from "an incident" to "a few minutes of errors for a few users."

Every gate before release tries to be right. The release gate is designed for the times it isn't.

#013When a Change Fails a Gate: The Feedback Loop

A pipeline with many gates will fail many changes. That's its job. What matters is what happens next. With human authors, a failed check usually means a person reads the error and fixes it. With agents, failures can go straight back to the agent, which fixes and resubmits, often without a human ever seeing the failure. That loop is powerful, and it needs limits.

The first rule is to make failure messages useful to the agent. A check that says "failed" teaches nothing. A check that says "This PR changes 1,140 lines. Split it into smaller PRs, one purpose each" tells the agent exactly what to do. The size check, the test-change check, and the dependency check earlier in this article all print an instruction, not just an error. Clear messages mean fewer retries, and fewer retries mean less noise.

The second rule is to cap the number of automatic retries. This sounds like a cost-saving measure, but it's really a quality measure. Research on coding agents has found that letting an agent see test results and try again many times improves honest success only a little, while also increasing the rate at which agents cheat, for example by editing tests to force a pass. The ImpossibleBench study measured exactly this: with up to ten attempts, the average cheating rate across models went up, because each failed attempt adds pressure to find a shortcut. Three attempts is a sensible starting limit. After that, the change goes to a person with a summary of what failed and what was tried.

The third rule is to give the agent a respectable way to give up. If a gate keeps failing because the task itself is unclear or contradictory, the best result is the agent stopping and saying so, not the agent trying ever more creative workarounds. We covered this idea in depth in Not Every Action Is Equal: The Risk Ladder Every AI Agent Needs. For the review pipeline, it means a pull request that says "I couldn't make this pass without changing the tests, here's why" is a success, not a failure.

The list below sums up a healthy feedback loop.

An agent that fixes its own failures is helpful. An agent that keeps retrying until something passes is dangerous.

  • Every failing check prints an instruction, not just an error.
  • Automatic retries are capped, for example at three, then a human is brought in.
  • Escalations carry a summary of what failed and what the agent already tried.
  • "I'm blocked" is an accepted outcome, and is never treated as worse than a forced pass.
  • Repeated failures are tracked per check, so a check that fails constantly gets fixed or clarified.

#014Managing the Review Queue

Even a well-designed pipeline needs the queue in front of human review to be managed, because agents can fill it faster than any team can empty it. Without limits, the queue grows, reviews get rushed, and the bottleneck simply moves inside the pipeline.

The simplest control is a limit on work in progress. Decide how many open pull requests an agent, or a person running agents, may have waiting for review at once. Five is a common starting point. When the limit is reached, the agent waits or works on something that doesn't need review yet, like a plan. This feels slower, but it keeps the queue short enough that every change gets a real review. A queue of fifty pull requests doesn't get fifty careful reviews. It gets ten careful ones and forty rubber stamps.

The second control is a response-time target. Google's engineering guidance says reviewers should respond within one business day at most, even if only to say when a full review will happen. Make review time visible: how long changes wait for a first response, and how long until merge. When those numbers rise, it's a signal to reduce agent output or rebalance reviewers, not to review faster.

The third control is clear ownership. Every area of code should have an owning team, defined in CODEOWNERS, and review requests should go to that team's rotation, not to whoever happens to be online. Rotations spread the load fairly and stop review from quietly becoming the full-time job of the two most senior engineers, which is a common and costly failure in teams that adopt agents quickly.

The list below sums up the queue controls.

A review queue with no limit doesn't get reviewed. It gets approved.

  • Work-in-progress limit: A cap on open pull requests per agent or per person running agents.
  • Response target: First response within one business day; track it.
  • Ownership: CODEOWNERS for every area, with a review rotation per team.
  • Priority order: Small and high-value changes first; oversized changes go back to be split.
  • Batch planning: Agent work planned against review capacity, not just against coding capacity.

#015Measuring What Matters

If you measure an AI-era team by lines of code, commits, or pull requests opened, AI will look like a huge success, and the review queue will quietly grow. Those numbers measure activity. The numbers that matter measure whether working software reaches customers, and whether it stays working.

The best-known set of delivery measures comes from Google's DORA research program. It groups them into throughput and instability. Throughput includes change lead time, the time from commit to production; deployment frequency; and failed deployment recovery time. Instability includes change fail rate, the share of deployments that need an immediate fix or rollback, and deployment rework rate, the share of deployments that are unplanned because of an incident. If AI adoption is working, lead time should fall and deployment frequency should rise without the instability numbers getting worse.

For the review pipeline specifically, add a few measures of your own. Time to first review and time to merge show whether the queue is healthy. The distribution of pull request sizes shows whether gate 1 is working. The share of pull requests sent back for changes shows how much rework the gates are catching. And escaped defects, problems found in production that were in changes that passed review, show where the pipeline has holes. We looked at what happens when teams track the wrong numbers in AI Agents Wrote 30% More Code. Finished Software Didn't Move.

Pull requests opened is a measure of motion. Changes safely in production is a measure of progress.

#016One Pull Request, Five Gates: A Walkthrough

It's worth following one realistic change through the whole pipeline, because it shows how the gates work together.

An engineer asks an agent to add a discount code feature to checkout. Before writing code, the agent produces a short plan: a new discount table, a validation function, a change to the order total calculation, and an API field. The engineer reads the plan in two minutes and adjusts one thing: discounts must never reduce a total below zero. The agent then opens its first pull request. It's 1,200 lines, covering everything at once.

Gate 1 rejects it immediately for size. The agent splits it into a stack of four pull requests: the migration, the validation logic with tests, the total calculation change, and the API field. Gate 2 runs on each. The third one fails: the agent had changed an existing test's expected total to match its new code, and the check flagging edited assertions sends it to a human. The engineer sees the agent had broken rounding for existing orders, and the agent fixes the code instead of the test. Gate 3 runs too. The agent had added a small package for currency math that didn't exist in the approved list. The check fails, a human looks, finds the existing money library already does the job, and the agent switches to it.

Gate 4 routes the stack by risk. The migration and the total calculation touch payment code, so they go to the payments team's code owners, who need two approvals. The validation logic and API field are medium risk and need one approval. An AI reviewer summarizes each change for the humans first. A payments reviewer notices that discount codes aren't checked for expiry in a second checkout path, which the diff never touched. That's missing work, and only a human who knew the system could see it. Finally, gate 5: the changes merge through the merge queue, ship behind a feature flag, and go to 5% of customers. A day later, with error rates normal, the flag goes to everyone.

The diagram below shows the path.

No single gate caught everything. Together, they caught every problem before a customer did.

One change, five gates

Agent writes a plan

a human checks the approach in two minutes

small, single-purpose PRs

Gate 1, Shape

1,200-line PR rejected, split into a stack of four small PRs

checks pass

Gate 2, Machine checks

build, types and tests run, and an edited assertion is flagged for a human

safe to review

Gate 3, Security and supply chain

an unapproved new package is blocked

approved by the right people

Gate 4, Risk routing

payment changes go to code owners, with an AI summary to help the reviewer

Gate 5, Release controls

merge queue, feature flag, canary to 5%, automatic rollback ready

#017Which Pipeline Do You Actually Need?

Not every team needs every tool on day one. The right pipeline depends on how much agent-written code you merge and how costly a mistake is. A reasonable starting point for common situations is summarized below. Treat it as a floor, not a ceiling.

The pattern behind the table is simple. The more code agents write without close human involvement, and the closer that code is to money, data, or customers, the more of the pipeline you need automated before a human ever looks.

Match the pipeline to how much code you're trusting machines to write, not to how good the machines seem.

SituationReasonable minimum
Individual developer using AI suggestionsRequired CI (build, types, tests); secret scanning; normal review
Small team, agents write some featuresSize limits; CI with test-change flags; dependency approval; CODEOWNERS
Team where agents open many PRs dailyAll of the above, plus risk routing, WIP limits, merge queue, review-time tracking
Payments, health, or other regulated systemsAll of the above, plus two-person review on high-risk paths, plans reviewed before code, canary releases with automatic rollback
Open-source project receiving AI-generated contributionsStrict size limits; required CI before any human review; maintainers may decline oversized or unexplained changes

#018A Practical Checklist

If you're adapting your team's workflow to AI-generated code, this is the short version of everything above, roughly in order of how much it improves things for the effort:

You can't review your way out of a volume problem. You can design your way out of it.

  • Write the review rules into the agent's instructions file: plan first, one purpose per PR, never edit tests to pass, no new dependencies without asking.
  • Limit pull request size in CI, and tell agents to split work into stacks of small, single-purpose changes.
  • Require a structured description on every agent pull request: what, why, how it was verified, and what it didn't touch.
  • Make every mechanical check required: build, types, lint, tests, and coverage of changed lines.
  • Treat test changes as risky: flag weakened, skipped, or deleted tests for human approval.
  • Scan for secrets and dangerous code patterns on every change.
  • Block new dependencies unless approved, to stop hallucinated and malicious packages.
  • Give reviewers a running preview of every user-facing change, with end-to-end and visual checks against it.
  • Route review by risk with CODEOWNERS; high-risk paths need code owners and two approvals.
  • Review plans before code for larger tasks.
  • Use AI review as a helper, never as the approver, and never from the agent that wrote the change.
  • Cap automatic retries when a change fails a gate, and accept "I'm blocked" as a valid result.
  • Limit work in progress and track time to first review.
  • Separate merge from release with a merge queue, feature flags, and canary deployments with automatic rollback.
  • Measure delivery, not output: lead time, deployment frequency, change fail rate, and escaped defects.

#019What a Pipeline Can't Do

A verification pipeline makes it much harder for bad changes to reach customers. It doesn't make anything correct by itself. Every automated check only verifies what someone thought to check. Tests only cover the cases someone wrote. Security scanners only know known patterns. A change can pass every gate and still be the wrong feature, because nobody wrote down what the right feature was.

Pipelines also add friction, and too much friction has its own cost. If every change needs five approvals, people find ways around the process, or stop improving the code at all. The gates should be strict where mistakes are expensive and light where they're cheap. That's the whole point of routing by risk.

And no pipeline replaces understanding. The deepest risk of AI-generated code isn't any single bug. It's a codebase that grows faster than anyone's understanding of it. A pipeline can keep each change safe. Only people can keep the whole system understood: by reading plans, owning areas, and making sure that for every important part of the code, someone on the team actually knows how it works.

A pipeline can stop bad changes. It can't make sure anyone still understands the good ones.

#020The Short Version

AI agents have made writing code much faster than reading it. Code review, designed for a human pace, can't absorb that on its own, and adding more reviewers only delays the problem. The answer is to turn review from one human step into a pipeline of five gates.

Keep changes small and single-purpose, so they can actually be reviewed. Let CI answer every question a machine can answer, including whether tests were quietly weakened. Scan every change for secrets, dangerous patterns, and new dependencies. Route each change to the right level of human judgment based on its risk, and have people focus on intent, design, edge cases, and what's missing. Then release carefully, with a merge queue, feature flags, and automatic rollback. Manage the queue, and measure delivery rather than output.

Do that, and faster code writing can finally turn into faster software.

#021Sources

Every figure and recommendation above comes from the research and documentation listed below.

Found this useful? Share it

Have a technical response or architectural perspective to share with the engineering desk?

Submit Engineering Feedback