Back to Notes
January 2026

Legacy Code Love

AI Coding Tools Are Breaking Things Faster Than They Build Them

You're hearing it everywhere: AI-assisted coding will transform how your team ships software. Over 90% of developers now use AI tools, and companies are seeing real productivity gains.

But there's a catch nobody's talking about.

CodeRabbit's 2025 research found AI-generated code creates 1.7x more issues than human-written code: more logic errors, more security vulnerabilities, more maintainability problems. Pull requests with AI assistance show 23.5% more incidents. Change failure rates are up 30%.

The systems where you most want AI's help (expensive to maintain, painful to change, critical to your business) are exactly where AI assistance is most dangerous.

The failures of 2025 weren't edge cases.

Replit's AI agent deleted a production database containing records for over 1,200 executives. This happened during an explicit code freeze. When the customer tried to recover, the AI claimed recovery was impossible. It wasn't.

Google's Gemini CLI hallucinated file operations and permanently deleted a user's work. Google later admitted it was "an unacceptable, irreversible failure."

These aren't cautionary tales about rogue AI. They're what happens when powerful tools meet systems without safety nets.

Your "legacy" systems aren't the problem.

Stop using "legacy" as code for "old and dying." Your systems aren't legacy because they're old. They're legacy because they're valuable enough to have survived. Valuable enough to still be running your business.

The real question isn't age. It's whether a system has high business value (revenue and customers depend on it), high cost to maintain (changes require tribal knowledge and break things unexpectedly), and high opportunity from AI (productivity gains would be substantial, if you could use it safely).

In some sectors, 80% of IT budgets go to legacy maintenance: money spent keeping things running, not improving them. These are exactly the systems where modernization ROI is clearest. AI could change the equation entirely, if you can unlock it safely.

The real obstacle isn't your technology. It's the risk.

Build the safety net first. Then unleash AI.

The highest-value AI investment isn't better code generation. It's building the verification layer that makes AI-assisted development safe.

Safer AI-Assisted Development: From risky AI development through building safety nets to safer AI-assisted development

"Code without tests is bad code. It doesn't matter how well written it is."

- Michael Feathers, Working Effectively with Legacy Code (2004)

The approach is straightforward: capture what your system does today by running it with comprehensive inputs and recording the outputs. That's your baseline: what users actually depend on, not what the spec says.

After any change (human or AI-generated), compare against the baseline. Differences trigger investigation before production.

These tests don't require understanding the code. They don't require documentation. They don't require rewriting anything. They capture behavior from the outside.

With this safety net in place, everything changes. AI can suggest refactoring freely. Your team can review AI-generated changes with confidence. The system that was untouchable becomes an asset you can actually improve.

The bottom line

80% of organizations say outdated technology is holding them back. But the obstacle isn't the technology. It's the risk.

Remove the risk, remove the obstacle. Build the verification layer, and AI-assisted modernization becomes possible, even for your most critical systems.