AI agents
AI agents for legacy code: fast drafts, no authority.
Coding agents can read an old codebase, propose changes and run the tests. They cannot be accountable for the result. Engineers are.
The short answer
AI coding agents can read legacy code, explain it, propose changes and run tests in a loop. They work best on bounded tasks with good tests, such as upgrades and refactors. They fail where behavior is undocumented or untested. Ace8 uses agents as drafters. Tests gate their output and a named engineer reviews it.
Capability
What can an AI agent do on legacy code?
An agent is a model with tools: it can open files, search, edit, run the build and read the failures. That loop is what separates it from a chat window. On a legacy codebase it is useful for a short list of jobs.
- Explaining unfamiliar code and drawing out the call paths, which shortens onboarding.
- Writing characterization tests that record what the code does today.
- Making a repetitive change across many files and fixing the compile errors that follow.
- Drafting a migration for one module so an engineer can judge the approach.
- Updating documentation to match what the code does.
Limits
Where do agents fail on legacy code?
The failures are predictable, which makes them manageable.
- Behavior defined by runtime configuration or by data in a database the agent cannot see.
- Business rules that no test covers. The agent will not know the rule exists, so it can delete it.
- Very large files and deep call chains, where the agent loses context and starts guessing.
- Changes that compile and pass thin tests but alter results, such as rounding, date handling or character sets.
- Languages and platforms with little public training material, which raises the error rate.
Controls
What controls keep agent output safe?
- 1
Tests first
Write or extend tests before the agent touches the code. The tests are the specification it is held to.
- 2
Small scope
One module or one change type per run, so the whole diff fits in a reviewer's head.
- 3
Isolated environment
The agent works on a branch in a sandbox with no production credentials and no write access to shared systems.
- 4
Automated gates
Build, tests, static analysis and dependency scanning run before a person reads anything.
- 5
Named reviewer
A senior engineer reads the diff and signs it. Rejected output is rewritten by hand.
Choosing
Agent or deterministic tool: which for which job?
Deterministic tools such as OpenRewrite go first because they are repeatable. Agents cover what the recipes leave behind.
| Job | Better fit | Why |
|---|---|---|
| javax to jakarta rename | Recipe | Rule-shaped, same result every run |
| Spring Boot 2 to 3 property and API changes | Recipe first, agent for leftovers | Most changes are mechanical; a few need judgment |
| Replace a server-specific security call | Agent draft, engineer review | Depends on how your server is configured |
| Write tests for an untested class | Agent | Open-ended and easy to check by running them |
| Decide how to split a monolith | Engineer | A design choice, not a rewrite |
Beyond Java
What about COBOL and mainframe code?
People search for agents that can translate COBOL. Agents can explain COBOL and draft translations. The hard part is not syntax. It is copybooks, batch scheduling, data formats and the behavior of the platform around the program. Ace8 focuses on enterprise Java, so we do not offer mainframe translation. The same controls apply to any language: tests first, small scope, human review.
Practice
How does Ace8 use agents?
We use agents inside the method described on the method page: test before you touch, AI drafts and engineers decide, every step reversible. We pick agents and tools per codebase, and we compare them on the same sample application. See the tools benchmark once it is published, and the wider AI-assisted modernization guide.
We have not yet published results from our own agent runs, so this page claims no speed-up figures. When the runs are done we will report files changed, test results before and after, manual fixes and review minutes.
Not safely. Agents can draft and test changes, but without tests that capture real behavior and an engineer reviewing the diff, errors reach production. Use them as drafters, not decision makers.
General coding agents can help with explanation, tests and bounded refactors. Results depend on test coverage and task size more than on the product. Compare them on your own code before committing.
It can draft translations and explain programs. The risk is in data formats, batch behavior and surrounding platform details, which need tests and review. Ace8 does not offer mainframe translation.
It works on a branch in a sandbox with no production access. Tests and static checks gate its output, and a named engineer reviews the diff before merge.
Use recipes for rule-shaped changes because they are repeatable, and agents for the cases recipes do not cover.
Know the cost before anything moves.
A fixed-price assessment gives you the inventory, the risk score and a phased plan. Scope and cost are fixed before the migration starts.
Book a Fixed-Price AssessmentGet in touch
Talk to a modernization engineer
Tell us what you run today. An engineer, not a sales script, replies within one business day.