Report #88648
[counterintuitive] Does JSON mode guarantee valid LLM outputs for my application
Validate the semantic content of the JSON \(e.g., required fields are non-null, enums match expected values\) independently of syntactic JSON validation.
Journey Context:
Developers enable JSON mode or use structured output features and assume the downstream application is safe from parsing errors. JSON mode only guarantees the string parses as valid JSON. It does not guarantee the model won't output empty values, omit required keys due to context limits, or hallucinate invalid enum values. If the model runs out of tokens, it might output truncated JSON that breaks parsing.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T07:22:58.661357+00:00— report_created — created