Greptile Study: AI-Generated Code Now Matches Human Quality

By LatestLLM Editorial ·

Greptile Study: AI-Generated Code Now Matches Human Quality

Daksh Gupta of Greptile reveals that over 25% of enterprise PRs are now AI-generated, with revert rates and bug severity comparable to human developers.

Key takeaways

  • AI-generated pull requests in enterprise codebases grew from <1% to over 25% in a single year.
  • Revert rates for AI agents (Codex, Devin) are statistically comparable to human developers.
  • AI agents are sometimes less likely than humans to introduce critical P0 bugs.
  • Different models have distinct failure modes: Claude is more prone to SQL injection, while Cursor often creates N+1 query issues.
  • Enterprise validation is shifting toward sandboxed browser agents and blast-radius analysis to handle the scale of AI-generated code.

For years, we've treated AI coding tools like high-powered autocomplete—great for finishing a line, but too risky to trust with a whole feature. That era is officially over.

New data from Greptile shows that fully autonomous AI agents are no longer just toys for hobbyists; they are shipping production code at companies like NVIDIA and Coinbase that is statistically as reliable as human-written code.

⚡ TL;DR: Greptile analyzed over a million monthly pull requests (PRs) and found that AI-generated PRs grew from under 1% to over 25% in one year. Across revert rates and bug severity (P0-P2), agents like Codex, Devin, and Claude Code performed on par with humans, though they exhibit distinct failure modes.

The Simple Version

Imagine the difference between a calculator and a ghostwriter. For a long time, AI was the calculator: you did the thinking, and it handled the tedious math of syntax. Now, we've entered the age of the ghostwriter.

These autonomous agents don't just suggest a line of code; they take a task, explore the entire codebase, edit multiple files, and submit a completed pull request. Daksh Gupta calls this "vibe coding," where the developer describes the desired outcome and the AI handles the implementation from start to finish.

🎯 Think of it this way: Traditional AI coding was like having a spell-checker that fixed your typos as you wrote. Autonomous agents are like hiring a contractor who takes a blueprint and builds the entire room while you're away, leaving you only to inspect the final result.

How It Actually Works

To understand if this "vibe coding" actually works, Greptile analyzed a massive dataset of PRs from enterprise giants including NVIDIA, Coinbase, Scale, DataDog, and American Express. They first had to solve a detection problem: how do you know if a human or an AI wrote a PR?

Detecting the AI Signal

The team found that simply looking at the GitHub author field wasn't enough, as less than 1% of PRs explicitly listed AI as the author. Instead, they looked for "fingerprints" in the metadata.

They tracked co-author footers (e.g., "co-authored by Claude"), specific branch name prefixes used by agents like Codex, and descriptions generated by the tools. This revealed a massive shift: AI-generated PRs jumped from under 1% a year ago to over 25% in April.

Measuring "Good" Code

Greptile used four primary metrics to compare humans against agents like Codex, Devin, and others. First, they looked at revert rates—how often a PR had to be undone because it broke something.

The results were surprising: Codex PRs were reverted about 1 out of every 1,000, while Devin was reverted about 3.5 times per 1,000. Humans sat right in the middle at roughly 2.5 per 1,000. As Daksh Gupta puts it, "there doesn't seem to be very big difference between the rate at which poll requests were reverted from people versus agents."

The Severity Gap

They also tracked bug severity levels: P0 (critical/blocker), P1 (high), and P2 (medium). Interestingly, three out of the four agents tested actually produced fewer P0 bugs than humans did.

Even the number of review rounds—how many times a PR is edited before it's merged—showed no statistical difference. Devin's PRs averaged 2.1 rounds, Codex averaged 2.45, and humans fell in between.

Technical Deep Dive

While the overall quality is similar, the failure modes—the specific ways the code breaks—differ wildly between models. This suggests that different LLMs have different "blind spots" in their training or reasoning paths.

For example, Claude is 1.5x more likely than humans to introduce SQL injection vulnerabilities. This happens when an LLM fails to properly sanitize user input, allowing an attacker to execute arbitrary SQL commands on the database. Conversely, Devin is about half as likely as humans to cause authentication bypasses, suggesting it is more rigorous about security middleware.

Cursor, meanwhile, frequently introduces N+1 query problems. For context, this is a common performance anti-pattern where an application makes one query to fetch a list of items and then $N$ additional queries to fetch details for each item, leading to massive database latency as the dataset grows.

🎯 Think of it this way: It's like comparing a cautious but slow driver to a fast but reckless one. Both might arrive at the destination, but one is more likely to get a speeding ticket while the other is more likely to take a wrong turn.

To combat these failures, Greptile uses a validation pipeline that moves beyond static analysis. They employ a "swarm" of agents that perform blast-radius analysis, identifying every file related to a change to predict ripple effects.

They then spin up the code in a sandboxed environment, install dependencies, and launch browser agents. These agents act like automated "chaos monkeys," clicking buttons and mocking inputs to try and break the application before a human ever sees the PR.

Why This Matters

The scale of modern software development is outstripping human capacity for review. Greptile found that while the median engineer writes 50 PRs a month, the 99th percentile writes thousands. Manual code review is mathematically impossible at that volume.

This shifts the role of the senior engineer from a "line-by-line editor" to a "system validator." Instead of asking "Is this syntax correct?", the focus becomes three higher-level questions: Does this violate the user contract? Does it make future violations more likely? And does it fulfill the author's intent?

As AI agents take over the bulk of implementation, the industry will move toward intent-based validation. We are seeing a future where the human defines the "what" and the "why," while the AI handles the "how," and a second AI system proves that the result is safe to deploy.

Frequently asked questions

What is 'vibe coding'?

Vibe coding refers to using fully autonomous AI agents to handle the entire implementation of a feature from a high-level description, rather than using AI for simple autocomplete.

Are AI-generated PRs more buggy than human ones?

According to Greptile's data, no. In terms of revert rates and P0/P1/P2 bug severity, AI agents perform in the same range as humans, and some are even less likely to cause critical P0 failures.

What is an N+1 query problem?

It is a performance issue where an app makes one database query to get a list of records and then separate queries for each record's details, causing significant slowdowns.

Sources

Source: “Greptile Study: AI-Generated Code Now Matches Human Quality” on YouTube by AI Engineer

Tags: AI Agents, Software Engineering, LLMs, Code Review, Devin, Claude Code

Related articles