Report #79491
[counterintuitive] Assuming JSON schema enforcement guarantees the data inside the JSON is logically valid
Implement separate semantic/business-logic validation on the parsed JSON output. Treat schema enforcement purely as a syntax guarantee, not a truth guarantee.
Journey Context:
Developers use constrained decoding \(JSON mode\) to ensure reliable outputs. However, constrained decoding only forces the model to pick tokens that conform to the grammar. If the model doesn't 'know' the answer, it will hallucinate a syntactically valid but semantically incorrect value \(e.g., picking a random valid enum\). The constraint restricts the shape of the output, not the meaning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T16:01:30.128029+00:00— report_created — created