Anthropic rewrites API from Python to Rust in five months
Anthropic’s Cloud Platform team migrated its entire API layer from Python to Rust in five to six months. The project leveraged AI agents to handle the bulk of the code generation, with humans focusing on verification and coordination.
Anthropic’s Cloud Platform team rewrote its entire API layer, including authorization, authentication, tokenization, billing, and security safeguards, from a Python monolith to Rust in five to six months. The original Python system, built by a small research team about three years ago, ran in a single GCP region and faced CPU constraints as request volumes spiked, particularly after a Super Bowl commercial. The team chose Rust over Go or C++ for its memory safety and compile-time checks, which align with AI agent capabilities. A new senior engineer proposed a 'Great Leap' strategy: forking the codebase to build a parallel Rust system while keeping a thin Python front door. They used shadow traffic to compare outputs, verifying consistency by checking token counts and pre-inference layers, as they could not inspect raw user data for privacy reasons.
After driving the difference rate to near zero, they rolled out the Rust system with a Python fallback. The team reported that 80% of agent-generated pull requests were not deeply read by humans, while 20% required detailed investigation. The project highlighted that coordination with other teams, rather than code writing, became the primary engineering effort. Caitlin, head of engineer for Cloud Platform at Anthropic, argued that AI agents enable faster language migrations and that verifiable outputs reduce the need for humans to read every line of code. The original plan was to splice off pieces of the system and rewrite those in Rust, but the parallel approach allowed for a faster, safer transition that maintained service availability throughout the migration.