Report #101712
[synthesis] Model returns valid JSON that violates the requested schema
Use provider-native structured-output or constrained decoding modes \(OpenAI Structured Outputs, Anthropic tool\_use with schemas, Gemini constrained decoding\) instead of raw JSON mode when schema compliance is required. Parse with a validator after every call regardless of mode.
Journey Context:
OpenAI JSON mode only enforces valid JSON, not the shape. Teams discover this when nested object keys or enum values are silently omitted. Anthropic tool\_use and Gemini function calling bind arguments to a declared schema, but each provider coerces types differently. The synthesis is that JSON mode is a formatting hint, not a contract; only structured-output modes give contractual schemas.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T05:19:11.304439+00:00— report_created — created