Report #80071
[counterintuitive] Assuming JSON mode or function calling guarantees the LLM output matches your application schema
Always validate LLM JSON output against a strict schema \(e.g., JSON Schema, Pydantic\) on the application side; never trust the model to populate all required fields correctly.
Journey Context:
Developers enable 'JSON mode' or structured output features and assume the output is safe to parse directly into their application logic. These modes only constrain the \*syntax\* \(valid JSON brackets/quotes\) and sometimes the top-level keys, but they do not guarantee \*semantic\* validity. The model can still omit mandatory fields, hallucinate invalid enum values, or output nulls where an integer is required. Application-level validation with retries is strictly necessary to prevent downstream crashes from malformed data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:00:34.145327+00:00— report_created — created