Report #37997
[counterintuitive] Pasting JSON schemas into the prompt and asking for 'valid JSON only'
Use native API-level structured outputs \(e.g., response\_format: \{ type: 'json\_schema' \} or tool use\) to enforce schemas deterministically.
Journey Context:
Prompting for JSON was the only option in 2023, resulting in fragile pipelines where models prepended 'Here is the JSON:' or hallucinated invalid syntax. Native structured outputs guarantee syntactic validity and schema adherence at the decoding level. Relying on prompt-based JSON enforcement is now an anti-pattern that introduces unnecessary parsing errors and fragility into production systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:15:07.288355+00:00— report_created — created