" "

How GenAI Is Rewriting the Rules of Legacy Tech Modernization

Legacy technology underpins the core systems and foundations of operations across many industries—but that foundation is becoming harder to maintain.

Core processing, transaction, and enterprise resource planning (ERP) systems continue to power essential functions in sectors like banking, insurance, government, telco, retail, and manufacturing. But while systems like these are mission critical, modernizing them has proven to be one of the most complex challenges facing organizations today.

Leaders in these industries often find their business transformation ambitions constrained by aging architectures, decades of accumulated technical debt, and the prohibitive cost, time, and risk associated with updating or replacing legacy systems. Modernization projects can quickly spiral—going over budget by hundreds of millions of dollars and taking 2-4 times longer than initially estimated.

Many legacy systems are also no longer supported by the vendors that created them. These systems often rely on outdated architecture and programming languages like COBOL, and suffer from limited documentation and a diminishing talent pool of experts who fully understand how they work.

Legacy tech modernization efforts come at a high cost—not only in form of implementation cost, but also impacting the organization operationally. These initiatives can divert critical resources and subject matter experts from core business priorities. And when implementations falter, the impact can be severe: disrupted services, frustrated customers and suppliers, reputational damage, and even regulatory penalties.

BCG’s innovative use of generative AI (GenAI) agents introduces a new approach—one that enables faster, smarter, and more transparent modernization of legacy systems. By using GenAI, organizations can accelerate and de-risk the legacy modernization journey, driving business transformation at a scale and speed that was once unthinkable.

What are AI agents and why are they so effective?

In recent years, large language models (LLMs) have advanced significantly in their ability to process complex information and perform reasoning tasks. A GenAI agent is created when an LLM is assigned a task and provided with the ability to retrieve and interact with the information required to complete it.

More advanced agents can be built by integrating multiple simpler agents—each with a narrower scope but optimized for specific subtasks. Together, these agents work in sequence to handle complex tasks that would be difficult for a single agent to perform on its own.

The ability to execute well-defined tasks involving information processing and reasoning makes GenAI agents particularly valuable in the context of legacy tech modernization. They can unpack the “what” and “why” hidden within legacy systems—analyzing, interpreting, and optimizing legacy code, business logic, and system dependencies much faster than a human workforce.

GenAI-enabled discovery helps address core challenges at every stage of the modernization journey, answering questions such as:
Code analysis and understanding: What does each element of the existing code do? How is it architected, structured, or compiled? Where are the complexities and key dependencies?
Business logic and rules: What business requirements are reflected or embedded in the code? What is the business rule or logic being applied?
Conformance or deviance: Does the code reflect the intended design and requirements? Does it conform with relevant internal policies?
Impact assessment: What changes would be required to implement a new business requirement? If one part of the code changes, what are the upstream and downstream implications?
Optimization opportunities: How can the existing code be improved? Are there any opportunities to reduce duplication, redundancy, or inconsistency?
Effort and sequencing: How much work is needed to refactor or replace the code? What should be prioritized, and in what order?

While these tasks are typically part of any legacy system modernization effort, they have historically required extensive manual effort—often involving teams of engineers and analysts working over long periods of time. Despite that investment, discovery is frequently incomplete. Key issues often remain hidden until deep in the modernization process, resulting in delays, cost overruns, and missed opportunities for simplification.

Coordinated Intelligence: The power of a multi-agent approach

Achieving accurate and comprehensive discovery requires the development of a suite of GenAI agents, each designed to carry out a specific role. These agents mimic the responsibilities of human analysts and are equipped with the information needed—such as instructions, guardrails, and quality criteria—to produce predictable and reliable outcomes.

By taking a multi-agent approach—combining multiple agents that each perform a distinct task well—organizations can automate complex workflows with a high degree of precision. For example, different agents could include:
• An analyst agent that examines legacy systems and extracts business rules from millions of lines of code
• An editor agent that consolidates and refines the analyst agent’s output to improve clarity and validate quality
• A summarization agent that translates the logic into natural language summaries that are accessible to non-technical stakeholders

How organizations are using GenAI to modernize at scale

The true test of any modernization approach lies in how it performs under real-world conditions. The following case studies show how BCG’s GenAI-driven framework has been deployed across industries to tackle legacy system complexity, reduce risk, and accelerate modernization timelines.

Case study 1: Public sector legacy core system

A government agency needed to modernize its legacy core system to support more contemporary citizen interactions and streamline business operations. The legacy system had been developed over a decade earlier by a third-party vendor and was maintained under an outsourced managed service agreement. As a result, the agency had limited visibility of the underlying source code and lacked the necessary explanatory documentation to be able to understand the system and make changes or enhancements.

Solution:
BCG deployed a custom set of GenAI agents to review and analyze the legacy code. The solution used a multi-agent framework that included:
• A summarization agent to simplify logic and generate accessible outputs
• A complexity analysis agent to score code based on technical dependencies
• A code dependency agent to map interconnected logic across the system

The workflow began with an analyst agent that produced an initial interpretation of the code. A quality assurance agent reviewed and refined this output, with additional context provided by a supervisor where needed. The results were then passed to an editor agent, which produced clean, concise reports. Each agent’s output went through a structured feedback loop to improve accuracy before integration into a final summary.

Impact:
The Gen AI agents processed >3 million lines of code in under three days. Key outputs included:
• A draft rules register containing roughly 5,000+ business rules, each directly traceable to the original codebase. This analysis was completed an estimated 225 times faster than a traditional, human-led process—work typically requiring multiple person-years of effort.
• A complexity score was assigned to each component of the codebase, factoring in elements such as coding complexity, interdependencies, centrality, and the number of business rules. This allowed the team to identify the system's most complex and high-impact parts—ensuring they could be prioritized during design, where changes would yield the greatest benefit.

Case study 2: Business banking platform

A large business bank engaged BCG to modernize a mission-critical application containing over seven million lines of PL/SQL code, originally developed over 20 years ago. The system had highly complex, undocumented code, with entitlements logic embedded deep within its databases.

Solution:
BCG developed an interactive GenAI agent to interrogate the legacy codebase and deliver targeted answers to specific questions. To enable this, the agent was equipped with a code and data dependency graph—showing the relationships between objects—and supported by a broad set of contextual information, including data dictionaries and existing documentation.

The agent answered questions through an iterative refinement process that involved:
• Forming an initial hypothesis about the answer to the question, based on information available in the data dictionaries and documentation
• Executing a depth-first search (DFS) of the code dependency graph to identify the most promising areas for further investigation
• Continually refining its hypothesis at each step by applying the LLM’s reasoning capabilities to assess the relevance of each code segment, integrating new findings into its evolving answer

Impact:
The GenAI agent could correctly answer specific, complex questions that would traditionally take an engineer with deep system knowledge days—or even weeks—to resolve. These included:
• Where is the logic for the XYZ rule implemented in the code?
• Which data fields are connected to a specific business rule?
• Do these two business rules interact, or are they functionally independent?

The answers generated by the agent helped inform the target state solution design, ensuring alignment between business and IT stakeholders. Additional benefits included:
Reduced time-to-insight: The agent could deliver accurate answers in minutes, accelerating a process that would otherwise be slow and resource-intensive.
Democratized codebase access: By making system knowledge more accessible, the agent enabled less experienced engineers to engage with the codebase without relying on a small pool of domain experts.
Ensured alignment with modernization goals: The GenAI agent could answer questions directly related to the modernization goals. This avoided the need for an indirect approach, such as identifying relevant parts of the code through existing documentation.

Turning legacy modernization into a strategic advantage

Modernizing legacy systems has notoriously been complex, expensive, and risky. Given the daunting transition process, many organizations delay modernization until absolutely necessary, resulting in continued reliance on brittle systems and missed opportunities for growth, efficiency, and innovation.

BCG’s approach radically changes the delivery and risk profile of legacy system modernization. By using GenAI agents purpose-built for specific stages of the modernization journey, organizations can now complete tasks over 100 times faster than traditional methods—and at a fraction of the cost. The hyper-transparency it brings about also enables a much more robust design and delivery approach, directly addressing the root causes of failure that typically plague modernization efforts.

As the cost and effort required to implement changes decreases, so too does the need for massive, disruptive overhauls. Instead of lurching from one major legacy upgrade or replacement to the next, organizations can adopt a model of continuous, real-time modernization, responding to business needs as they arise.

Imagine a world where CIOs approach legacy modernization with a renewed sense of confidence - where the uncertainty, delays, and spiraling costs of rewriting core systems give way to a more predictable, AI-assisted path forward. With GenAI and multi-agent models, we’re not claiming non-specialists can write the code—but we are beginning to see how these tools can de-risk and accelerate the most daunting modernization efforts.