Home
News
Tech Grid
Interviews
Anecdotes
Think Stack
Press Releases
Articles
  • Agentic AI

AI Coding Assistants Raise Defect Risk 30%+ in Unhealthy Code


AI Coding Assistants Raise Defect Risk 30%+ in Unhealthy Code
  • by: Source Logo
  • |
  • January 29, 2026

New research from CodeScene reveals that AI-coding assistants can increase defect risk by at least 30% when applied to unhealthy codebases, with the real-world impact likely much higher in legacy systems. The peer-reviewed study, "Code for Machines, Not Just Humans: Quantifying AI-Friendliness with Code Health Metrics," conducted by Markus Borg and Adam Tornhill, demonstrates that AI tools accelerate output but often amplify technical debt in poorly maintained code, leading to more bugs, slower delivery, and eroded productivity gains.

Quick Intel

  • AI coding assistants raise defect risk by 30%+ in unhealthy code, acting as a technical debt multiplier rather than an accelerator.
  • AI lacks the ability to distinguish maintainable code from merely functional code, exacerbating issues in legacy or low-quality areas.
  • Organizations see cancelled productivity gains and slower delivery when AI is applied without code health safeguards.
  • CodeHealth™, a validated 10-point metric, correlates strongly with defect rates and development speed, serving as a protective buffer for safe AI adoption.
  • CodeScene's agentic framework—combining CodeHealth™ analysis, MCP Server safeguards, and CodeScene ACE refactoring—enables risk-aware AI use and automatic uplift of problematic code.
  • Real-world example: loveholidays reversed declining code health from early AI use, scaling to 50% agent-assisted code in five months while boosting throughput and quality.

The study explains recent industry observations of increased bugs and diminished returns after initial AI enthusiasm. In unhealthy code, AI generates faster but often poorer-quality changes that compound maintainability issues over time. Healthy codebases, however, benefit from AI acceleration without the same downside risk.

"In the AI era, healthy code is no longer optional," said Adam Tornhill, Founder and CTO at CodeScene. "It's a prerequisite for safe, effective, and economically viable AI adoption."

To mitigate these risks, CodeScene has outlined an automated, self-correcting framework built on three integrated components:

  • CodeHealth™ analysis provides a strategic risk view, identifying where AI can be safely applied today and highlighting high-risk areas.
  • The CodeScene MCP Server enforces deterministic, real-time quality gates that prevent AI agents from introducing technical debt, even in complex workflows.
  • CodeScene ACE, an AI-powered refactoring engine, automatically improves code health in not-yet-ready zones, with benchmarks showing up to 2x better results than frontier models and 6–8x time savings compared to manual refactoring.

This creates an agentic loop: assess health → safeguard AI output → refactor weak areas → validate improvements via CodeHealth™ → repeat. The approach ensures measurable, predictable outcomes tied directly to business metrics like defect rates, delivery speed, and ROI.

At loveholidays, initial use of agentic coding with Claude led to declining code health. After implementing CodeScene's safeguards, the team reversed the trend and scaled safely to 50% agent-assisted code within five months, increasing throughput while preserving quality.

"AI has an amplifying effect. If your engineering practices are strong, AI helps you move faster. If they're weak, it will destroy you," said Stuart Caborn, Distinguished Engineer at loveholidays.

"AI can't determine what 'good code' looks like," Tornhill added. "Code Health gives AI that ground truth, connecting AI performance directly to business outcomes like speed, defects, and ROI."

The full whitepaper, "AI-Ready Code: How Code Health Determines AI Performance," is available now and provides deeper insights into the research, framework, and practical implementation.

 

About CodeScene

CodeScene helps organizations manage technical debt by impact, adopt AI-assisted coding safely, and prove ROI using CodeHealth™ — the only scientifically validated code quality metric proven to predict defect risk and delivery performance.

  • AI CodingAI AgentsSoftware Development
News Disclaimer
  • Share