Report #83794
[counterintuitive] Does LLM JSON mode guarantee valid application schemas
Use structured output features \(like OpenAI's Structured Outputs with \`json\_schema\` or Instructor\) that enforce grammar, rather than just \`response\_format: json\_object\`, and still validate on the client side.
Journey Context:
Developers enable 'JSON mode' thinking it guarantees the output conforms to their specific application schema \(e.g., matching required fields, types\). Older JSON modes only guaranteed syntactically valid JSON \(it parses\), but the model could output \`\{'foo': 'bar'\}\` when you needed \`\{'name': 'string', 'age': 'int'\}\`. This led to downstream parsing errors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T23:13:53.945047+00:00— report_created — created