Four engineering teams moved live production systems to Rust in 2026, and each used AI agents to write the new code. Anthropic moved its Messages API from Python. OpenAI moved its Habitat storage service from Python. Bun moved its runtime from Zig. GitHub moved its Copilot agent runtime from TypeScript. The agents wrote the code quickly. Each team then had to prove that the new system behaved like the old one.
Four Live Systems Moved to Rust in 2026
| Team | What moved | Reported scale | Reported result |
|---|---|---|---|
| Anthropic | Messages API, Python to Rust | API traffic grew about 1,800 times from early 2024 to fall 2026 | About 70% less CPU and over 80% less memory per request, and about 20% lower median time to first token |
| OpenAI | Habitat storage service, Python to Rust | More than 70 million requests per second, 500 petabytes of data | 6x more CPU efficient and 15x more memory efficient. 95% of production requests were on Rust by September |
| Bun | JavaScript runtime, Zig to Rust | 535,496 lines of Zig in 1,448 files | Merged in 11 days with the full test suite passing and 0 tests skipped or deleted |
| GitHub | Copilot agent runtime, TypeScript to Rust | 832,378 lines of production Rust, over about 14.5 weeks | CPU on one benchmark fell from 312 seconds to about 110 |
Checkly added a fifth case with a smaller language jump. It rewrote a service that processes 92 million messages a day from Node.js to Go. The Checkly team reports zero incidents, 70% fewer running pods, about 15 vCPU and 45 GB of memory freed, and about 15% lower database CPU.
OpenAI's post says two engineers, Codex, and GPT-5.5 rewrote Habitat in the second quarter of 2026. OpenAI describes the choice to wait as a bet. In 2025 the team kept Python on purpose. It expected its own coding models to make the later migration possible. It has not yet published how it verified the Rust service. It says more will come in a future post.
Why Rust, and Why Now
Agents cut the cost of a port. Rust's compiler checks memory safety on every line.
Bun's creator, Jarred Sumner, wrote that a rewrite would once have taken a small team a full year. It would also have frozen features and fixes. He ran about 50 agent workflows over 11 days instead, with 64 Claude agents running in parallel. The agents made 6,778 commits. The port started on May 3 and merged on May 14. Bun is owned by Anthropic, and Sumner discloses this in his post.
Bun's reason for Rust was memory safety. The bug list in Bun v1.3.14 was full of crashes from memory used after release, memory released twice, and leaks on error paths. In safe Rust, the compiler rejects these bugs on every line the agents write.
Anthropic's reason was Python overhead on every request. By late 2025, each request was validated, tokenized, and screened by safety classifiers. The tokens of each reply were sorted into text, thinking, and tool calls. A partial rewrite that moved only the output parser to Rust cut CPU by 8% to 10%. Anthropic reports that each token then crossed between Python and Rust three times, and the team moved the whole path. OpenAI wrote that Python's inefficiency would not be acceptable at 100 times the scale.
Checkly also found that Go's type system suited agents better than JavaScript.
How Anthropic Used Production Traffic as the Verifier
Anthropic's Rust API passed about 98% of its tests in April. On live production traffic, only about a quarter of inputs matched what the Python API produced. The gap came from cases the tests never covered. For example, Python escapes an emoji inside a JSON tool call as a text code. Rust wrote the emoji as is. The two prompts differed by a few bytes, and a model reads them differently.
Anthropic's own tests were also a weak oracle. They were tied to the Python code, and Claude had ported them. An audit found more than 100 weakened assertions. A passing test could mean the code was right or the assertion was weakened.
So the team used the running Python API as the oracle. The method had four parts:
- Run the model once. Claude is nondeterministic, and a request must count once toward a customer's limits and bill. The team called the model once and replayed its output to the Rust code.
- Compare every step. Both versions accept or reject the request, resolve settings, and build the prompt. The first step that differed showed where the bug was.
- Record the shape of each difference. Engineers could not read customer requests. The record held the step, the piece of the prompt, the lengths, and the first differing byte. It held no text.
- Group by fingerprint. One bug leaves the same fingerprint on every request it touches. Grouping by fingerprint turned hundreds of thousands of differences into a short list of bugs.
A script grouped new records every 10 to 30 minutes. A coordinating agent assigned one worker agent to each new kind of difference. The match rate on the compared inputs rose from 24% to 99.6% by August.
Three loops ran around the agents:
- Inner loop. Each agent worked in a sandbox with both codebases and a local check that built the prompt in each version without calling the model. A comparison took under a second. The agent guessed a cause, wrote a request to trigger it, and edited the Rust until both versions matched.
- Outer loop. After an engineer reviewed and merged a fix, the team deployed it and watched shadowed live traffic for the fingerprint. If it came back, the task returned to the inner loop.
- Memory loop. Engineer corrections became rules that every later agent read, plus tests and lint rules.
The review gate caught one shortcut. A prompt was missing a web search tool description that the Python API fetched from an internal service. An agent copied the text into a file, and the prompts matched. An engineer rejected the fix. Rust would still need to call the service before launch, so the copy was throwaway code. The agent had matched the output with a copy of the text, and the engineer rejected it.
The result shipped without taking the API offline or freezing feature work. Merged changes to the Rust code rose from under 100 per two-week period in April to more than 3,000 by August.
How Bun, GitHub, and Checkly Verified Their Ports
Bun's test suite is written in TypeScript. It does not depend on the language of the runtime, so it judged the Zig and Rust versions alike. Sumner described it as a suite with a million assertions. He added adversarial review. One agent writes the change, and at least two other agents try to find bugs in it. The writer never reviews, and the reviewers never write. He also checked by hand that tests ran and were not skipped. Since the merge, Bun has completed 11 rounds of security review.
GitHub ported the Copilot runtime in portions and released them in stages. The author wrote that the runtime's parts depend on each other too closely to run old and new side by side. The team released the port in portions, so users did not meet every ported line at once. By September 14, the team had traced dozens of regressions and fixed all of them. Most were correctness bugs, and a smaller set were performance bugs. None came from Rust's unsafe mode, which switches off some of the compiler's memory checks. GitHub also reports about $120,000 in token spend and about three weeks of one developer's time.
Checkly saved the old service's outputs as golden files. The tests compared the new service's downstream effects to the golden files byte by byte. Customers moved in stages, from free accounts to paid ones, and the full customer migration took about a week.
Four Ways to Define "Correct"
| Oracle | Used by | Works when | Weak point |
|---|---|---|---|
| A language-independent test suite | Bun | The suite is large and independent of the old code | Passing the suite does not prove every behavior |
| Golden files recorded from the old system | Checkly | You can build realistic inputs | Inputs you did not record go unchecked |
| Live traffic run through both versions | Anthropic | The service can run twice safely | Needs a way to avoid double side effects |
| Staged release with the old code as fallback | GitHub | Components can be swapped one at a time | Regressions reach real users before they are found |
Anthropic and Bun also added review gates. Anthropic's engineers reviewed fixes, rejected shortcuts, and decided whether a difference was a bug or a deliberate change. Bun ran at least two reviewer agents on every change. For more on review at this volume, see our post on how Meta and Shopify verify AI-generated code.
How OpenNash Software Factory Applies This to Legacy Systems
Legacy systems often start without tests. Bun had a suite with about a million assertions. A 30-year-old billing system may have none. Its behavior lives in the code, in the data, and in the heads of a few people. The method still applies, because Anthropic and Checkly used the old system as the oracle.
OpenNash Software Factory records how the old system behaves on real work. It builds the checks from those recordings. Agents then change the code in small slices against the checks, and your engineers approve each pull request through your own review process. Traffic moves to the new system in steps, and the old system stays as the fallback.
Each problem the labs met has a counterpart in a legacy migration:
| Problem at the labs | Legacy counterpart | Factory step |
|---|---|---|
| Tests passed at 98%, but only about a quarter of production inputs matched | Unit tests, if they exist, miss the odd cases that real batch files and messages contain | Replay recorded production inputs through old and new, and compare |
| A request must count once toward limits and bills | A second run must not post a payment twice or email a customer twice | Run side effects once. The new system writes to a sandbox copy of the data |
| Engineers could not read customer requests | Banking, health, and insurance data must stay masked | Compare field by field. Log field names and sizes, not values |
| The Python API kept changing during the migration | The old system gets patched while the rewrite runs | Track each change to the old code and port it, so nothing freezes |
| An agent matched the output with a throwaway shortcut | Agents optimize for the check they are given | An engineer reviews every pull request before it merges |
| Merged changes grew to more than 3,000 per two weeks | A large estate produces many pull requests | Budget reviewer hours, and keep each change small |
Our earlier posts cover the parts in more depth: why enterprise AI stalls on legacy systems and why verification now sets the cost of legacy modernization. For the highest-risk rules, see formal verification for AI agent output.
Limits of the Reported Results
All five projects are self-reported by the companies that ran them, and the measures differ. Anthropic reports CPU per request. OpenAI gives an efficiency ratio. GitHub reports one benchmark. The results cannot be ranked against each other. Bun is owned by Anthropic, so two of the projects come from one company.
Most of the verification detail comes from Anthropic, Bun, and Checkly. OpenAI has not yet described its checks. GitHub traced dozens of regressions during the port and fixed them all. Its staged release limited how many users each one reached.
Large campaigns also produce rejected work. A Bloomberg paper on migrating about 1,900 Python repositories and about 6,700 C++ repositories reports 2,333 pull requests and 729 successful migrations. These were build and packaging migrations, not language rewrites. Not every pull request ended in a successful migration.
Start With One System
Pick the system that costs the most to keep running. We start with that system alone and do these steps with your team:
- Map the system. We document what it does, its business rules, and who depends on it.
- Record real behavior. We capture inputs and outputs from live work and turn them into the checks.
- Run the loops. Agents change one slice at a time against the checks, and your engineers review each change.
- Move traffic in steps. Old and new run side by side until the results match.
Book a call with an OpenNash forward-deployed engineer or email us at hello@opennash.com. We review your legacy systems, rank them by cost to run, and pick the first one to modernize.