Definition
AI Defect Attribution Rate (ADAR) is a proposed metric that measures whether AI-generated code produces defects at a higher, lower, or equal rate compared to human-authored code, and, by extension, whether the two sources have different defect profiles. In plain language: take the share of production defects that came from AI-generated code, divide it by the share of the codebase that is AI-generated. If the two shares are equal, AI and human code are contributing defects at the same rate per line. If the defect share is larger than the code share, AI-generated code is contributing disproportionately, and you have a signal worth examining.
The Measurement Gap
Your team adopted GitHub Copilot nine months ago. Velocity is up 30%. Code review approval times dropped. Defect escape rate (the percentage of bugs that make it to production) is flat. Every number on the engineering dashboard points to a successful AI adoption.
Then, over three weeks in Q3, the payment processing service starts throwing NullPointerExceptions in edge cases involving canceled orders. Customer complaints trickle in. Error logs confirm the pattern. Your team traces the bugs to a utility method handling order state transitions, a block of code that looks clean, handles the happy path correctly, and passed both code review and a test suite with 87% coverage.
The developer who accepted the AI-generated version of that method wasn't wrong when she approved it. The code did exactly what it appeared to do. What it didn't do was handle the edge case where a cancellation timestamp could arrive before a creation timestamp due to clock skew across microservices. The AI wrote logically clean code for the expected flow and omitted the boundary condition that only surfaces when distributed system timing behaves unusually under load.
This is the defect profile shift that traditional metrics cannot see.
Defect escape rate tells you how many bugs reach production. It doesn't tell you where they came from. If 18% of your defects originate in AI-generated code and AI code represents 9% of your codebase, you have a disproportionality problem, but your defect escape rate looks exactly the same as if that ratio were reversed. The metric aggregates sources without distinguishing them.
Code coverage tells you what percentage of your code gets executed by tests. The payment processing method had 87% coverage. The edge case path wasn't covered, but the dashboard showed green because the majority of branches were exercised. Coverage measures execution, not correctness, and AI-generated code tends to produce tests that validate what the code does rather than what it should do under adversarial or edge conditions.
Code review approval rates tell you how quickly reviewers are processing AI suggestions. They don't tell you whether reviewers are catching the specific failure modes AI code is prone to: the boundary condition omissions, the overly literal implementations that miss real-world system behavior, the logic that's correct under clean inputs and wrong under stress or unusual state. Reviewers approve AI-generated code at roughly the same rate as human-authored code. That looks like a quality indicator. It may just mean the code is syntactically plausible.
Velocity tells you how many features shipped. It doesn't ask whether the engineers who shipped them understood what they were accepting.
The structural problem is the same across all these metrics: they were designed for a world where code has one source. When AI generation introduces a second source with a different error profile (more boundary condition omissions, fewer syntax errors, different security vulnerability patterns) none of the existing metrics are instrumented to detect the split. They aggregate human and AI defects into a single number, that number looks acceptable, and the shift remains invisible.
There is no metric that tells you whether AI-generated code has a different defect profile than human-written code. If the ratio is moving in the wrong direction, you won't know until the pattern is large enough to ignore.
That is the gap AI Defect Attribution Rate is designed to fill.
Formula
AI Defect Attribution Rate (ADAR) is a proposed metric that measures whether AI-generated code produces defects at a higher, lower, or equal rate compared to human-authored code, and, by extension, whether the two sources have different defect profiles.
In plain language:
take the share of production defects that came from AI-generated code, divide it by the share of the codebase that is AI-generated. If the two shares are equal, AI and human code are contributing defects at the same rate per line. If the defect share is larger than the code share, AI-generated code is contributing disproportionately, and you have a signal worth examining.
The formula:
ADAR = (Defects_AI / Defects_Total) / (Lines_AI / Lines_Total)
Where:
- Defects_AI = production defects traceable (via git blame and AI session metadata) to code written or substantially modified in an AI-assisted session
- Defects_Total = total production defects in the measurement period
- Lines_AI = lines of code committed from AI-assisted sessions, identified by Copilot telemetry, IDE plugin metadata, or a commit message tagging convention
- Lines_Total = total lines of code committed in the measurement period
Sign convention: ADAR is a dimensionless ratio. 1.0 means parity: AI-generated and human-authored code are producing defects at the same rate per line of code. Above 1.0 means AI-generated code carries a disproportionate share of defects relative to its share of the codebase. Below 1.0 means AI-generated code is carrying a smaller defect share than its proportional representation.
Worked Example
A development team of 15 engineers ships approximately 18,000 lines of code per month, with roughly 35% generated primarily by AI coding assistants. Over a quarter, 67 production defects are traced back to specific commits.
- Lines_AI = 6,300 (35% of 54,000 total lines over the quarter)
- Lines_Total = 54,000
- Defects_AI = 31 (traced to AI-assisted commits via git blame and session tagging)
- Defects_Total = 67
ADAR = (31 / 67) / (6,300 / 54,000) = 0.463 / 0.117 = 3.96An ADAR of 3.96 means AI-generated code is producing defects at nearly four times the rate of human-authored code per line committed. Nothing in this team's existing metrics (defect escape rate, velocity, code coverage) would surface that ratio. They all look normal.
Second example: near parity:
A different team of 20 engineers ships 30,000 lines per quarter, 40% AI-assisted. Over the same quarter, 52 production defects are traced to commits: 22 from AI-assisted commits, 30 from human-authored commits. ADAR = (22 / 52) / (12,000 / 30,000) = 0.423 / 0.400 = 1.06An ADAR of 1.06 is squarely in the parity range. AI-generated code is contributing defects at essentially the same rate as human-authored code. This team's AI adoption is not creating a disproportionate quality problem: the ratio is flat. That's a useful finding too, because it tells the engineering director that scaling AI usage further is not degrading quality, at least not yet. Track it quarterly to make sure parity holds as adoption increases.
Edge Cases
If Lines_AI is zero, ADAR is undefined: compute nothing. If Defects_Total is zero in the measurement window, expand the window; quarterly measurement is more reliable than monthly for most teams. If Defects_AI is fewer than 5, the ratio is too noisy to be directionally meaningful. I recommend a minimum of 20 total production defects and at least 5 AI-attributed defects before treating an ADAR reading as actionable.
Connections to other proposed KPIs:
ADAR sits upstream of two related metrics in the AI-Augmented Development Quality category. If ADAR is elevated, the first place to look is Code Comprehension Debt Index (CCDI, GMI-IT-002): the mechanism may be that developers are accepting AI-generated code they don't fully understand, which means review catches less because reviewers can't distinguish correct-looking logic from flawed logic in code they didn't author. If ADAR is high alongside high test coverage, check Test Adequacy Illusion Index (TAII, GMI-IT-003): the tests may be confirming what the AI implemented rather than validating what the requirements specified. On the downstream side, ADAR should feed production defect dashboards and inform decisions about which task types are appropriate to delegate to AI assistance. A high ADAR in security-sensitive validation logic but a low ADAR in boilerplate CRUD operations tells you where to apply more review scrutiny: it doesn't tell you to reduce AI usage across the board.
Proposed formula, pending validation pilots.