BlogAI Engineering

The Rules the Agent Left Behind: What a $50 Legacy Migration Teaches About Scoping

A new case study put a coding agent to work on a real corporate ERP written in Visual Basic 6. In a single pass, it migrated 12 features to C# .NET 10 for a total of $50.29.

The catch: 100 of the 331 business rules the researchers checked didn't make it across. That is about 30%, and nothing in the build would have told you.

The study is small (12 features, one model, one language pair) and its authors call the results "indicative". But the pattern is worth knowing before you hand a legacy system to an agent.

Complexity is the cliff

Simple features came across almost intact: 92% of their rules were preserved. Medium features reached 81%. Complex features reached only 47%, fewer than half their rules.

Where the rules hide

The rules the agent missed were mostly the ones nobody wrote down. Some were form validations scattered across interface events: logic in button clicks and field changes rather than in one place. Others were implicit defaults hidden in optional query parameters. If a rule isn't visible in one place, the agent is likely to skip it.

Where the money goes

99.6% of the tokens were input: the agent reading the legacy code, not writing the new one. Low-complexity features used about 1.47M tokens (about $1.66); high-complexity ones about 9.09M (about $10.28). Cost scales with how tangled the old code is.

Scope it before you hand it over

  • Start with small, well-scoped features. That is where agents performed best.
  • Extract the business rules first. Write them down before any code moves, including the ones in UI events and defaults.
  • Test rule by rule. Check each rule survived, not just that the new code compiles.
  • Keep people on the complex parts. Use the agent to speed them up, not to replace their judgement.

How we approach it at Zylen

Zylen is an AI optimization partner. We work inside the AI systems companies already run and improve cost, security and data control one measured change at a time. Our ten-day AI Optimization Audit maps where your legacy logic hides and which modules an agent can safely take on first.

Find the rules before the agent misses them: start the AI Optimization Audit →

Source: Alves, Politowski & Montandon, "Legacy System Modernization with Coding Agents: A Case Study", arXiv, August 2026.

Keep reading

Find out what your AI should actually cost you.

Ten days, a fixed price, and every workload metered. If nothing is live and measured at the end of day ten, there is no invoice.