Anthropic Migrates Messages API from Python to Rust Using Autonomous Agents
According to Anthropic Research: Anthropic reports it migrated its core Messages API from Python to Rust while keeping the live service running. By turning production traffic into a verifier and deploying autonomous agents to fix discrepancies, the new API achieves about 70% less CPU usage per request and a faster response time.

Original image temporarily unavailable
According to Anthropic Research:
Background and Challenge
Anthropic built its Messages API in Python in 2023, but as API traffic grew significantly and safety classifiers, prompt tokenization, and multi-step streaming added overhead, Python became a performance bottleneck. While incremental rewrites only yielded minor gains, a full rewrite was traditionally considered too risky due to incomplete test suites and the difficulty of defining correctness for a live, changing system.
Verification and Autonomous Agents
To safely migrate the service without taking it offline, the team used the production system itself as an oracle. They set up a shadowing system that compared Python and Rust outputs on live traffic without reading private user data, utilizing checkpoints and fingerprints to isolate differences. Autonomous Claude agents operated within verification loops: a fast inner sandbox loop for iterative testing and a slower outer loop validating fixes against production traffic, while human engineers reviewed pull requests and guided policy.
Results and Impact
The migration reduced CPU usage per request by about 70% and cut the median time to first token by roughly 20%, all without freezing feature development or taking the service offline.
View selection rationale
Importance 92/100
About this brief
- Content type
- News summary
- Source type
- First-party / official source
- Original source
- Anthropic Research ↗
- Source published
- Process
- AI-assisted discovery, translation, summarisation, classification and scoring; standards and corrections are maintained by the editorial desk.
- Verification
- The original URL and publication metadata are retained. This brief is not independently fact-checked unless explicitly stated.
- Published by
- Polyemergence Editorial Desk
- Conflict disclosure
- No financial or commercial conflict declared.

