Modernising the mainframe with AI

Modernising the mainframe with AI: a Lekton.AI research project

Research project · The bottleneck is not writing code

“AI will rewrite COBOL.” The slogan has been around for a couple of years and it is only half true. As a research project, we developed and tested a mainframe modernisation method that starts from a simple observation: generating code with AI is now fast and cheap, verifying it is not.

The problem

The core systems of banks and insurers still rest on mainframe applications written decades ago, in PL/I, COBOL CICS and Assembler. The two classic approaches both have a well-known flaw. Manual rewriting is slow, expensive and depends on skills that are retiring. Automated translation produces code that looks modern but is hard to maintain: “Java that speaks COBOL”. Recently a third way to fail has emerged: handing the sources to a language model and expecting a system to come out. The model does write the code, often well. The problem is everything that comes after.

Verification is the real bottleneck

The AI mainframe modernisation method: sources, patterns, generation, automated checks, comparison with the original program

If every migrated program needs a full human review, AI has not changed the economics of the project: it has only moved the cost from writing to reading. That is why the method invests more in verification than in generation. Every migrated program goes through a chain of automated checks: it compiles in the target technology, meets the standards in static analysis, passes generated tests with coverage thresholds and, the decisive check, produces the same results as the original program for the same input data. Migrated code is not judged, it is compared. Human review remains, but only for exceptions, and this dramatically cuts the time per program.

The first question: how standardised is the code?

Almost every large mainframe installation has in-house libraries that standardise data access and transaction handling. Where they are widely used, hundreds of apparently different programs turn out to be a finite number of repeated patterns. A pattern-driven migration is a radically different problem, in terms of risk, time and cost, from a program-by-program redesign. The initial study is there to measure exactly this, before committing to any figure.

Knowledge goes into rules, not into people’s heads

The patterns identified become configurable rules that the pipeline applies automatically. Everything specific to a given context (standards, libraries, technology mappings) lives in configuration files, while the process stays the same. Quality becomes consistent across programs, the work can be run in parallel, and the know-how remains a reusable asset instead of being lost at the end of the project.

Defects in the old code are a result

Analysing the code systematically brings to light errors that have been hidden for years and that downstream systems have adapted to. Every anomaly goes into an inventory, and for each one there is an explicit decision on whether to preserve it or fix it. That way, acceptance testing does not uncover “mysterious” differences between the old system and the new one.

Being honest about scope

Release into production belongs to the processes and responsibilities of whoever runs the system: the honest boundary of a migration is acceptance testing. And a serious study may conclude that some parts are not worth migrating at all. In this field, a method that promises everything is promising badly.

The method is public

The principles of the method (the pipeline with AI agents, the automated checks, the rule-based approach) are described in the public modernLegacy repository, in a form anyone can consult: those who manage a portfolio of mainframe applications can assess the method before even starting a feasibility study. The other projects are on the Research & Innovation page.


For a free initial call of 20–30 minutes, write to info@lekton.ai or use the Contact page.