GitHub Used Copilot to Migrate Its Runtime to Rust: Lessons from 800,000 Lines of Code

GitHub used Copilot Agents to migrate its runtime to 800K lines of Rust — making a previously unaffordable rewrite possible.
GitHub's official blog details a landmark engineering effort: using their own Copilot Agent to migrate the Copilot runtime to 800,000 lines of production-grade Rust. The most significant signal isn't the technical details — it's GitHub's own assessment that a rewrite of this scale was simply unaffordable before AI Agents. This reframes AI coding tools from productivity enhancers to enablers, making previously infeasible projects viable. The post also notes that large-scale migrations still require human engineers for architecture and quality review, and that first-party accounts should be read with appropriate skepticism.
GitHub's official blog has disclosed a symbolically significant engineering feat: the team used their own AI coding tool, Copilot, to migrate the Copilot agent runtime to 800,000 lines of production-grade Rust code. The number alone is striking — but what truly deserves attention is the judgment GitHub's team offered in the post: a rewrite of this scale wasn't affordable before AI Agents existed.
Why This Migration "Couldn't Have Been Done Before"
Migrating a mature runtime from an existing tech stack to Rust has never been a trivial undertaking. Rust's ownership model, lifetime management, and interface adaptation with existing systems all demand large amounts of tedious, error-prone manual work. When the codebase reaches 800,000 lines, the labor costs, time costs, and risk of errors under traditional approaches grow nonlinearly.
GitHub states plainly in the post that a rewrite of this size "wasn't affordable before agents." The weight of that statement lies in what it isn't saying — it's not about Copilot as an autocomplete tool saving developers a few minutes here and there. It's about an engineering project that was previously economically infeasible becoming viable because of AI Agent involvement. This marks a shift in how AI coding assistants are positioned: from productivity enhancers to enablers.

Why Rust Was the Migration Target
Choosing Rust as the migration target aligns with the broader trend in systems-level software in recent years. Rust's advantages in memory safety, concurrency safety, and runtime performance make it an ideal choice for refactoring core runtimes. For a foundational component like the Copilot agent runtime — which demands long-term stable operation, high performance, and high reliability — Rust's compile-time guarantees can significantly reduce the likelihood of production incidents.
Runtime components are often both the performance bottleneck and the critical reliability path for an entire product. Migrating to Rust signals that GitHub wants stronger determinism and lower resource overhead at the infrastructure level. These kinds of low-level rewrites are precisely where engineering rigor is most tested — a single memory error or concurrency race condition can cause production issues that are extraordinarily difficult to diagnose.
Rust's memory safety mechanisms rely on its unique ownership system: each value can have only one owner at any given time, and borrow rules statically check the validity of references at compile time. This fundamentally eliminates an entire class of vulnerabilities common in C/C++ — null pointer dereferences, use-after-free errors, data races, and more. These guarantees are enforced entirely at compile time without relying on garbage collection, so there's no GC stop-the-world pause to introduce latency jitter. For an agent runtime that needs consistently low-latency responses, this characteristic is especially critical. Microsoft, Google, and the Linux kernel community have all progressively introduced Rust into core system components for exactly these reasons.
The Role of AI Agents in Large-Scale Rewrites
The most compelling aspect of this story is the self-referential nature of the practice: using Copilot to migrate Copilot. The difference between AI Agents and traditional code completion lies in their ability to understand broader context, autonomously execute multi-step tasks, and handle cross-file refactoring to a meaningful degree.
In the context of migrating 800,000 lines of code, an Agent can take on work such as: bulk translation of equivalent logic, adapting to Rust's type system and error-handling patterns, and iteratively fixing compilation failures. This kind of work is repetitive and tedious for human engineers, yet still requires considerable accuracy — precisely the kind of task where AI excels and humans are prone to fatigue-induced mistakes.
It's worth staying clear-eyed here: GitHub's emphasis on "what it actually took" in the title hints that this was no one-click magic trick. Large-scale production code migrations still require human engineers for architectural decisions, code review, and quality assurance. AI Agents are better understood as powerful collaborators that dramatically compress costs — not full replacements.
The fundamental difference between AI Agents and traditional code completion (like early Copilot's single-line or single-function suggestions) lies in the autonomy and continuity of task execution. Traditional completion is reactive — it waits for human triggers, offers candidates, and lets the human choose. Agents are proactive — given a high-level goal, they can independently plan subtasks, invoke tools (such as compilers, test frameworks, and file systems), and iterate based on feedback, forming a closed execution loop. In a code migration context, this means an Agent can read source files, attempt translation, trigger compilation, analyze error output, and revise — without requiring step-by-step human intervention. This "perceive–reason–act" loop is the underlying reason Agents can transform rewrite work from labor-intensive to compute-intensive.
Implications for the Industry
This effort provides a first-hand reference point for "AI-assisted large-scale engineering." The signal it sends is this: as Agent capabilities improve, a whole category of previously shelved projects — technical debt repayment, legacy system modernization, cross-language migrations — may re-enter the realm of the feasible.
For organizations maintaining large legacy codebases, this trend is worth watching closely. The old economic calculus of "maintaining is cheaper than rewriting" is quietly being upended by AI Agents. As the marginal cost of a rewrite drops significantly, the decision space for technology selection and architectural evolution expands accordingly.
That said, this account comes from GitHub's own official blog, and as the tool provider, their presentation of the product's effectiveness naturally carries an inherent perspective. The true migration experience, the proportion of AI-generated code that actually made it to production, and the specific extent of human intervention all await validation from more independent, third-party accounts.
Related articles

The Return of Wind Power: How Cargo Ships Are Embracing Wind Energy to Cut Emissions
Why are cargo ships embracing wind power again? Explore rotor sails, hard wing sails, and other modern wind-assisted technologies driving shipping's emission-cutting comeback.

Scarier Than AI Agents Taking Over the Internet: A CEO Cartel Monopolizing AI
A Hacker News piece argues that a CEO cartel monopolizing AI is scarier than agents taking over the internet. This article examines AI concentration, open source, and governance.

Vercel AI SDK Alibaba Adapter Update: Multi-Turn Conversations Now Preserve Reasoning Chain by Default
Vercel AI SDK's @ai-sdk/alibaba adapter v0.0.28 now preserves reasoning chain by default in multi-turn conversations on supported models, improving coherence.