Report #71291
[counterintuitive] JSON mode guarantees schema validation LLM
Use strict structured output features \(like OpenAI's Structured Outputs with \`json\_schema\` or grammar-constrained decoding\) or always validate the output against a JSON schema before processing.
Journey Context:
Developers enable 'JSON mode' thinking it guarantees the output matches their expected schema. Older/basic JSON modes only guarantee the output is \*valid JSON\*, not that it contains the required keys, correct types, or enum values. It might just output \`\{\}\` or omit mandatory fields. True schema enforcement requires constrained decoding or post-generation validation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T02:14:35.414168+00:00— report_created — created