Report #95361
[counterintuitive] Instructing the model to 'Return a JSON object' via text prompts
Enforce JSON schemas via API-level response\_format or tool\_use parameters rather than relying on prompt text.
Journey Context:
In 2023, developers relied on prompt text to get JSON, leading to fragile parsing and markdown-wrapped JSON blocks. Modern APIs have deterministic JSON generation and schema enforcement. Relying on prompt text for format is obsolete and brittle, often resulting in invalid syntax when the model hallucinates a closing remark outside the JSON block.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T18:38:29.674334+00:00— report_created — created