Back to BlogAI Agents

AI agents do not replace your legacy system: they make it usable

W4TechSep 30, 20264 min

Almost every company with more than ten years of operation has a system that "nobody touches". It may be a transactional core, a customized ERP, a .NET or Java monolith, or a mainframe. It is usually hard to evolve and expensive to maintain, but it concentrates years of business rules that make the company work.

When the board asks "what about our AI strategy?", a false dilemma appears: rewrite everything before starting, which takes years and carries enormous risk, or do AI "next to" the business, in isolated projects that never touch the data and processes that matter.

At W4Tech, we advocate a third path: using AI agents to give the legacy system a new interface, without rewriting it.

The real problem is not the legacy system, it is access

Legacy systems rarely fail to execute their rules. They fail to integrate. The rules are trapped in screens, procedures and code that only a small team understands. Generative AI, in turn, is great at interpreting intent in natural language, but it cannot act safely on systems it was not designed to access.

An AI agent in production needs three things that the legacy system, on its own, does not offer:

  • Well-defined tools, with clear inputs and outputs, to execute actions.
  • Reliable context, that is, correct data at the right time.
  • Control, with permissions, auditing and the possibility of human intervention.

The good news is that these three points can be built around the legacy system, not inside it.

The layered approach

We work with an architecture that is simple to explain and incremental to deploy.

  1. Legacy system, essentially untouched. It remains the source of truth. Changes are minimal and surgical.
  2. Exposure layer. Relevant rules and operations are exposed as well-defined APIs or as tools via MCP (Model Context Protocol), an open standard for connecting agents to systems and data. This is the step that demands the most engineering: understanding what the legacy system really does and turning that into clear contracts.
  3. Agents. Each agent has a restricted scope and a limited set of tools. Specialized agents, instead of a "super agent" that does everything, are more predictable, easier to test and safer.
  4. Explicit workflows. Instead of letting the flow emerge from a free conversation between agents, we define the execution paths as a graph: who does what, in what order and under which conditions. This allows human approval points, checkpoints and replay of executions. Frameworks such as Microsoft Agent Framework, which unified Semantic Kernel and AutoGen, were designed exactly for this kind of orchestration.
  5. Governance and observability. Every tool call, decision and answer is recorded. Standardized telemetry (such as OpenTelemetry), access control and an audit trail are not optional in regulated environments. They must exist from day one.

An illustrative example

Imagine an operation in which analysts spend part of the day querying an old system to answer questions about process status, pending items and applicable rules.

With the layered approach, the legacy system starts exposing specific queries as tools. An agent receives the question in natural language, decides which queries to run, consolidates the result and answers citing the source of the data. Actions that change state, such as approving or canceling something, go through a workflow with mandatory human approval.

The legacy system stays the same. What changes is that the knowledge trapped in it becomes accessible, with traceability. (This is an illustrative scenario, not a specific client case.)

The risks that cannot be ignored

Agent projects fail less because of model limitations and more because of the lack of engineering around the model. The points that deserve the most attention:

  • Least permissions. Each agent should access only what it needs, with the right credentials and scope.
  • Human-in-the-loop where there is risk. Irreversible or high-impact actions require approval.
  • Continuous evaluation. Answers and behaviors must be tested with real cases before and after each model or prompt change.
  • Cost and performance. Without monitoring, the cost per execution can grow without anyone noticing.
  • Security against manipulation. Agents that read external content need protection against malicious instructions embedded in that content.

How to start: diagnosis, proof of concept and scale

The roadmap we recommend is lean:

  1. Diagnosis. Map systems, processes and data. Identify where there is the highest operational cost and the lowest risk to start.
  2. Focused proof of concept. One real, bounded flow, with success metrics defined before the start and observability from the beginning.
  3. Scale with governance. Reuse the exposure layer, standardize tools and agents, and expand to new flows with the same control base.

Conclusion

Modernizing legacy systems and adopting AI are not competing agendas. Done well, they reinforce each other: the legacy system carries the business knowledge, and agents make it accessible, auditable and useful. The question stops being "when will we rewrite everything?" and becomes "what is the first flow we can unlock?".

AI AgentsMCPLegacy SystemsGovernance

Want to apply this in your operation?

Tell us about your environment and our team will assess the best path — with the pros, cons, and limits of each approach.