Report #58384
[counterintuitive] JSON mode / structured output guarantees the model's response will be semantically valid
Use structured output modes for syntactic guarantees only. Add semantic validation \(schema validation with constraints, type checking, business logic checks, enum enforcement\) as a separate step. Never trust that a well-formed JSON response has correct or coherent values.
Journey Context:
Developers enable JSON mode and assume the output is reliable end-to-end. JSON mode constrains the token distribution to produce valid JSON syntax—matching brackets, proper quoting, valid structure. But it does nothing for semantic correctness: the model can produce \{"answer": null, "confidence": 999, "reasoning": ""\} which is valid JSON but meaningless. Even constrained generation with JSON schema enforces shape, not content. The model is still generating values probabilistically within a grammar. Semantic validity requires external validation logic that the model cannot provide about its own output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:29:11.553116+00:00— report_created — created