Share with your CTO
Microsoft used AI agents to rewrite the GitHub Copilot runtime from TypeScript into Rust, converting 430,000 lines of code into 800,000 lines of production Rust over 14.5 weeks at a total cost of roughly $120,000 in AI token usage plus three weeks of one engineer’s time. The result: a 15.9x throughput improvement on key benchmarks and a memory footprint drop from 1,383 MB to 126 MB for the same ten-agent workload. The runtime powers GitHub Copilot CLI, the Copilot SDK, VS Code, Visual Studio, Excel, Outlook, and a growing list of Microsoft cloud services.
What this means for your business
The cost structure of major rewrites just collapsed. What Microsoft Distinguished Engineer Stephen Toub described as a multi-year, multi-million-dollar effort by hand got compressed into a quarter and less than $200,000. If your engineering org has a legacy service written in a dynamic language that’s bottlenecking at scale, whether Node, Python, or Ruby, the credible path to a compiled rewrite is no longer a staffing problem. It’s a planning and review problem.
That distinction matters more than it sounds. The project logged dozens of regressions despite the code compiling cleanly. Rust’s compiler enforces memory safety but has no opinion on whether a function is in the right order, whether behavior drifted between the original and the port, or whether unwritten requirements were preserved. Consultant Lisa Crossman put it precisely at RustConf: “Rust stops the agent writing memory unsafe code; it does not stop the agent writing the wrong program correctly.” Compiler approval is a necessary condition, not a sufficient one. Your review process has to carry the load the compiler won’t.
The signal worth watching is what comes after the port. Toub was explicit that the migration preserved the TypeScript structure module-by-module without optimizing the runtime’s architecture. The performance gains already achieved are the floor, not the ceiling. Any enterprise running agent-heavy infrastructure at scale should be asking whether its current language choices are a genuine technical constraint or just inherited defaults that nobody has had the budget to revisit. That budget question now has a very different answer.
Concept deep-dive: Compiler-approved regressions
A regression is behavior that worked before a code change and breaks after it. In a language like Rust, the compiler enforces strict rules about memory ownership and type safety, which catches a wide class of bugs automatically. But the compiler has no model of intent. It cannot know that a function was supposed to fire before another, or that a missing feature from the original codebase was silently dropped during porting. When agents use the compiler as a pass/fail oracle rather than a diagnostic tool, they produce code that is technically valid but functionally wrong. Human review closes that gap.
Based on reporting from Microsoft agentically ports Copilot runtime to Rust for $120K, originally published 2026-09-18 17:11:00.
