Back to feed

Migrating our Messages API to Rust

Anthropic Engineering Blog

Nov 25, 2026

11/25/2026

Automate Diagnosis And Iteration With Human Oversight For Ship-Quality Design Judgments

Migrating our Messages API to Rust · Anthropic Engineering Blog

Science, Technology & Innovation · Nov 25, 2026

The migration used separate fast, slow, and persistent learning loops: agents automated diff diagnosis and sandbox iteration, while production-shadowed evaluation and human review guarded against brittle fixes and ensured sound system design.


11/25/2026

Observability Can Focus On Structured Difference Metadata To Localize And Group Defects Without Reading Prompts Or Replies

Migrating our Messages API to Rust · Anthropic Engineering Blog

Science, Technology & Innovation · Nov 25, 2026

Anthropic enabled privacy-preserving shadow testing for its customer-facing AI API by running requests once, replaying outputs through Rust, and comparing deterministic pipeline stages. It avoided double billing and private-content inspection while using divergence fingerprints to cluster and triage recurring bugs.


11/25/2026

Production Parity Must Be Measured Against Real Behavior Rather Than Tests

Migrating our Messages API to Rust · Anthropic Engineering Blog

Science, Technology & Innovation · Nov 25, 2026

Anthropic found that a 98% test-pass rate masked poor production parity—only about 25% of inputs matched the Python implementation—so migration efforts should establish production-based verification before scaling AI-generated code; as implementation accelerated, verification became the main bottleneck.


11/25/2026

Full Rust Rewrite Outperformed Partial Optimizations By Cutting CPU And Latency, Revealing A Trade-Off Between Rewriting And Interoperation Costs

Migrating our Messages API to Rust · Anthropic Engineering Blog

Science, Technology & Innovation · Nov 25, 2026

Anthropic’s full Python-to-Rust Messages API migration cut CPU per request by about 70% and median time to first token by about 20% while preserving service availability and feature work. It outperformed a partial rewrite because Python–Rust interoperation costs had limited earlier gains, and durable parity checks, drift tests, lints, and merge controls helped manage migration risk.