Legacy Code Health Check
Know exactly what you're sitting on before you spend a penny on modernisation. A fixed-price, AI-powered assessment turned into a costed roadmap by a senior developer.
Read moreLegacy modernisation
This year gave us two memorable stories about AI agents destroying things. Both are worth reading. Neither is the failure mode that will sink your legacy transformation.
In April, the founder of automotive SaaS platform PocketOS lost his production database to the company's own coding agent. Cursor, running Claude Opus 4.6, hit a credential mismatch in staging and decided to fix it by deleting a Railway volume. It found an API token in an unrelated file that was scoped for any operation, including destructive ones, and made a single call. The volume-level backups lived in the same volume, so they went too. Railway later said the agent had called a legacy endpoint missing the delayed-delete safeguard that the dashboard and CLI have, patched it, and restored the data.
In May, a developer accused Google's Gemini coding assistant of deleting close to 30,000 lines of working code and then producing a recovery report describing work it had not done. Those claims were not independently verified, and it is worth holding them loosely. But the shape of the allegation is the interesting part: not just destruction, but a confident account of a recovery that had not happened.
Loud failures
Quiet failures
Gartner expects more than 70 percent of mainframe exit projects started in 2026 to fail to deliver their intended benefits, and points at the gap between what generative AI is marketed as being able to do with complex legacy code and what it actually does. That is not a prediction about agents deleting things. Those are rare, obvious and recoverable. It is a prediction about translation that looks right.
This is the failure mode I would call silent behavioural drift, and AI is unusually good at producing it. A translation tool that cannot understand your code produces something that does not compile, and you find out in minutes. A model that mostly understands your code produces something idiomatic, readable, plausible, and subtly different in the three cases that matter most. Reviewers approve it because it reads well. Tests pass because the tests were written from the same misunderstanding.
On a legacy system, that is the whole risk. The business rules are the asset. The code is just where they happen to be written down, often badly, by people who left a decade ago. If a migration preserves the architecture and loses two rules, it has failed, however good the new codebase looks.
This is not an argument against using AI on legacy work. I use it on every engagement, and on the comprehension end - reading codebases, extracting rules, drafting tests - it is genuinely transformative. It is the single best tool I have ever had for the hardest part of this job.
But it changes the shape of the risk. The old failure mode was running out of time and money before you understood the system. The new one is believing you understood it because something fluent told you so. Those need different safeguards, and most programmes are still carrying the old ones.
Sources
Next step
If this matches or contradicts what you are seeing in your own delivery, I would rather hear it than not. A 15-minute call costs you nothing.
Published
Topic