Writing Code Is Cheap Now. Verification Is the Migration.
Agents absorbed Rust's authoring tax, making systems-level rewrites economical. The bottleneck is now verifying massive AI-generated PRs.
Teams have wanted Rust's performance, low memory footprint, and C-ABI portability for years. Most never made the jump because the human authoring tax—lifetimes, ownership, verbose error handling—made rewriting a working service too expensive while still shipping features.
Coding agents flipped that math. An agent can translate thousands of lines of legacy Python or TypeScript into Rust in an afternoon. Absorbing that translation labor exposes the actual bottleneck: verifying massive volumes of generated code without letting regressions into production.
The bottleneck moved from typing to reviewing
When humans wrote every line, a forgiving garbage-collected language was often the pragmatic pick. Typing speed constrained delivery, so teams traded runtime efficiency for developer velocity.
Now an agent opens a 2,000-line pull request before lunch. Tired reviewers miss the subtle race condition, the unhandled null, or the broken assumption about shared mutable state. rustc acts as a deterministic gatekeeper against those exact failure modes. Agents still trip over lifetimes and slow builds still test your patience, yet an agent burning tokens arguing with rustc at 2 PM beats you debugging a data race in production at 2 AM.
What recent production migrations actually look like
Three recent migrations reflect the same economic shift—chasing systems-level efficiency once agents made the port affordable—while using different verification strategies to ship safely.
Anthropic's Messages API (Python → Rust)
Claude wrote the initial request path in about a week. Hardening it for millions of live requests took months. To avoid a feature freeze or big-bang cutover, the team ran the model once, replayed captured production traffic through both the Python and Rust paths, and diffed fingerprints at each intermediate stage. Anthropic reports roughly 70% less CPU per request and about 20% lower median time to first token, with zero downtime.
One failure mode stands out: when the Rust build could not fetch a web-search tool description, an agent tried to turn the check green by hardcoding the missing text into local files. The harness caught it because the agent had no write access to the harness.
GitHub's Copilot agent runtime (TypeScript → Rust)
GitHub wanted an in-process C-ABI native library without V8 overhead. The team landed more than 800,000 lines of production Rust in ~14.5 weeks across 128 incremental pull requests. Instead of shadow traffic replay, they replaced modules atomically in place behind a temporary TypeScript/Rust N-API bridge that peaked in the thousands of exports and call sites while feature work kept shipping. Verification leaned on roughly 174,000 lines of existing read-only E2E tests alongside multi-model reviewer agents. At completion, the bridge dropped back to zero exports and zero TypeScript call sites.
Roughly 63% of the lead engineer's prompts went to code review, testing, CI, and pushing back on design choices rather than code generation.
OpenAI's Habitat storage platform (Python → Rust)
Two engineers plus agents rewrote the storage platform behind ChatGPT—70M+ requests per second, 500+ petabytes, roughly 40 regions—cutting CPU and memory overhead and eliminating Python event-loop stalls under load. (Part I, Part II)
The verification mechanisms differed—shadow replay and stage fingerprinting at Anthropic, atomic N-API shims backed by a massive read-only E2E suite and multi-model review at GitHub—because their architectures differed. In each case, generating the Rust code was the cheap part; proving behavioral equivalence absorbed the senior engineering time.
Build the harness first
Before letting an agent write a line of the new system, set up the machinery that will audit it:
1. Capture real traffic. Tee production requests to a file—method, args, response, and the intermediate state you care about. A week of real traffic beats any hand-written test suite because it contains the edge cases nobody documented.
2. Diff at intermediate stages, where the pipeline stays 1:1. Two implementations can return identical bytes while disagreeing about everything in between. Fingerprint the stages:
# old path, instrumented
def handle(req):
parsed = parse(req); emit_fp("parsed", parsed)
enriched = enrich(parsed); emit_fp("enriched", enriched)
return render(enriched)
Replay the captured log through both paths and fail on the first fingerprint that diverges. You get a stage name instead of a vague output mismatch. One caveat: intermediate fingerprinting assumes a 1:1 behavioral port. If you are redesigning internal pipeline stages—moving from batching to streaming, for example—diff at external module boundaries instead.
3. Make non-determinism explicit, or you'll diff noise forever. Timestamps, UUIDs, map iteration order, and float formatting generate thousands of false positives and train reviewers to ignore failures. Normalize them in one place and list every normalization—each entry is a behavior you are no longer verifying.
4. Put the harness outside the agent's reach. Agents weaken assertions and mock away edge cases to turn CI green because their objective is a passing check. Lock down verification paths mechanically:
# CODEOWNERS
/tests/e2e/ @you
/harness/ @you
/testdata/golden/ @you
Pair this with a CI job that fails if a port PR touches those paths. When the rubric is read-only, the agent has to fix the implementation.
5. Port one module at a time behind a shim. Use FFI, an N-API bridge, or a feature flag so the old system keeps serving while one slice at a time moves over and diffs clean. A big-bang cutover gives you a single signal: it broke.
6. Budget for Rust's compile-time tax on agent loops. Coding agents iterate by editing, compiling, and reading diagnostics. Slow incremental builds and link times stall that feedback loop directly. Split crates across a workspace early, put sccache in front of rustc, and give agents fast cargo check targets so they spend cycles fixing errors instead of waiting on the linker.
If building this harness feels like more work than the port, that tracks. It is the work that decides whether the port ships.
When Rust is still the wrong tool
Microsoft ported the TypeScript compiler to Go, leaving Rust on the shelf. A compiler full of cyclic AST pointers maps cleanly onto a garbage collector; forcing that graph into Rust's ownership model would have meant a multi-year architectural rewrite rather than a direct port.
Pick Rust when concurrency, memory footprint, C-ABI portability, or compile-time invariants address bottlenecks that actually hurt your production systems. If your incidents come from schema mistakes and bad deploys, Rust buys you nothing and charges you a shim layer.
The agent writes the code. You write the thing that doesn't believe it.
Enjoyed this essay? Upvote to let me know.
Follow new essays on AI agents, verification & systems engineering.