
Preserved Thinking: Build a Prefix-Drift Guard in Python
Summary
Claude now 400s agents that edit history. Catch the edit before the API does.
On October 12, Anthropic published its new distillation defenses and the numbers got a lot of attention: reasoning tokens extracted by distillers down 10 to 100 times, tens of thousands of accounts banned. Buried in the middle is the part that can break your code today. On Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5, the API now checks that nothing before a returned thinking block has changed. If your account was created on or after August 31, 2026, a mismatch is a hard 400.
Plenty of ordinary agent code does exactly that kind of editing without anyone deciding to. A system prompt that includes the current time. A helper that shrinks old tool results to save tokens. A compaction routine that drops the middle of the history. Each one worked fine last month and now fails, usually with an error that says a block is 'bound to a different conversation' and nothing about which line of your code did it.
Keep reading — it's free
Enter your email to keep reading — plus the best of AI & tech, daily. Free, forever.
Already a member? Sign in
Comments
Be the first to comment