Report #74252
[counterintuitive] Enabling JSON mode or structured output ensures the model's response will be logically correct and consistent
Use structured output for format compliance only. Always add explicit validation logic for semantic consistency—structured output constrains syntax, not semantics. A model in JSON mode will produce syntactically valid JSON with semantically contradictory values.
Journey Context:
JSON mode and structured outputs \(OpenAI's function calling, Anthropic's tool\_use\) constrain the output grammar to produce valid JSON, but they don't constrain the content of that JSON. A model in JSON mode will happily produce syntactically valid JSON where 'is\_valid': true while the 'errors' array is non-empty, or where 'total': 100 while 'subtotal' \+ 'tax' = 150. Developers treat structured output as a correctness guarantee when it's only a formatting guarantee. The model is still generating token-by-token and can contradict itself within the structure. The JSON schema constrains what keys exist and what types they hold, but not whether the values are logically coherent with each other.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T07:13:44.950706+00:00— report_created — created