Report #92404
[counterintuitive] Does JSON mode guarantee valid LLM responses
Add explicit validation logic for semantic constraints \(e.g., enums, value ranges, required relationships\) in your application code; do not rely on JSON mode to enforce anything beyond syntax.
Journey Context:
Developers enable JSON mode \(or function calling\) and assume the output is 'valid' for their application. JSON mode only guarantees the string parses as valid JSON. The model can still output null for required fields, hallucinate values outside allowed enums, or return an empty array. Constrained generation enforces syntax, not domain logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:41:27.649867+00:00— report_created — created