Modernizing Legacy Systems with AI: Controlled Risk, Unlocked Roadmap

posted by

Lucas Vilas Boas

on September 16, 2026

Learn how to combine automation and human oversight to speed up modernization without compromising quality.

Modernizing legacy systems with AI is about much more than gaining speed. For many organizations, the challenge today is to unlock the AI roadmap while keeping risk under control. Behind a system whose logic is hard to rebuild, there is often a concentration of knowledge in a few people, undocumented integrations, and dependencies that are difficult to map. This is the starting point that shapes how we structure the Refactor.AI framework.

A large European bank once reached the point of spending 70% of its IT capacity just to keep legacy systems running, according to McKinsey (Dec 2024). The market average is much lower, around 30% of the IT budget, according to Protiviti (2023). The direction, however, is the same: legacy has stopped being a maintenance issue and has become a precondition for any AI roadmap to move forward.

Why AI has made this urgent

A survey commissioned by VML, the company dti is part of, interviewed 4,000 business leaders across eight countries, including Brazil. The results show that for 77% of them, the rise of AI has forced them to revisit their digital transformation strategy. In addition, 62% admit that their current infrastructure is not adequate for their AI ambitions. For more on this, see the complementary article Technological Modernization with AI: 50% Faster.

One finding from the same survey is especially relevant for those deciding between rewriting everything and modernizing in small steps: 75% of leaders agree that combining legacy and modern systems works better than the still-common approach of full replacement. The incremental approach is also one of the pillars behind Refactor.AI, which we detail further below.

Why modernizing legacy systems has always been risky

It is common to find legacy systems with no documentation and no automated tests. Knowledge of how the system works often lives in the head of one or two people who have been around for years. Moving this kind of system without understanding it fully can delay critical business projects. In episode Refactor.AI: How to Modernize Legacy Systems with AI of our podcast, Os Agilistas (The Agilists), Fernanda Vieira, Head of Engineering at dti, calls this software archaeology. It means that, without the right professional nearby, there is often no real visibility into how the system actually works.

That changes when the team stops depending on the memory of a single person to understand the system. An agent takes on that initial reading and returns a shared view of what exists, eliminating the need for human knowledge to be concentrated in a few people, while reducing the dependency on it. Making this change possible is exactly what we set out to do with Refactor.AI.

What is Refactor.AI?

Refactor.AI is the framework we use specifically to modernize critical legacy systems with AI, where the risk of breaking something important has always been as high as the cost of not modernizing. It combines automated code analysis, specialized AI agents, and nearly two decades of technology modernization methodology. It also accelerates modernization projects by up to 60%.

The difference starts with execution. Instead of a generic assistant trying to handle everything at once, Refactor.AI is built as a sequence of controlled stages, each with a dedicated agent and a clear exit criterion, always with full traceability of what was changed and why. This design is meant to increase the predictability and traceability of the modernization.

The blind spot of over-trusting AI

This is where the difference between accelerating modernization and putting a critical system at risk lies. In the same episode of Os Agilistas (The Agilists), Yasmim Fonseca, Director of Strategy, spoke directly about this. It is not yet prudent to fully trust generative AI with critical decisions of this kind. That is why we structure Refactor.AI as a flow of agents with defined roles, not a single assistant doing everything at once.

An architect agent deterministically analyzes code dependencies (without generative AI) and proposes a migration strategy. A specialist reviews and adjusts that strategy before execution begins. Only after that do the execution agents come in: one plans and runs equivalence tests, another executes the code migration, and a third documents what was done. At each of these stages, someone on the technical team reviews what the agents produced before moving forward. Speed comes from dividing the work among specialized agents, not from the absence of supervision.

What this delivers in practice

In an Angular migration project (from version 16 to version 20), the result was an 83% reduction in development effort. What gives this number credibility is its origin: the same team had already carried out this modernization manually on another application within the client's ecosystem, so the comparison was direct, between the before and after in the same context, rather than a theoretical estimate of gains.

Outside of cases like this one, the typical acceleration we observe falls between 40% and 60%, depending on the type of modernization. In one leading logistics client, the agent responsible for documentation generated the complete documentation of a system with 6 repositories, 5 technologies, 89 controllers, and components in 7 to 8 hours, compared with an estimated 1 to 2 weeks for a manual process. The same analysis also proactively identified 16 critical problems before any refactoring began, risks that would otherwise likely have gone unnoticed until much later in the migration.

Frequently asked questions about modernizing legacy systems with AI

Is it safe to let AI modernize a critical system on its own?

No, and it should not be treated as if it were. The speed gain comes from dividing the work among specialized agents: one for strategy, one for tests, one for execution, and one for documentation. This includes human review at every critical stage, especially in defining the migration strategy. Treating generative AI as the sole decision-maker increases the risk of errors that could have been avoided.

How long does it take to modernize a legacy system with AI?

It depends on the type of modernization, and there is no single number. Version upgrades within the same language tend to accelerate the most: we have seen an 83% reduction in effort on an Angular migration. Architecture or language changes, on the other hand, typically fall in the 40% to 60% acceleration range. The decisive factor is how much of the modernization has already been mapped within that same ecosystem, more than the size of the system itself.

Where should you start modernizing a legacy system without documentation?

Start with mapping, not migration. Before any line of code changes, a dedicated agent reads the entire system, maps its dependencies, and produces the documentation that most likely never existed, as happened in the real case we presented above. This upfront mapping is what prevents critical problems from appearing only in the middle of the migration, when they are more expensive to fix.

Speed is a consequence, not the goal

Modernizing a legacy system with AI is not simply about doing in weeks what used to take months or years. It is about making the project viable, with controlled risk, so that a company can actually take on a type of project that is always slow, expensive, and dangerous to put off for long, and that tends to lose out in the queue of priorities. Speed ends up being a consequence of that.

Finally, if your company is already stuck on the AI roadmap and the question is where to begin without putting operations at risk, the article Refactor.AI: Modernizing Legacy Systems Faster walks through the complete framework step by step. If the challenge is to assess your company's scenario, it is worth starting this conversation before the next modernization effort.

‍