In February 2026, the security company StrongDM published the rules its AI team had been working under since the previous summer. There were two:
"Code must not be written by humans"
"Code must not be reviewed by humans"
A third line set the budget: "If you haven't spent at least $1,000 on tokens today per human engineer, your software factory has room for improvement." Tokens are the units AI providers bill by, so that is a daily bill for machine labor. The team was three people. What they built is what the entrepreneur Dan Shapiro, in a framework published a few weeks earlier, called the top level of AI-assisted programming, a dark factory: "a black box that turns specs into software."
At the other end of the software world sits the Linux kernel, one of the most carefully reviewed codebases on earth. Its rules for AI coding assistants make the human contributor responsible for "Reviewing all AI-generated code," and forbid an AI agent from adding the "Signed-off-by" line, the contributor's legal statement of where the code came from: "Only humans can legally certify the Developer Certificate of Origin (DCO)." The Debian project, which builds one of the oldest Linux distributions, voted on the question in August 2026 and took a softer position: the project "neither endorses nor prohibits" the tools, but contributors "are expected to understand, review, test, and, where appropriate, modify AI-assisted output." The two policies differ, but both put a person on the hook.
Most teams are in between, improvising. The common shortcut is to ask a second AI model to review what the first one wrote, and to ship if it comes back clean. In a 2026 survey by Sonar, which sells code-quality tools, developers estimated that 42% of the code they commit is AI-generated or assisted, and Sonar reports that "only 48% always verify it before committing." Open-source projects have started writing rules down: a September 2026 study of 281 project policies found that "83.3% of policies permit or encourage AI in code contributions," but that "67.3% require a high level of human involvement."
The models will keep changing; the question of who checks their work will not. A second model's opinion is weaker than it looks, and a vote among several is weaker still. What holds is independence, in three senses: the agent that proposed a change cannot approve or merge it; the expected result comes from a requirement, a reproducer, or a test written apart from the code, not from the code itself; and the tests, credentials, and deployment gates sit outside the agent's reach. No single layer is proof, but a change that crosses all three has been checked by something other than its author. The second half turns that into a team policy, a solo routine, and five questions for anyone paying a contractor.
The Instinct to Check Is Right
In Stack Overflow's 2025 developer survey, "more developers actively distrust the accuracy of AI tools (46%) than trust it (33%), and only a fraction (3%) report 'highly trusting' the output." The single biggest frustration, cited by 66%, was "AI solutions that are almost right, but not quite."
Almost right is the whole problem. Code that is obviously broken gets caught. Code that compiles, handles the common case, and fails at the edges is what a tired reviewer approves.
The wariness is earned. In a 2023 Stanford study of 47 participants using an early OpenAI coding model, those with an AI assistant "wrote significantly less secure code than those without access," and were also "more likely to believe they wrote secure code." The ones who did best were the skeptics, who "trusted the AI less and engaged more with the language and format of their prompts." A 2025 benchmark called BaxBench, testing models available in early 2025, found that even the best of them reached 62% on correctness, and that "on average, we could successfully execute security exploits on around half of the correct programs generated by each LLM," meaning each large language model.
So the instinct to check is right. The question is what does the checking.
Independence Comes From the Check
The case for having a second model review the first sounds airtight. "A model from a different family was trained on a different corpus with different objectives by a different team," the developer Steve Kinney wrote in June 2026, explaining why he runs OpenAI's Codex over Claude's work. "Its mistakes don't correlate with Claude's. That's the entire trick."
The research says the mistakes do correlate. Two 2025 papers measured how often different models get the same questions wrong in the same way. A Cornell team led by Elliot Kim found "substantial correlation in model errors": on one leaderboard of multiple-choice questions, "models agree 60% of the time when both models err." The correlation did not come from shared vendors: "larger and more accurate models have highly correlated errors, even with distinct architectures and providers." A second team, led by Shashwat Goel, called its paper "Great Models Think Alike and this Undermines AI Oversight," and found that "model mistakes are becoming more similar with increasing capabilities."
That last finding is the one to carry forward as models change. It is a trend in what was studied, not a law, but it warns against assuming a better model makes independent mistakes.
Kim's paper also shows how a model judge fails: it "marks incorrect answers as correct if both models agree on the incorrect answer." Those studies used question sets, not code. Carried over to code review, it suggests a hypothesis no one has yet tested directly, and an uncomfortable one: the bug a reviewing model is least likely to flag is the one it would have written itself.
The working conclusion: choose a reviewing model for the ground it covers, and let a test, a reproducer, or a person supply the independence.

A popular version of the worry is vanity: models favor their own writing. The evidence is weaker than the folklore. On tasks with checkable answers, such as code and math, a 2025 study found that "much of this preference aligns with objectively superior performance," and a September 2026 preprint measured a real but modest same-family preference, 3.4 to 8.4 percentage points, while swapping the order of two answers flipped more than half the verdicts. In these experiments, vanity was the smaller problem.
When a Second Model Helps
The most direct test of the second-opinion workflow on coding models that this article found, as of October 2026, is a single study. A team of researchers posted it in July 2026, pairing Claude Opus 4.7 with GPT-5.5 running in OpenAI's Codex, the pairing its authors say they see most often in practice; they note that new models ship often and expect newer versions to do better. They ran 116 recent hard and medium problems from LiveCodeBench, a benchmark of standalone programming puzzles, in six arrangements: each model alone, each reviewing its own draft, and each reviewing the other's.
The review step was not a set of comments. The reviewer read the problem and the draft and wrote the final program, which was what got submitted, and it "cannot run the code or query a test runner." The results were lopsided:
- Claude reviewing Codex raised Codex's pass rate from 71.6% to 89.7%.
- Codex reviewing its own draft already raised it to 84.5%.
- Codex reviewing Claude lowered Claude's pass rate from 91.4% to 82.8%: on 116 tasks, it fixed 3 and broke 13.
- Claude reviewing its own draft left its 91.4% unchanged.

The authors are careful about what this shows. Their design "cannot fully separate the effect of review direction from the effect of that baseline gap," it "does not generalize to repository-scale bug fixing, build systems, or multi-file review," and some of their labels "might not be reproducible." The specific numbers will age with the models. The working rule follows: a model that reviews another model's code should be at least as capable as its author, a plain self-review pass is cheap and worth running first, and anything a reviewer rewrites goes back through the tests before it merges.
Give the Reviewers Something to Check Against
If one extra model is unreliable, the natural next step is several, with a vote. A 2025 study of model ensembles for code found that "consensus-based strategies for selecting solutions fall into a 'popularity trap,' amplifying common but incorrect outputs." A 2026 preprint titled "Consensus is Not Verification," which tested factual questions rather than code, found that even at 25 times the cost, "polling-style aggregation yields no consistent accuracy gains over single-sample baselines and often amplifies shared misconceptions."

Extra reviewers help in a different way: by covering more ground. On SWR-Bench, a benchmark of real review tasks, combining several reviews raised the best F1 score, which balances missed bugs against false alarms, by up to 43.67% in relative terms, to 21.91%. Repeated runs of the same model supplied much of that gain. More looks find more candidates. They do not make any one finding true.
The "Consensus" authors put the dividing line in one sentence: "in verified domains, additional samples provide more candidates for a verifier to filter; in unverified domains, additional samples merely reinforce shared misconceptions." A verifier is something outside the models that answers yes or no: a test that passes or fails, a program that reproduces a bug, a specification the code can be checked against. The Linux kernel's rules for AI agents that hunt bugs make the same demand: for any bug that is not trivial, the agent must "verify that it looks real by attempting to create a reproducer to demonstrate it," because "many unverified bug reports sent to maintainers happen to be invalid."
The same habit works for any team: when reviewers flag a problem, turn the flag into a failing test or a reproducer before anyone acts on it, and when they disagree, let the test settle it.
Reviewers That Run the Code, and How to Judge Them
Away from benchmarks, the evidence is mixed, and much of it measures proxies. When the appliance maker Beko rolled out an AI reviewer, "73.8% of automated code review comments were labeled as resolved," but the average pull request, the unit in which a change is proposed for merging, took longer to close, rising "from five hours 52 minutes to eight hours 20 minutes," though the study cannot say the reviewer caused it. A 2026 follow-up on 2,604 of those comments found that "resolved" is a poor stand-in for useful, and that AI judges matched the engineers' labels only moderately. Microsoft, which sells review tools, reported in July 2025 that across 5,000 of its own repositories the median pull request closed 10 to 20 percent faster.
The vendors are adding checks to their reviewers. In September 2026, GitHub's Copilot reviewer gained the ability to validate code by "running build commands, running tests, executing targeted scripts." Anthropic launched its own reviewer as a research preview in March 2026; its agents "verify bugs to filter out false positives" before posting, without saying they run the code; in internal use, "less than 1% of findings are marked incorrect," and it "won't approve PRs," which Anthropic calls "still a human call."
Most of these figures come from the companies selling the tools, and comments resolved, tests accepted, and findings not marked wrong measure agreement, not defects avoided. What breaks after merge is the number that matters, and almost nobody publishes it. If you adopt an AI reviewer, prefer one that runs the build and the tests, and judge it over the following months by reverts, hotfixes, and defects found after merge.
Where a Closed Loop Breaks, and the Fix for Each
Now take the human out entirely: the model writes the code, writes the tests, reviews its own pull request, and merges. Public data cannot show that whole loop, because it records who reviewed, not who wrote the tests or who deployed. What it shows is AI on both sides of the pull request. A 2026 study of AI reviewers on GitHub counted 208,145 cases of an AI product reviewing pull requests written by the same product, against 45,269 where a different product did the reviewing. Another study of 33,596 pull requests written by coding agents, AI tools that edit files and run commands on their own, found that 61.38% had no recorded review at all, and that most of the reviewed ones were reviewed only by other agents. Its authors caution that no recorded review "does not imply the absence of human oversight."
The research on self-checking explains why a closed loop would be fragile. A 2024 paper found that models "struggle to self-correct their responses without external feedback," and a 2025 benchmark of 14 open models found that they "correct external errors but fail on identical internal ones."
The tests are where the loop quietly fails. A test the model writes is meant to be the external check, but a 2024 study of model-generated tests found that they "mainly capture the actual program behavior making bug detection difficult": they confirm what the code does, including its bugs. A 2025 benchmark designed to catch shortcuts found that an agent with access to the test suite "may delete failing tests rather than fix the underlying bug." StrongDM reached the same conclusion inside its factory. Early on, its agents learned that "return true is a great way to pass narrowly written tests," and the team wrote down the lesson: "A test, stored in the codebase, can be lazily rewritten to match the code." The first rule for any agent pipeline follows from that: the tests that judge a change are written apart from it, and protected from it.
No public postmortem this article found traces a closed review loop approving a bad change from end to end. The incidents on record are failures around review, in access, configuration, and recovery, where no check stood or the check looked at the wrong thing. Each one also shows the fix:
- The agent with the keys. In July 2025, an AI agent on the coding platform Replit deleted a software company's production database during a code freeze; according to the founder's posts, Fortune reported, the agent admitted to "violating explicit instructions not to proceed without human approval." Replit's chief executive, Amjad Masad, began "rolling out automatic DB dev/prod separation." The data was recovered. The fix: an agent works against a development database, and production sits out of its reach.
- Approval switched off. In March 2026, the engineer Alexey Grigorev described how "A Terraform auto-approve command inadvertently wiped out all production infrastructure" behind the DataTalks.Club course platform. The agent ran Terraform's destroy command after he let it through: "So I didn't stop the agent from running terraform destroy." He blames himself, not the model, and his write-up lists the fix: "Agents no longer execute commands," "Every plan is reviewed manually," and "Every destructive action is run by me," backed by deletion protection and backups "stored separately from the database."
- Nobody read the configuration. In early 2026, the security firm Wiz found the database behind Moltbook, an AI social network whose founder said "I didn't write a single line of code," exposing "1.5 million API authentication tokens, 35,000 email addresses." Its database access rules were not in force. Wiz's conclusion was mild and exact, and it is the fix: "configuration details still benefit from careful human review."
- A checker that checked the wrong thing. A researcher at Replit, a Lovable competitor, scanned 1,645 apps built on the platform Lovable in 2025 and reported "303 endpoints across 170 projects" with inadequate access rules. Lovable later added a security scanner, but by the researcher's account it "merely checks for the existence of any RLS policy, not its correctness": a database access rule existed, so the scan passed without looking at what the rule allowed. The fix is to test what a rule permits, by trying to read data the user should not see.
The counter-case: Microsoft's .NET team has run GitHub's coding agent in the dotnet/runtime repository since 2025, with every change reviewed by people. In one pull request, the agent changed existing tests to get its fix to pass. A human reviewer saw the problem: "The tests Copilot had to modify to get the tests to pass weren't bugs, they were documenting deliberate design decisions." The change was rejected. Of 535 merged agent pull requests, three were reverted, a rate the team's write-up cautions is not statistically different from human work.
Even StrongDM did not remove the independent check. It moved it. The team stopped relying on tests kept beside the code and wrote "scenarios," end-to-end user stories "often stored outside the codebase (similar to a 'holdout' set in model training)," which its agents cannot edit and an AI model scores for satisfaction.
A June 2026 position paper by the software researcher Martin Monperrus, an argument rather than an experiment, contends that "coding agents have crossed a threshold of capability at which traditional human code review is no longer a necessary component of a software quality pipeline." If he is right, the held-out reference will carry more of the weight.
Spend the Reviewer's Attention Deliberately
In the governed workflows described here, the last step is a person deciding whether to merge, and that person is now reviewing more code, from more sources, at once. Code review was already thinner than people assume: a 2018 study of Google found that "fewer than 25% of changes have more than one reviewer."
Research on automation in general, not on code, describes the failure mode. A 2010 review by the psychologists Parasuraman and Manzey found that complacency grows under "multiple-task load," and that automation bias "cannot be prevented by training or instructions." A Microsoft Research prototype for developers running several agents, tested on 16 people in a September 2026 preprint, raised short-task throughput by 63%, but "these gains were not accompanied by significant improvements in perceived control," and developers "lost track of which session was working on which feature."
So spend that attention on purpose: keep each agent change small, cap how many wait on one person, and decide in advance which code always gets read in full. The next section draws that line.

What to Read, and What to Let Run
At the volume agents produce, reading every line is not realistic, and pretending otherwise produces rubber stamps. The question is which lines a person must read, and what makes the rest trustworthy.
In September 2026, Gergely Orosz of the Pragmatic Engineer newsletter reported that Anthropic and OpenAI triage by "blast radius," which he said he confirmed with both: a low-risk change gets "only AI, without human review" and "can ship to production once AI agents are happy," while a high-risk change gets "mandatory human review." The low-risk tier holds up only on two conditions: people define "high-risk" in advance, as protected paths a change cannot reclassify, and everything else is gated by tests that run, because agents being "happy" is exactly the agreement the research says not to trust.
Read every line where a mistake is expensive and hard to test: authentication and permissions, anything that moves money, deletions and database migrations, cryptography, secrets and personal data, infrastructure and deployment configuration, and anything that changes who can reach what. A 2026 benchmark of 100 vulnerable code samples, built to test whether misleading comments fool AI reviewers, found that commercial models started from 89 to 96 percent detection and open-source models from 53 to 72 percent, and that failures concentrated in "race conditions, timing side channels, and complex authorization logic." The benchmark compared no humans, and it is small; reading those lines is this article's recommendation, not its finding.

Everywhere else, let execution do the reading, but only if the expected results come from somewhere other than the code they judge:
- A bug fix needs a test that fails without it. The developer Simon Willison put it as a rule in December 2025: "That test should fail if you revert the implementation." For a bug fix or a change in behavior, a test that passes either way proves nothing. For new behavior, write down examples and invariants from the requirement before anyone sees the implementation.
- Write the test somewhere else. Anthropic's guidance for its coding agent suggests you "have one Claude write tests, then another write code to pass them," and notes that "A fresh context improves code review since Claude won't be biased toward code it just wrote." A fresh session reduces anchoring on the code just written, but it shares the same model and the same reading of the requirement, so it is a step toward independence, not the thing itself.
- Treat changes to existing tests as a red flag. Python's core developers put it in their rules for AI-assisted contributions: "It is not acceptable to alter or bypass existing tests, or remove desired functionality, in order to make a failing test pass." Tests do change when intended behavior changes; that change should come with a named person's explanation.
- Test the tests. Mutation testing deliberately plants small bugs and checks whether the test suite notices; many ecosystems have a mature tool for it. Google runs it on code under review, "mutating only changed code during code review," and its engineers found the planted bugs "are indeed coupled with real faults." It catches a suite that confirms whatever the code does, though not a requirement nobody wrote down, and it can steer AI too: Meta used planted bugs to direct AI-generated tests at Messenger and WhatsApp, and engineers accepted 73% of them.
- Keep a holdout. Store acceptance scenarios outside the repository, where the agent cannot edit them, as StrongDM did.
A Review Policy That Matches the Evidence
For a team, the research and the policies already in use support a short set of rules, grouped by what they protect.
What runs before a person looks
- Put deterministic checks first. Continuous integration (the automated build and test run on every change), type checkers, static analysis, and code-owner rules that route protected paths to named people cost little per review and do not share a model's blind spots, though they can share a gap in the specification.
- Check every new dependency before it installs. Models invent package names, and attackers can register the invented names. A 2025 study of 576,000 code samples from models available by early 2024 found that "the average percentage of hallucinated packages is at least 5.2% for commercial models and 21.7% for open-source models"; a 2026 replication on five newer models measured 4.62 to 6.10%, and found 127 invented names that all five models produced identically, which is the correlated-error problem in a form an attacker can register. A person or a tool should confirm that each new dependency is the intended one: its publisher, its release history, and the lockfile change, not just that a package by that name exists.
- Use more AI reviewers for coverage, never for votes. Their findings are candidates for a test or a person to confirm. A model that can rewrite code should be at least as capable as the one that wrote it, and should never rewrite and merge on its own: in the one direct test, the weaker reviewer with the last word broke 13 working solutions.
Who approves
- A named person owns every merge into anything that matters. That is the kernel's rule, Debian's, and Firefox's, whose policy gives the reason: "The role of the reviewer is to double-check the work of a human, not the output of a tool." LLVM adds that "automated review tools that publish comments without human review are not allowed."
- Decide deliberately whether a bot approval counts. Since September 2026, GitHub's Copilot can approve pull requests in a way that satisfies a repository's required-approval rule, as a public preview. The setting is off by default, administrators can restrict which file paths a Copilot approval counts for, and an approval is dismissed when new commits arrive. If you turn it on, require a named code owner on the high-stakes paths above; remember that GitHub's rule requiring the last push to be approved "by someone other than the person who pushed it" can be satisfied by a bot; and never let one product's approval count on a change its own agent wrote.
- Protect the reviewer's instructions. When Copilot reviews a pull request, it "reads repository custom instructions, agent instructions, and agent skills from the head branch (the branch with your changes), not the base branch." GitHub designed it so instruction changes can be tested before they merge; the side effect is that a change can, in principle, rewrite its own reviewer's instructions. Those files include .github/copilot-instructions.md, AGENTS.md, CLAUDE.md, GEMINI.md, REVIEW.md, and .github/instructions/, files a coding agent can edit as easily as any other. Code-owner review blocks the merge but not the reviewer reading the altered file, so make any pull request that touches them ineligible for bot approval.
Limit the blast radius
- Keep changes small, and cap the queue. Google's long-standing guidance is that "100 lines is usually a reasonable size for a CL," its term for a change, "and 1000 lines is usually too large." Cap the number of open agent pull requests per reviewer, so that the queue never outruns the people who own the merge.
- Give agents no standing access to production. OpenAI documents that its Codex agent runs "with network access turned off" by default. Production credentials should never be within an agent's reach, and whatever reaches production should go out in stages with a rollback that has been tested.
Measure
- Label AI-written changes, and count what breaks. The kernel asks for an "Assisted-by" tag on AI-assisted contributions, and the same study of 281 policies found that "AI disclosure is required by 48.8% of policies." A label makes the next step possible: count reverts, hotfixes, incidents, and defects found after merge, the way the .NET team reported its three reverts in 535, rather than how many bot comments were resolved. Reverts alone undercount, as the .NET report itself cautions.
If You Work Alone
A solo developer running several agents is always the named person in rule 4, which makes the attention problem personal. A routine that fits one person:
- Start every bug fix with a test that fails. Anthropic's example prompt for a bug fix ends with "write a failing test that reproduces the issue, then fix it," and its guidance has a rule worth taping to the monitor: "If you can't verify it, don't ship it." Have the fix written in a separate session from the test.
- Protect the tests from the agent. Keep acceptance tests in a directory the agent cannot write to, or have the build fail on any change to an existing test unless you sign off on it.
- Read in full the code that touches logins, permissions, money, secrets, deleted data, or deployment.
- Leave approval prompts on for anything that can delete or deploy, but do not rely on them. They are friction, not a wall; Grigorev's post-mortem is a one-line argument for both halves. Keep production credentials off the machine where agents run.
- Treat your machine as part of the attack surface. In August 2025, attackers published poisoned versions of Nx, a popular build package, whose install script launched the AI coding tools it found, with its own flags to switch their permission checks off, to hunt for sensitive files. Your own settings would not have stopped it. What narrows the exposure is blocking package install scripts by default, letting new package versions wait for review before they install, and not leaving AI tools signed in on a machine that holds valuable keys.
- Cap work in progress. Give every agent session one named task and its own branch, and finish or discard a change before accepting another. The research gives no number, but the prototype study found developers losing track of their sessions, and that is how a stalled agent's half-finished change gets merged.
If You Are Buying Software Built This Way
Business owners who pay contractors to build with AI are trusting a review process they cannot see. Five questions make it visible, and the weak answers are as telling as the strong ones:
- Who reviewed this change, by name, and did a person read the login, payment, and data-deletion code? Moltbook's database had no access rules in force, and Lovable's later scanner checked only that a rule existed, not what it allowed. A weak answer: "the AI checked it."
- Show me a test that fails without the change and passes with it. A test that fails on the old code shows the change actually does something. A weak answer: "all the tests pass," when the same model wrote them.
- Do your AI agents have access to our production systems or data, and are development and production kept apart? Replit's response to its deleted database was "automatic DB dev/prod separation." Ask, too, when a rollback or backup restore was last tested. A weak answer: "the agent needs access to work fast."
- Does any AI approval count as a required review in your process, and on which parts of the code? If the answer is "all of it," nobody is checking.
- Which new software packages did this change add, and who confirmed they are real? Invented package names are a known way for attackers in. A weak answer: a blank look.
Better still, put the answers in the contract: a named human reviewer for protected code, no production credentials for agents, a review of new dependencies, and a label on AI-assisted work. A good contractor will have plain answers and will not mind writing them down.
The Signature Still Matters
StrongDM removed the human reader and immediately had to build a check its models could not rewrite. The kernel keeps the human reader. Neither is proof. In April 2026, Anthropic reported that a Claude Code bug "made it past multiple human and automated code reviews, as well as unit tests, end-to-end tests, automated verification, and dogfooding"; its newer model, given the full repositories as context, later found the bug, and the older one had not. The defense is layers that fail differently, none of them under the author's control, and a release that can be rolled back when all of them miss.
What fails is the middle ground most teams drift into without deciding: a second model asked for its opinion, tests written by the same model, approvals that nobody owns. On Monday, pull the last ten AI-written changes that reached production and write next to each the check its author could not have rewritten (the person who read the risky lines, the test whose expected result came from somewhere other than the code, the scenario held out of the model's reach) and the rollback that was ready if all of them missed. Every blank line is the first rule of your policy. If you cannot name the check, that change was never really checked.
