Does AI-written code make a codebase fragile?
Not by nature, but often by volume. Studies find more issues in AI-written changes, issues that linger after merge, and code review slowing as AI output grows. Some evidence cuts the other way: AI-written tests can match human ones. The fix is small changes, real test checks and time for reviewers.
Source: fion.ac/jellyfish.pdf
AI-written code makes a codebase fragile when it arrives faster than the team can check it, and the measured evidence says that is what often happens in practice. The studies that count defects find more issues in AI-written changes, and the best large study of real companies finds the strain landing on code review. Some evidence points the other way, though, and that matters for what you do next.
As a test engineer, I am not too concerned with whether AI-generated code looks pretty. I care whether anyone can tell when it breaks. That is the lens for everything below.
The claim that started the argument
Evan Merz's post "AI usage generates a fragile codebase", published on 7 November, gives four reasons AI-heavy codebases get brittle: shallow tests, over-built code, fewer people who understand the system, and pull requests arriving faster than anyone can read them. He also describes incidents piling up where he works.
It is a well-written post, and a lot of it will ring true to anyone who reviews code. But it is one engineer's experience, with no counts and no comparison group. The useful question is which parts of it the measured studies back up.
What the Harvard study actually measured
The strongest evidence is a working paper by Fiona Chen and James Stratton at Harvard, "Artificial Intelligence in the Firm: Bottlenecks in Software Production". The current version, dated 19 November 2026, uses data from the engineering analytics firm Jellyfish covering 720,542 workers at 655 firms from January 2021 to August 2026. It compares firms before and after they adopted AI tools, using differences in when each firm adopted them.
The headline is that code went up a lot and finished work went up much less. After firms adopted AI coding agents, lines of code rose 44.0%, commits 36.0% and pull requests 35.7%. Resolved Jira issues, the closest thing to shipped work, rose 13.7%, and the authors call that effect only borderline significant.
The bottleneck they found is review. After agents arrived, the time from a change being submitted for review to being merged rose 56.1%. The share of changes getting at least one review comment rose 13.1%, and comments per change rose 38.6%. AI review tools did not clear the queue: 79.1% of firms had adopted one, yet humans still wrote the overwhelming majority of reviews and comments.
The paper's own model also assumes AI lowers the quality of code entering review, so each change takes more effort to check. One engineer interviewed for the paper described new rules requiring senior sign-off for AI-generated code after outages caused by AI commits. That is a single interview, not a measured outage rate, but it is the same story Merz tells.
A note on versions. ComplexDiscovery's October write-up of an earlier draft reported time to merge up 49% and formal change requests nearly doubling. The November version gives different figures. The direction is the same, but quote the version you actually read. ComplexDiscovery also points out that Jellyfish has a commercial interest and a partnership with the authors, and that the paper had not been through peer review.
What the Harvard study does not measure is bugs. It shows review getting slower and heavier. It does not show production breaking more often. For that, you need other studies.
The studies that count defects
CodeRabbit, which sells AI code review, compared 470 open-source pull requests in a December 2025 report. AI co-authored pull requests averaged 10.83 issues against 6.45 for human-only ones. Logic and correctness problems were 75% more common, and security issues up to 2.74 times higher. The authors admit they could not confirm authorship directly, so some "human" pull requests may have had AI help.
A larger academic study, "Debt Behind the AI Boom" by Yue Liu, David Lo and colleagues, followed 302.6k verified AI-authored commits across 6,299 GitHub repositories. Between 7.5% and 14.8% of each assistant's commits introduced at least one issue, and 89.3% of the issues found were code smells rather than outright bugs. The number that matters for fragility is persistence: 22.7% of the AI-introduced issues they tracked were still in the latest version of the code. Debt that goes unpaid is exactly what makes a codebase brittle.
A third paper looked at 1,210 merged bug-fix pull requests written by coding agents in Python projects. In my opinion, its conclusion belongs on every developer's wall: merge success does not reliably reflect post-merge code quality. The same paper found that differences between agents mostly vanished once you adjusted for how much code each change touched. Bigger changes carry more problems, whoever writes them.
The vendor surveys go further, but they are less credible. Cortex's 2026 benchmark reported incidents per pull request up 23.5% and change failure rates up about 30%, alongside pull requests per author up 20%. Its blog describes a survey of over 50 engineering leaders and does not explain how the metrics were collected, so I treat it as a signal, not a measurement.
The evidence that cuts the other way
The most surprising result, to me, is about tests, the very thing Merz says AI does worst. Douglas Leith scored hundreds of real tests from Django and Pandas using fault injection and a design rubric, and found that tests written by recent Claude models were no weaker than the human-written ones. That is one preprint on two Python projects. However, it measured test strength directly, and it does not support "AI only writes trivial tests" as a general rule.
Code size is another twist. A September preprint comparing 787,562 pairs of human and AI functions found the AI versions about half as large and as branched as the human code. The security picture split by language: more findings, and more severe ones, in Python and Java, but fewer high-severity memory-safety findings than humans in C. Whether "AI code is worse" depends on what you are writing.
Google's 2025 DORA report, based on nearly 5,000 professionals, describes AI as a "mirror and a multiplier". It found AI adoption linked to higher delivery throughput, and 59% of respondents said AI had improved code quality. That is self-reported, and 30% said they had little or no trust in AI-generated code. Still, the framing fits the rest of the evidence: teams with good habits get faster, and teams with weak ones get their weaknesses amplified.
The PHP2Shell story is about old code, not new
The IEEE Spectrum piece in this debate is easy to misread. PHP2Shell was a critical flaw in PHP itself, found by a researcher at the security firm Calif who was aided by AI tools. The underlying bug had been reported back in 2024 but was treated as a plain crash. AI did not write the weakness. It helped find and exploit one that humans had left in place.
The PHP Foundation's own write-up shows the side effect. It rated the flaws 9.2 on the CVSS scale and said AI-assisted research had raised the volume of reports, with more than 100 reports that were invalid, duplicates or could not be reproduced. A person still makes every decision and works on every patch.
This, to me, is the real link to fragility. If AI makes weaknesses cheaper to find, then every bug in any codebase, human or AI-written, is worth more to an attacker. Code that piles up unreviewed debt becomes riskier faster than it used to.
What to do with this
Put together, the evidence says AI code is not fragile by nature, but it is fragile by volume. More code arrives, review slows down, issues persist, and a merge is a poor signal that a change is sound. Banning the tools does not fix any of that. Moving effort to where the bottleneck now sits does.
In practice, that means keeping AI pull requests small, since issue counts track change size. It means judging tests by whether they catch injected faults rather than by line coverage, which works whether a person or an agent wrote them. It means tracking how long changes wait for review and how many issues survive merging, not just how many pull requests you ship. And it means giving reviewers time, because the Harvard data suggests that is now the scarce resource.
The one thing I would not do is assume a green merge means a safe change. The studies above say it does not.
AI helped draft this from the source linked below, and a person checked it against that source before publishing.