décembre 2026
The Legacy Dividend: Using AI to Read, Document and Migrate the Systems Nobody Dares to Touch
Why the most reliable return on AI coding tools sits in the code an organisation already owns, what the evidence supports and what is only a vendor’s word, and a method for moving an old system without betting the firm on a rewrite.
Abstract
Most of the discussion about AI coding tools concerns new software. We argue that in an established organisation the more reliable return lies in old software: the COBOL and RPG on a mainframe or IBM i, the undocumented .NET Framework, Visual Basic 6, classic ASP and Delphi applications, the old Java, and the Access databases and Excel workbooks that quietly run a department. These systems persist because the knowledge of what they do left with the people who built them, and because replacing them in one move has a documented record of failure. Language models change one part of that picture decisively and another part hardly at all. They read, explain and document unfamiliar code well and cheaply, they help write the tests that pin down current behaviour, and they carry out version upgrades and incremental translation at a speed for which there is now published evidence, some of it peer-reviewed and much of it from vendors alone. They do not make translated code correct. Semantic drift in arithmetic, dates, encodings and batch behaviour is silent, and a program that compiles has proved nothing. We set out a method that follows from this: read before you write, pin behaviour with characterisation tests and recorded production data, migrate in slices, run old and new in parallel, and keep the people who own the business rules in the loop. We add a decision table for the seven usual options, the governance questions (where the code goes, intellectual property, auditability, and the treatment of legacy systems under DORA), a simple way to estimate the dividend, and a section for the small scale, where most mid-sized firms actually meet legacy. This is practitioner guidance, not legal advice.
Keywords: legacy modernisation; AI-assisted coding; code comprehension; business rule extraction; characterisation tests; strangler fig pattern; parallel run; COBOL; RPG; IBM i; mainframe; .NET Framework; Visual Basic 6; Microsoft Access; Excel VBA; code translation; semantic drift; application portfolio; DORA; source code confidentiality; key-person risk; total cost of ownership
1. Introduction
Every established organisation has a system that nobody dares to touch. It may be a COBOL batch suite on a mainframe, an RPG application on an IBM i that has run the warehouse since the 1990s, a Visual Basic 6 client that three departments open every morning, or an Access database that a long-departed colleague built and on which the monthly invoicing depends. It works, mostly. Changing it is slow and frightening, because nobody fully knows what it does, and the last person who did has retired or is about to.
The public conversation about AI coding tools is largely about writing new software faster. Our earlier papers, A Best-of-Breed Chain for AI-Assisted Software Development and Biomimicry in AI-Assisted Coding, were about that too: how to verify what an agent writes, and how to build systems that keep themselves correct. This paper turns the same tools around and points them at the code that already exists.
Our thesis is that this is where the most dependable return is found, and that it comes in a particular order. The first and safest gain is understanding: a language model reads unfamiliar code patiently, at any hour, in any language, and explains it, and an explanation can be checked by a person before anything is changed. The second is protection: tests that record what the system does today. Only third comes change, whether a framework upgrade, a translation or a replacement, and it is safe to the degree that the first two were done. We call the result the legacy dividend: lower running cost, an exit from licences and hardware, faster change and, often most valuable, the end of dependence on one or two people.
The claim needs care, because the subject attracts overstatement from both directions. Vendors publish very large numbers, and some are real. Sceptics point out, correctly, that translating code is not modernising a system. Section 2 explains why legacy persists. Section 3 sets out what AI is demonstrably good at, with the evidence graded by who stands behind it, and Section 4 what it is not good at. Section 5 gives a method and a decision table. Sections 6 and 7 cover governance and the economics, and Section 8 the small scale. The reader we have in mind is the CIO or IT lead, the head of development and the business owner of a legacy system in a mid-sized organisation. Product facts are as we found them in early December 2026, and they change quickly.
2. Why legacy persists
2.1 The knowledge left with the people
A legacy system is not simply an old one. Plenty of old software is well understood and cheap to keep. A system becomes legacy, in the sense that matters here, when the organisation can no longer change it with confidence. That is a statement about knowledge, not about age or programming language.
The code of such a system is the only complete and current statement of a set of business rules: which customers get which discount, how a pension entitlement is rounded, in what order the nightly jobs must run and what happens when one fails. The documents that once described those rules are out of date or lost. The rules were added over decades by people responding to particular events (a tax change, a merger, a customer who complained), and the reason for each is no longer recorded. Some of what looks like a defect is relied upon downstream. The people who could tell the difference have moved on.
This is why the usual advice (“just document it”) has not worked. Reading a few hundred thousand lines of unfamiliar code to recover its rules is skilled, tedious and expensive, and the people able to do it are the same scarce people who keep the system running. The work never reaches the top of the list.
2.2 The rewrite that fails
The obvious alternative, replacing the system in one programme, has a record that should make any board cautious. We name two cases because their facts are on the public record.
In April 2018 TSB Bank in the United Kingdom moved its customers from the platform of its former parent to a new one over a single weekend. The data migrated, and the new platform then failed under real use. According to the Financial Conduct Authority and the Prudential Regulation Authority, all branches and a significant proportion of the bank’s 5.2 million customers were affected, normal service did not return until December 2018, the bank paid GBP 32.7 million in redress, and in December 2022 the two regulators fined it GBP 48.65 million for failures of operational risk management and governance. The regulators’ findings concerned planning, testing and the oversight of suppliers, not the choice of technology.
In 2016 the Government of Canada replaced a decades-old pay system with a new one, Phoenix, for most of the federal public service. A former Auditor General called the result an incomprehensible failure of project management and oversight. Ten years on, the Auditor General’s report of March 2026 still counted a backlog of more than 233,000 unprocessed pay transactions at the end of September 2025, and put the preliminary cost of the system that is to replace Phoenix at more than CAD 4.2 billion.
Neither was a failure of programming. Both were failures of knowledge and of method: behaviour that the old system had and the new one lacked was discovered in production, at full scale, on one date. That is the essential weakness of the big-bang replacement. It postpones every discovery to the moment when discovery is most expensive.
2.3 What it costs to stand still
Doing nothing is also a decision, and it has a price. The clearest public figures come from government. The United States Government Accountability Office reported in July 2025 that federal agencies spend more than USD 100 billion a year on IT and have typically reported spending about 80 per cent of it on operating and maintaining existing systems. Of the eleven legacy systems it judged most in need of modernisation, aged between 23 and 60 years, eight used outdated programming languages and only three had a complete modernisation plan. A mid-sized firm is not a federal agency, but the pattern is familiar.
The cost has four parts. Run cost: licences, hardware or hosting, and support contracts for platforms with few suppliers. Change cost: every modification takes longer and carries more risk than it would in a system people understand. Security and compliance exposure: unsupported components cannot be patched. And key-person risk: the day the last expert leaves, an inconvenience becomes an emergency. Organisations have stood still because the alternative looked worse, and often it was.
3. What AI is demonstrably good at
3.1 Reading, explaining and documenting
The strongest capability is the least glamorous one. A current language model can be handed a COBOL program, an RPG module, a stored procedure or a VBA macro and asked what it does, and the answer is usually a competent explanation in plain language: the inputs and outputs, the main paths, the conditions under which each branch is taken, the files and tables touched. Asked differently, it lists the business rules it finds, produces a data dictionary, or draws the call graph of a set of programs.
Three properties make this valuable. It is cheap, so documentation that was never economic to write by hand becomes so. It is broad: the model reads JCL, embedded SQL, copybooks and screen definitions as readily as the program itself. And, most important, the output is checkable before it has any effect. An explanation that is wrong costs a reviewer’s time; a translation that is wrong costs an incident.
Practitioners who have done this at scale report the same emphasis. Thoughtworks, writing on Martin Fowler’s site in 2024 about its own tooling, described combining a language model with a graph of the code built by conventional parsers, so that the model explains each unit with its dependencies in view. For one client’s COBOL estate, reverse-engineering a 10,000-line module had taken about six weeks, and the team estimated that the approach could cut this by two-thirds. That is an estimate from a proof of concept by a firm that sells the service, and should be read as such. The same authors say plainly that they see little value in using a language model for things static analysis already does well, such as finding dead code, and that humans must stay in control of the output.
This matches our experience. Parsers, cross-reference tools and dependency analysers establish what calls what and what reads which field, and they do not guess. The language model adds what those tools never could: a summary at a level a business owner can read and correct.
3.2 Tests, upgrades and translation: the published evidence
Beyond comprehension, three further uses have evidence behind them, of varying quality.
Generating tests. Models write unit tests and test data readily, and for legacy work the useful kind is the characterisation test (Section 5.2): a test that asserts what the code does now, not what it ought to do. A model can propose hundreds of input cases for a routine, including the boundary cases a tired human would skip. The expected outputs must come from running the real system, never from the model’s own belief about what the code does.
Version and framework upgrades. The best-documented successes are migrations within a language. Google engineers reported at a peer-reviewed software engineering conference in 2025 on moving identifiers from 32-bit to 64-bit integers across a large codebase with a language model in the loop: over twelve months, three developers completed 39 migrations and submitted 595 code changes, of which the model generated 74.45 per cent of the changes and 69.46 per cent of the 93,574 individual edits; the developers estimated the total time at half of what earlier manual efforts had taken. Every change still went through human review and the existing tests, and the halving is the developers’ own estimate.
Amazon has published the largest claim. According to AWS, the company used its own assistant to move tens of thousands of production applications from Java 8 or 11 to Java 17, saving what it puts at more than 4,500 developer-years against manual upgrades and about USD 260 million a year in running cost from the newer runtime. The figures are Amazon’s own, have not been independently audited, and describe an organisation with comprehensive automated tests and deployment pipelines for the applications concerned. A firm without those will not see the same result.
Translation between languages. Here the evidence is thinner and the caution greater. A study presented at the International Conference on Software Engineering in 2024, by researchers from IBM and the University of Illinois, tested the language models then available on 1,700 code samples and found that correct translations ranged from 2.1 per cent to 47.3 per cent depending on the model, and that on two real-world projects the best model managed 8.1 per cent. Models have improved considerably since, and current agentic tools compile, run tests and repair their own errors in a loop, which the study’s one-shot setting did not allow. We know of no equally rigorous independent measurement of today’s tools on real legacy systems. The honest position is that translation now works far better than that study recorded, and that nobody outside the vendors has published by how much.
Table 1. The evidence for AI in legacy work, graded by who stands behind it. “Vendor” means the only source is the organisation that sells the tool or the service; that does not make a claim false, but it does mean nobody else has checked it.
| Task | What has been reported | Standing of the source | What to take from it |
|---|---|---|---|
| Reverse engineering and documentation | Thoughtworks: about six weeks to reverse-engineer a 10,000-line COBOL module, estimated to fall by two-thirds with a model working over a parsed code graph | Vendor, proof of concept | Comprehension is the cheapest and safest gain; pair the model with deterministic analysis |
| Same-language migration | Google: 39 migrations, 595 changes, about three-quarters model-generated; time estimated at half | Peer-reviewed; time saving self-estimated | Works where tests and review already exist |
| Runtime upgrade | Amazon: tens of thousands of applications to Java 17; more than 4,500 developer-years and about USD 260 million a year claimed | Vendor, about its own estate | The upper bound for an organisation with mature pipelines |
| Estate-scale transformation | AWS Transform: 4.5 billion lines of code processed and 1.6 million hours saved in its first year, by AWS’s count | Vendor | Shows scale of use, not correctness of results |
| Cross-language translation | ICSE 2024 study: 2.1 to 47.3 per cent correct with the models of 2023; 8.1 per cent at best on real projects | Peer-reviewed, now dated | Translation needs behavioural proof; no recent independent benchmark on real estates |
3.3 The vendor programmes as of late 2026
The large vendors have each built a product on this ground. We describe them as they present themselves; Table 1 summarises the evidence.
AWS Transform. Amazon’s service, generally available since May 2025, offers agents for mainframe applications (analysis, documentation, decomposition and refactoring of COBOL towards Java), for moving .NET Framework applications to current, cross-platform .NET, and for VMware estates, plus a custom agent for an organisation’s own transformations. AWS says that in its first year the service processed 4.5 billion lines of code and saved an estimated 1.6 million hours of manual effort. The numbers are AWS’s own and unaudited, and a count of lines processed says nothing about whether the resulting systems behave correctly.
IBM. IBM launched watsonx Code Assistant for Z in 2023 to explain COBOL, refactor it into services and translate selected parts to Java on the mainframe. During 2026 IBM folded this into its coding agent, IBM Bob, as a premium package for Z, with companion packages for IBM i and for Java; the product page describes mapping applications and dependencies, generating documentation and business rules, and refactoring COBOL and PL/I, as a service or installed on the customer’s premises. IBM’s position, set out by a senior executive in February 2026, is that translating code is one thing and modernising a platform another, and that much of the value lies in the platform. That is the view one would expect from the platform’s owner; it also contains a truth that Section 4 takes up.
Microsoft and GitHub. GitHub Copilot modernization (the American spelling is the product’s) assesses and upgrades Java, .NET and C++ applications and helps move them to Azure. Microsoft’s documentation, as updated in November 2026, lists as generally available the upgrade and migration experience in the development environment and a command-line agent for assessing and planning across a portfolio of applications. It relies in part on deterministic rewriting tools, with the model filling the gaps, and Microsoft states that humans remain in the loop with every change reviewable.
Anthropic. In February 2026 Anthropic published a short guide arguing that its general-purpose coding agent, Claude Code, removes the cost barrier to COBOL modernisation by automating exploration and analysis. Its recommended steps are close to the method in this paper: start with one bounded component, analyse and document, plan with the engineers, implement incrementally, and validate against the old system’s outputs with subject-matter experts. The publication was followed by a sharp fall in IBM’s share price and drew IBM’s reply above. Thoughtworks’ response a week later was, to our mind, the fairest: the tools are a real advance in reading and summarising large codebases, and modernisation remains a delivery problem that needs people who know the system.
Two observations apply to all four. First, the specialised products and the general-purpose agents are converging: each pairs a language model with conventional analysis and a loop of build, test and repair. Second, every vendor now says that humans must review and that behaviour must be validated. Where their marketing and their documentation differ, the documentation is the better guide.
4. What it is not good at
4.1 Silent semantic drift
The characteristic failure of AI-translated code is not that it breaks. Broken code is found on the first run. The failure is that the new code is fluent, idiomatic, passes a casual review and behaves slightly differently from the old code in cases nobody thought to try. We call this semantic drift, and it is silent because nothing announces it. A total is one cent different on one invoice in ten thousand; a record is sorted into a different position; a job that used to skip a malformed line now stops on it.
A language model translates by producing code that plausibly does what the source appears to intend. Where the old language and the new one differ in their defaults, the model may carry over the intention and lose the behaviour.
4.2 Data and numeric edge cases
The differences that matter cluster in a few places, set out in Table 2.
Decimal arithmetic. COBOL and RPG do business arithmetic in fixed-point decimal, usually stored as packed decimal, with the number of digits declared for every field. A result that does not fit is truncated unless the program asks for rounding, and intermediate results follow precise rules. A translation that uses binary floating point will be wrong in the last digit some of the time. One that uses a proper decimal type must still reproduce each field’s precision, each truncation and each rounding mode. Rounding conventions differ between environments as well: Visual Basic’s own rounding function rounds halves to the nearest even digit, while the worksheet function of the same name in Excel rounds halves away from zero.
Dates. Old systems hold dates as two-digit years with a windowing rule added around the year 2000, as day counts from a platform-specific origin, as year-and-day-number, or as eight digits in a numeric field. Special values such as zero or all nines mean “none” or “for ever”.
Encoding and ordering. Mainframe and IBM i data is in EBCDIC, in which lower-case letters sort before upper-case and digits after both; in ASCII and Unicode the order is the reverse. Any logic that depends on sort order, compares keys, or looks for the highest or lowest value changes behaviour when the data moves.
Nulls, defaults and overflow. What an uninitialised field contains, what happens on division by zero, whether a string comparison ignores trailing spaces or case, and what a counter does when it exceeds its declared size all differ by platform, and old programs depend on the behaviour they grew up with.
Table 2. Where translated code drifts. Each row is a class of difference between a legacy platform and a modern one that a translation can reproduce only if it is tested for deliberately.
| Area | What the old system does | Typical drift after translation | How to catch it |
|---|---|---|---|
| Decimal arithmetic | Fixed-point decimal with declared digits; truncation unless rounding is requested | Floating point, or a decimal type with different precision or rounding mode | Replay recorded transactions; compare every monetary field exactly, not within a tolerance |
| Dates | Two-digit years with a window, day counts, special values meaning none or for ever | Sentinels read as real dates; window applied differently; time zones introduced | Boundary cases: century, leap day, month end, each sentinel |
| Encoding and sorting | EBCDIC order, fixed-width padded fields, legacy code pages | Different sort order and comparisons; corrupted accented characters; trimmed padding | Compare sorted outputs and key comparisons on real data, names and addresses included |
| Batch flow | Order, conditions and restarts defined in job control and the scheduler, not in programs | Steps run in another order or in parallel; a failed step no longer stops the chain | Document the job network first; compare a full cycle end to end |
| Error handling | Bad records skipped, logged or defaulted by long habit | Exceptions thrown where the old code carried on, or the reverse | Feed known bad inputs from production history |
| Non-functional | Throughput, locking and recovery tuned over years on the old platform | Correct results, too slowly, or contention under load | Load and recovery tests at production volume before cut-over |
4.3 Behaviour that lives outside the code
Much of what a legacy system does is not in its programs. On a mainframe, the job control language and the scheduler decide which programs run, in what order, on which files, and what happens when a step returns a particular code. On any platform, behaviour also lives in database triggers, in configuration tables and in the manual procedures around the system: the operator who reruns a job when a certain message appears. A translation of the programs alone reproduces the pieces and loses the assembly.
The non-functional properties are similarly implicit. A batch that completes in two hours because the platform does sequential file processing extremely well may take ten after a naive translation to row-by-row database calls. Locking, restart after failure, and the behaviour of the system at the month-end peak were tuned over years and written down nowhere. This is the sound core of the platform owner’s objection in Section 3.3.
4.4 Explanations that sound right
The comprehension capability that we praised has its own failure mode. A model asked to explain code will always produce an explanation, and when it has not seen the relevant part (a copybook, a called program, a table of codes) it may fill the gap with what such code usually does. The result reads as confidently as a correct explanation. On large systems the model also works over a partial view at any moment, so whatever it says about the whole is assembled from parts.
The remedies are procedural. Ground the model in the facts that parsers can establish. Require every stated rule to cite the program and lines it came from, so a reviewer can check it. Treat the generated documentation as a draft that becomes a document only when a person who knows the business has read and corrected it.
4.5 Why “it compiles” proves nothing
A legacy system usually has few automated tests or none; its test suite was the experts and the users. Without tests, the only automatic check on translated code is that it builds, and perhaps that it passes tests the same model wrote from its own reading of the source. Both checks are nearly worthless. A compiler confirms that the code is valid in the new language. Tests derived from the model’s understanding confirm that the translation agrees with that understanding, which is the thing in doubt.
The evidence that counts is behavioural: for the same inputs, the new system produces the same outputs as the old, across enough real cases to cover the paths that matter. Everything in the method that follows is arranged to produce that evidence early and continuously, not once at the end.
5. The method
The method has five steps and one decision. None of the steps is new. What AI changes is their cost, and therefore which of them an organisation can afford to do properly.
5.1 Read before you write
Start with understanding, and treat it as a deliverable with value of its own. Inventory the estate with conventional tools: programs, jobs, files, tables, interfaces and the dependencies between them. Then use the model to produce, for each unit, a plain-language description, the business rules with references to the code, a data dictionary and a map of what feeds what. Have the business owner and the remaining experts review the rules, mark each as confirmed, wrong or unknown, and record why the surprising ones exist.
This step is worth doing even if nothing is ever migrated. It converts knowledge that lived in two heads into a document the organisation owns, which is the largest single reduction in key-person risk available. It also turns the later decision from a guess into an informed choice: only now can anyone say how big the system really is, how much of it is dead, and which parts are simple and which are treacherous. We advise funding this step alone first, with a decision point after it.
5.2 Pin behaviour
Before changing anything, record what the system does. Michael Feathers gave the technique its name two decades ago: a characterisation test asserts the current behaviour of the code, right or wrong, so that any later change in behaviour is detected. For a legacy system the richest source of such tests is production itself. Capture real inputs and the outputs the system produced from them (a day’s transactions and the resulting files, a month-end run and its reports), strip or mask personal data where the test environment requires it, and keep them as the reference.
The model helps in three ways: it writes the harnesses that feed recorded inputs to old and new code and compare the results, it proposes additional cases at the boundaries Section 4.2 lists, and it helps explain differences when they appear. It does not supply the expected results. Those come from the old system, because the old system is the specification.
5.3 Migrate in slices
Replace the system piece by piece while it continues to run. Martin Fowler named this the strangler fig pattern after the plant that grows around a host tree until it can stand alone: new functionality is built beside the old system, calls are routed to the new part one function at a time, and the old system shrinks until it can be switched off. Each slice is small enough to understand, test and, if necessary, reverse.
Choosing the slices is the skilled part. Good first slices have clear boundaries, modest risk and real value. Data is usually the hardest boundary, since old and new must share or synchronise it for the duration. AI lowers the cost of each slice and of the temporary adapters that connect old and new; it does not choose the slices. Framework upgrades follow the same logic on a smaller scale: one project or module at a time, tests green at each step.
5.4 Run in parallel and compare
For each slice, run old and new side by side on the same real inputs and compare the outputs automatically. Differences fall into three groups: defects in the new code, which are fixed; differences that are harmless and expected, such as a changed timestamp format, which are recorded and excluded; and cases where the old system was wrong. The third group goes to the business owner, who decides whether to preserve the old behaviour or correct it, and the decision is written down. Correcting a long-standing error silently during a migration is a change to the business, and somebody downstream may depend on the error.
How long to run in parallel depends on the cycle of the business. A slice that includes month-end or year-end processing has not been proved until it has been through one. Comparison at field level, with exact equality for money, is the standard; “the totals agree” is not.
5.5 Keep the rule owners in the loop
Two kinds of people are indispensable, and the method must spend their time carefully. The remaining technical experts know why the system is as it is. The business owners know what the rules ought to be. Neither should be reviewing translated code line by line. Their time belongs on the recovered rules (are these right, and why is this one strange?), on the differences the parallel run throws up, and on deciding what the new system should deliberately do differently.
Someone must also own the result. For every slice there should be a named person on the business side who accepts it on the evidence of the comparison, and a named engineer who has read the new code and will maintain it. Code that no human has read is new legacy from its first day.
5.6 Seven options, and what AI changes
Not every system should be migrated. The options are conventionally listed as a set of words beginning with R; the list varies between authors, and we use seven. Table 3 sets out when each fits and what AI changes.
Table 3. A decision table for a legacy system. The choice is made per system, sometimes per part of a system, after the reading step of Section 5.1. The last column is our assessment of where AI changes the economics as of late 2026.
| Option | What it means | Choose it when | What AI changes |
|---|---|---|---|
| Retain | Keep the system as it is, deliberately | It works, changes rarely, and the platform is supported | A great deal: cheap documentation and tests make retaining safe and reduce key-person risk without any migration |
| Rehost | Move unchanged to other infrastructure (emulation or a hosted platform) | The pressure is hardware, data-centre exit or an operations contract, not the code | Little for the move itself; helps with scripts, job conversion and the inventory |
| Replatform | Same code, newer runtime, database or framework version | The language is viable but the version is out of support | Much: this is where the published evidence is strongest (Section 3.2) |
| Refactor | Restructure in place or translate incrementally, preserving behaviour | The rules are valuable and specific to the firm; change is frequent | Much, on condition of characterisation tests and parallel running; cost per slice falls, verification cost does not |
| Rewrite | Build anew from recovered requirements | The design is exhausted, or the business wants materially different behaviour | Moderate: rule recovery makes the specification affordable; the risks of Section 2.2 remain if done as one cut-over |
| Replace | Buy a package or a service | The function is not distinctive and a standard product fits | Moderate: recovered rules enable an honest fit-gap analysis and the data migration; none on the package’s own limits |
| Retire | Switch off | Usage analysis shows it is no longer needed, or needed only for reference | Some: helps establish what still depends on it and how to archive the data |
Two shifts in the table deserve emphasis. The first is that retaining a system has become a more respectable choice. If the main risk of a stable system was that nobody understood it, and understanding is now cheap, the case for an expensive migration weakens. The second is that the middle options, replatforming and incremental refactoring, have become cheaper relative to both extremes, and those are the options with the least cut-over risk. AI has done least for the big-bang rewrite, which was the riskiest choice before and still is.
6. Governance
6.1 Where the code and the data go
Legacy source code is among the most sensitive material an organisation holds. It contains the business rules in executable form and often credentials, internal addresses and fragments of customer data in comments and test files. The recorded production data used for characterisation tests is more sensitive still. Sending either to a model is a disclosure, and it should be a decision.
The choices are the ones we set out in Where Your AI Runs: a public API under commercial terms, a managed service inside the organisation’s own cloud tenancy and region, or a model the organisation hosts itself. For each, the questions are where the prompt is processed, whether it is retained and for how long, whether it is used to train models, who at the provider can see it, and under which law the provider can be compelled to disclose it. Commercial and enterprise terms from the main providers generally exclude training on customer content and offer limited or zero retention; consumer subscriptions frequently do not, and the two must not be confused. Microsoft’s documentation for its modernisation tooling, for example, states that code is not retained beyond the immediate session.
Self-hosting an open-weight model keeps everything in the building at the price of hardware, skills and, as of late 2026, some loss of capability on hard reasoning over large codebases. For comprehension and documentation, the gap matters less than it does for autonomous translation. A reasonable arrangement for a cautious firm is to do the reading step on infrastructure it controls and to revisit the question for later steps. Whatever is chosen, scan the code for secrets before any model sees it, and keep real personal data out of prompts unless the legal basis and the processor agreement cover it.
6.2 Intellectual property and licences
Three questions arise. Does the organisation have the right to do this to the code? For software it wrote, yes. For a package it licensed, or a system built by a supplier who retained the rights, the licence may forbid translation, modification or disclosure to third parties, and a cloud model provider is a third party. European law permits decompilation of a program without the right-holder’s consent only in narrow circumstances concerned with interoperability, so reverse-engineering a vendor’s binaries is a matter for legal advice.
Who owns the output? The legal position on works generated largely by a machine is not settled in most jurisdictions. In practice, a translation of the organisation’s own code, directed and reviewed by its own staff, is its own derivative work for all commercial purposes, and the main providers’ business terms assign whatever rights exist in the output to the customer. The contract with any integrator should say so explicitly.
What comes in with the new code? A translation pulls in libraries and frameworks on the target platform, each with a licence. The dependency list of the new system needs the same review as any other new software, with a software bill of materials kept from the start.
6.3 Auditability of AI-made changes
A migrated system will be audited, and the auditor’s question will be how the organisation knows that it does what the old one did. The answer should exist as records, produced as a by-product of the method and not reconstructed afterwards: every change in version control with its author, human or agent, and its human reviewer; the model and tool versions used; the characterisation tests and their results; the parallel-run comparisons and the disposition of each difference; and the business owner’s acceptance of each slice. Agents should work through the same pull-request and review gates as people, with no direct access to production. Our paper on the AI coding chain describes those gates.
6.4 Regulated sectors
For financial entities in the European Union, the Digital Operational Resilience Act (DORA) addresses legacy directly. Article 3 defines a legacy ICT system as one that has reached the end of its life cycle, is not suitable for upgrades or fixes or is no longer supported by its supplier, and is still in use supporting the entity’s functions. Article 8(7) requires financial entities other than microenterprises to conduct a specific ICT risk assessment on all legacy ICT systems at least yearly, and in any case before and after connecting technologies, applications or systems. Article 7 expects ICT systems to be kept up to date, reliable and technologically resilient, and Article 9 requires documented, risk-based ICT change management.
Three consequences follow. A regulated firm cannot treat “retain” as a default: retaining a legacy system is a position it must assess and justify every year. A migration is itself a major ICT change, to be governed, tested and evidenced, and the TSB case shows what supervisors make of one that is not. And an AI coding service used on systems that support critical or important functions is an ICT third-party service, which belongs in the register of information with the contractual provisions DORA requires. Other regulated sectors have analogous expectations. The NIS2 directive requires essential and important entities to manage security in the acquisition, development and maintenance of their systems, and software in regulated manufacturing and medical settings must be revalidated after change. None of these rules forbids using AI on legacy systems. They all demand the evidence that the method in Section 5 produces anyway.
6.5 Skills: what the remaining experts should do
The scarcest resource in any legacy programme is the attention of the few people who still understand the system. AI changes what that attention should be spent on. They should no longer be asked to write documentation, to explain the same module to each new contractor, or to produce routine changes; the model can draft all of that. Their time should go to reviewing recovered rules, explaining the reasons behind them, judging differences in the parallel run, and teaching.
Teaching matters because the organisation needs successors. A developer who knows the target platform, working with a model that can explain the source platform and with an expert available to correct both, becomes productive on a legacy codebase far sooner than was possible before. That is how knowledge is transferred from two people to a team. The experts should also know that this is the plan. A retention arrangement that keeps them through the migration is cheap insurance.
7. The economics
7.1 What the dividend is
The dividend has four components, which correspond to the four costs of standing still.
Lower run cost. Licences for the old platform and its tooling, hardware maintenance or mainframe capacity charges, specialist hosting and support contracts. This is the easiest component to measure.
Licence and hardware exit. Separately from the annual saving, leaving a platform can avoid a capital event: a hardware refresh, a forced version upgrade, a data-centre lease.
Change speed. Every change to an understood, tested system costs less than the same change to an opaque one. This is real money, though it shows up as capacity and not as a line in the budget.
Reduced key-person risk. The expected cost of losing the last expert: the probability that it happens in a given year multiplied by what the resulting disruption would cost. For many mid-sized firms it is the largest component.
The first two require migration. The last two begin to arrive with the reading and testing steps alone, which is why those steps can be justified on their own.
7.2 A simple estimate
The estimate we use is deliberately crude: add the annual components, divide the one-off cost by the sum, and read off the payback period. Table 4 works it through for an invented mid-sized case. Every figure in it is an illustrative assumption of ours and not a benchmark: a system costing EUR 400,000 a year to run, falling to EUR 150,000 after migration; 600 developer-days of change a year at EUR 800 a day, assumed to become 30 per cent cheaper; and a one-in-ten chance each year of a key-person event costing EUR 500,000.
Table 4. An illustrative estimate of the dividend and its payback. All inputs are assumptions chosen for the example; substitute your own.
| Item | EUR |
|---|---|
| Run cost saved a year (400,000 less 150,000) | 250,000 |
| Change cost saved a year (30% of 480,000) | 144,000 |
| Key-person risk avoided (10% of 500,000) | 50,000 |
| Annual dividend | 444,000 |
| Migration, conventional estimate | 1,500,000 |
| Migration, AI-assisted (assumed 30% lower) | 1,050,000 |
| Six months of double running (half of 400,000) | 200,000 |
| One-off, conventional (1,500,000 plus 200,000) | 1,700,000 |
| One-off, AI-assisted (1,050,000 plus 200,000) | 1,250,000 |
| Payback, conventional (1,700,000 / 444,000) | 3.8 years |
| Payback, AI-assisted (1,250,000 / 444,000) | 2.8 years |
Three things in the example are worth noticing. The assumed AI saving is applied only to the migration effort, not to the parallel run, because verification does not get cheaper in the same way. The 30 per cent is our planning assumption, deliberately well below the vendors’ headline figures, because those describe the parts of the work that automate best and a programme also contains the parts that do not. And the result is a payback measured in years in both columns. AI moves a marginal case into the acceptable range; it does not make a migration free.
The example also understates one effect and overstates another. It understates the option value of the reading step: for perhaps five per cent of the migration budget (again an assumption), the organisation learns whether the remaining ninety-five is worth spending, and already collects part of the key-person component. It overstates certainty: each input is a guess, and the estimate should be redone with pessimistic values before anyone relies on it.
7.3 Honest limits
Several limits apply to any business case of this kind. The published productivity figures come overwhelmingly from vendors and from organisations with unusually good engineering foundations; a firm without tests, pipelines or version control will spend its first months building those, which is worthwhile but is not the dividend. Verification cost is largely fixed: someone must still run the parallel period and settle each difference, and on a system with dense business rules that can exceed the cost of producing the code. The new system has a run cost too, including cloud charges that grow with use. Some systems should not be migrated at all, because a supported platform running stable code is cheap. And the dividend is paid only when the old system is actually switched off. A programme that migrates nine-tenths of a system and then runs both for years pays for two platforms.
8. The small scale: Access, Excel and the one-developer application
Most mid-sized organisations have no mainframe. Their legacy is smaller and closer to hand: the Access database that schedules the engineers, the Excel workbook with four thousand lines of VBA that prices every quotation, the Visual Basic 6 or Delphi application written by a contractor in 2004, the classic ASP intranet page nobody has opened in an editor for a decade. These systems share every property of the large ones (undocumented rules, a single expert, no tests) with two more: they were often built outside IT, and they are rarely on anyone’s inventory.
The platforms are in various states of support. Microsoft states that the Visual Basic 6 development environment has been unsupported since April 2008, while the runtime that existing applications need remains supported for the lifetime of the Windows versions it ships with, as 32-bit only. Access is still a current product within Microsoft 365, but many such databases were built on, and still run under, versions of Office that Microsoft no longer supports. So the usual position is that the thing still runs, on a foundation that is slowly being withdrawn.
The risks are real at any size. In October 2020 Public Health England disclosed that 15,841 positive COVID-19 test results had been left out of the daily figures and the contact-tracing process for several days because, in its words, some files of results exceeded the maximum file size in the automated transfer of laboratory data; contemporary reporting attributed this to the use of the old Excel file format, which stops at 65,536 rows. A spreadsheet had become a system without anyone deciding that it should.
AI is unusually effective at this scale, because whole applications fit comfortably within what a model can read at once. A practical sequence follows the method of Section 5 in miniature.
Find them. Ask each department which files and small applications it could not work without for a week. The answers are the inventory.
Extract and read. Export the VBA modules, queries, table definitions and form definitions to text, which Access and Excel both permit, and put them in version control. Have a model explain each module, list the rules and draw the table relationships. For a workbook, have it describe the formulas by range and flag hard-coded constants, external links and hidden sheets. A few days of work typically yields the first documentation the application has ever had, and for many of these systems that is enough: understood, backed up and versioned, they can be retained.
Pin. Save copies of real inputs and outputs: last quarter’s quotations and the prices the workbook produced. These are the characterisation tests.
Decide. The options of Table 3 apply in small. Retain with documentation. Replatform by moving the data to a proper database server and keeping the forms. Replace with a standard product where one fits; a great many Access databases are a customer or asset register that a commercial package does better. Rewrite as a small web application where the rules are the firm’s own; with an AI coding agent and recovered rules, this is now days or weeks of work for one developer where it used to be months.
Compare. Run the old and new side by side for a full business cycle, and compare the outputs. The drift of Section 4.2 occurs here too: Access and Excel store dates as day counts and have their own conventions for empty values and rounding, and a rewrite in another language will differ on exactly those points unless tested.
Two cautions belong to the small scale. The confidentiality question does not shrink with the system: a pricing workbook pasted into a consumer chatbot is the firm’s pricing logic disclosed, and the rules of Section 6 apply. And a quick rewrite by one enthusiast with an AI tool produces a new one-developer application unless the result is reviewed, documented, placed in version control and given an owner.
9. Conclusion
Legacy systems persist for good reasons. They hold business rules that exist nowhere else, the people who understood them have gone, and the record of replacing them in one move includes some of the most expensive IT failures on the public record. Against that background, the arrival of tools that read code well matters more than the arrival of tools that write it.
We have argued that the return comes in an order. Understanding comes first, because it is cheap, checkable and valuable even if nothing else follows. Protection comes second: characterisation tests and recorded production data that make the old system its own specification. Change comes third, in slices, each proved by running old and new in parallel and comparing their outputs, with the owners of the business rules deciding every difference. AI lowers the cost of each of these steps. It does not remove the need for any of them, and it has done least for the option that was always the most dangerous, the big-bang rewrite.
The evidence deserves the same sobriety. Comprehension, test generation and same-language upgrades are supported by experience and, in part, by peer-reviewed work. The large numbers for estate-scale transformation come from the vendors, and may well be true of the vendors’ best cases. Translation between languages works far better than it did, and remains the place where fluent, compiling, subtly wrong code is produced. The method resolves that uncertainty for the system at hand, with real inputs and compared outputs.
The dividend is real: lower run cost, an exit from ageing platforms, faster change and the end of dependence on one or two people. The last of these can be collected within weeks, by reading the system and writing down what it does. We suggest starting there.
Appendix A. A plain-language glossary
The terms this paper uses, in short.
Legacy system. A system the organisation can no longer change with confidence, whatever its age. DORA uses a narrower definition based on end of life and loss of supplier support.
Business rule extraction. Recovering from code the rules it implements, stated in business language with a reference to where each was found.
Characterisation test. A test that records what existing code currently does, right or wrong, so that later changes in behaviour are detected.
Strangler fig pattern. Replacing a system gradually by building new parts beside it and redirecting work to them one function at a time until the old system can be retired.
Parallel run. Operating old and new together on the same inputs and comparing their outputs before the old one is switched off.
Semantic drift. A difference in behaviour between original and translated code that produces no error and is noticed only by comparison.
Packed decimal. A compact storage format for exact decimal numbers on mainframe and IBM i platforms, used for money and quantities.
EBCDIC. The character encoding of IBM mainframes and IBM i, with a different character order from ASCII and Unicode.
JCL. Job control language: the scripts that tell a mainframe which programs to run, in what order and on which files.
Agentic coding tool. A language model that plans and carries out multi-step work on a codebase (reading, editing, building, testing) with a person approving the result.
Appendix B. A one-page checklist
A practical summary for the IT lead and the business owner of a legacy system.
Before deciding anything
-
List the systems nobody dares to touch, small ones included, with their owner, their remaining experts and their platform’s support status.
-
Decide where the code and test data may be processed (public API, private tenancy, self-hosted) and check the licence of any code you did not write.
-
Fund the reading step on its own, with a decision point after it.
Read and pin
-
Inventory programs, jobs, data and interfaces with conventional tools; use the model for explanations, rules and maps, each with a reference to the code.
-
Have the business owner and the experts confirm, correct or mark as unknown every recovered rule.
-
Capture real inputs and outputs, including a period-end cycle, as characterisation tests. Expected results come from the old system, never from the model.
Decide and migrate
-
Choose per system among retain, rehost, replatform, refactor, rewrite, replace and retire. Do not assume migration.
-
Migrate in slices behind stable interfaces; avoid a single cut-over.
-
Run old and new in parallel; compare at field level with exact equality for money; record the disposition of every difference.
-
Test the edges deliberately: decimals and rounding, dates and sentinels, encoding and sort order, batch order and restart, bad input, load.
-
Name a business owner who accepts each slice and an engineer who has read and will maintain the new code.
Govern and finish
-
Keep the audit trail as you go: commits, reviewers, tool and model versions, test results, comparisons, acceptances.
-
If regulated, assess each legacy system yearly, treat the migration as a major ICT change and register the AI service as a third party.
-
Spend the experts’ time on rules, differences and teaching successors; keep them until the old system is off.
-
Switch the old system off. The dividend starts then.
References
Financial Conduct Authority (2022). TSB fined GBP 48.65m for operational resilience failings (press release, 20 December 2022). https://www.fca.org.uk/news/press-releases/tsb-fined-48m-operational-resilience-failings
Office of the Auditor General of Canada (2026). Modernizing the Pay System (report tabled 23 March 2026). https://www.canada.ca/en/auditor-general/our-work/audit-reports/auditor-general-report-2026-modernizing-pay-system.html
United States Government Accountability Office (2025). Information Technology: Agencies Need to Plan for Modernizing Critical Decades-Old Legacy Systems (GAO-25-107795). https://www.gao.gov/products/gao-25-107795
Ferri, A., Coggrave, T. and Sheth, S. (2024). Legacy Modernization meets GenAI. martinfowler.com. https://martinfowler.com/articles/legacy-modernization-gen-ai.html
Ziftci, C., Nikolov, S., Sjövall, A., Kim, B., Codecasa, D. and Kim, M. (2025). Migrating Code At Scale With LLMs At Google. Industry track, ACM International Conference on the Foundations of Software Engineering (FSE 2025). https://arxiv.org/abs/2504.09691
Amazon Web Services (2024). Amazon Q Developer just reached a $260 million dollar milestone. AWS DevOps and Developer Productivity Blog. https://aws.amazon.com/blogs/devops/amazon-q-developer-just-reached-a-260-million-dollar-milestone/
Pan, R., Ibrahimzada, A. R., Krishna, R. and others (2024). Lost in Translation: A Study of Bugs Introduced by Large Language Models while Translating Code. 46th International Conference on Software Engineering (ICSE 2024). https://arxiv.org/abs/2308.03109
Amazon Web Services (2026). One year. 4.5 billion lines of code. 1.6 million hours saved. Here’s what we learned. AWS Migration and Modernization Blog. https://aws.amazon.com/blogs/migration-and-modernization/aws-transform-one-year-milestone/
IBM (2026). IBM Bob Premium Package for Z (product page, formerly watsonx Code Assistant for Z). https://www.ibm.com/products/watsonx-code-assistant-z
Thomas, R. (2026). Lost in Translation: What the AI code debate keeps getting wrong. IBM Newsroom, 23 February 2026. https://newsroom.ibm.com/blog-lost-in-translation-what-the-ai-code-debate-keeps-getting-wrong
Microsoft (2026). GitHub Copilot modernization overview. Microsoft Learn. https://learn.microsoft.com/en-us/azure/developer/github-copilot-app-modernization/overview
Anthropic (2026). COBOL modernization with AI: breaking the cost barrier (23 February 2026). https://claude.com/blog/how-ai-helps-break-cost-barrier-cobol-modernization
Ferri, A. and Sheth, S. (2026). Claude Code and COBOL modernization: What’s the reality? Thoughtworks, 2 March 2026. https://www.thoughtworks.com/en-sg/insights/articles/claude-code-cobol-modernization-reality
European Parliament and Council (2022). Regulation (EU) 2022/2554 on digital operational resilience for the financial sector (DORA). https://eur-lex.europa.eu/eli/reg/2022/2554/oj
Microsoft (2024). Support Statement for Visual Basic 6.0 on Windows. Microsoft Learn. https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-basic-6/visual-basic-6-support-policy
Public Health England (2020). PHE statement on delayed reporting of COVID-19 cases (4 October 2020). https://www.gov.uk/government/news/phe-statement-on-delayed-reporting-of-covid-19-cases
