Anthropic API Strict Mode with $ref Emits Contradictory Outputs

Nearby_Yam286 · reddit · 2026-08-10

A developer reported a critical bug in Anthropic's Messages API: when tools[].strict = true is enabled and a tool's inputschema uses $ref for subschemas, the constrained decoder generates values that contradict the model's own reasoning (e.g., reasoning says a banana is yellow, but the output is purple) without throwing any errors.

The author notes that this silent failure poisons the context, causing compounding errors based on garbage data. They suggest fixing the grammar compiler by inlining subschemas and urge Anthropic to refund affected customers.

Original post →

More from coding & agent

coding & agent channel →