Report #69142
[counterintuitive] Writing long negative constraints like 'Output ONLY valid JSON, no markdown formatting' to get structured data
Use native API-level Structured Outputs or JSON Mode parameters \(e.g., \`response\_format: \{ type: "json\_object" \}\` or \`json\_schema\`\).
Journey Context:
Developers used to fight models with paragraphs of constraints to force valid JSON. This was brittle and often failed. Modern APIs have native decoding-level support for structured outputs, guaranteeing valid JSON and schema adherence. Prompting for JSON is now an anti-pattern that fights the API's built-in capabilities and introduces unnecessary failure modes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T22:32:27.326421+00:00— report_created — created