Skip to content
AI.info

The Pulse

Microsoft Details Agent-Led Migrations Across Huge Codebases

Microsoft says AI agents are helping small teams migrate codebases that span hundreds of millions of lines, including work on Windows and Azure. Its approach pairs automated changes with reviewer agents, testing and formal verification to c

Microsoft Details Agent-Led Migrations Across Huge Codebases

AI.info Team · Written with AI · fact-checked ·

“Generating code is becoming the easy part. Knowing whether to trust it is the real challenge.”

Sriram Rajamani, CVP, Future of Scalable Software Engineering, CoreAI, Microsoft, and Tim Bozarth, CVP, Eng Horizons, CoreAI & EngThrive, Microsoft

Small teams, sprawling migrations

Microsoft’s account of its agent-led software work, published October 26, describes a shift from using language models as steps in prewritten workflows to building tools that agents use to plan and carry out migrations. The company says it is applying the approach to large codebases, including Windows and Azure, where changes can span hundreds of millions of lines. One example it gives is a 400-million-line migration to a new compiler toolchain.

Microsoft defines a migration as a codebase-wide change serving an engineering goal: upgrading dependencies, adopting a compiler, fixing static-analysis findings or moving to a new platform. Its named examples include bringing the Windows codebase, which it describes as several hundred million lines, to the Clang/LLVM toolchain; addressing findings from CodeQL, PREfast and Roslyn analyzers; and retargeting services from x86 to ARM.

Rather than ask thousands of engineers to handle fixes across their own teams, Microsoft says a small group of migration experts should lead the work. Agents sample findings and propose a candidate knowledge base of how to address them. A reviewer agent scores proposed fixes for correctness, minimality, consistency with local file conventions and maintainability; experts approve the guidance, then agents apply it across the codebase.

Review the rules, not every edit

That arrangement shifts human review toward decisions that set or refine the rules, as well as unusual or ambiguous cases. Microsoft says reviewer feedback can improve the knowledge base, while grouping similar fixes makes it easier to assess repeated changes. The company’s stated aim is to avoid requiring an engineer to inspect every agent-generated edit individually.

The approach still depends on people judging whether the guidance is sound and whether exceptions need attention. A reviewer agent can score a fix against criteria, but those scores do not by themselves establish that the change preserves a system’s intended behavior. Microsoft’s emphasis on testing and formal methods addresses that harder question.

Rust migration adds behavior checks

Microsoft also describes efforts to translate legacy C and C++ code into Rust. Its account traces a progression from Rust output that did not compile in January 2025, to code that compiled but failed to work correctly or pass tests by June. By September 2025, it says, teams had produced working translations of about 30,000 lines with manual guidance; from February 2026 onward, the company says it began modernizing large codebases with significant automation.

Microsoft favors translating feature by feature instead of converting a component line by line. Each feature represents user-visible behavior that can be checked end to end with scenario-driven tests, with its own validation gate. Differential testing compares the original and translated programs, while tests withheld from the agent are used to check whether the translation holds up beyond examples it saw during development.

The company says it has also begun extracting formal specifications from source code, carrying them into Rust and using Verus to prove that the modernized code satisfies them. Those checks add evidence about defined properties; they do not, by themselves, show that the properties capture every requirement engineers intended the old system to meet.

Specifications can inherit old mistakes

Microsoft’s post identifies that limitation directly in its discussion of agent-generated specifications. When an agent infers a specification from the code it is meant to check, the specification may describe what the program already does rather than what it ought to do. The company says a mismatch between a test trace and a specification could point to a code defect, an inaccurate specification or an invalid test assumption.

For that reason, Microsoft presents the work as more than automated code generation: agents can propose changes and help create tests or formal models, but engineers still need to approve the properties those tools use to judge the result. Its account leaves open how teams should assign code ownership when agents can change code across traditional boundaries. The immediate engineering test is whether the small expert group can validate migration rules and exceptions before those rules reach hundreds of millions of lines.

Source

Explore

More articles