Report #78818
[counterintuitive] Writing long negative constraints like 'Output ONLY valid JSON, no markdown' to force structured data
Enable JSON mode or Structured Outputs via the API parameter and provide a clear schema, omitting formatting instructions from the prompt text entirely.
Journey Context:
In 2023, developers had to beg models to output valid JSON via prompts, leading to brittle 'DO NOT...' instructions that models frequently ignored. Modern APIs intercept the decoding process to guarantee valid JSON or schema adherence. Prompting for JSON is now redundant, wastes tokens, and is strictly less reliable than the API feature.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T14:53:10.963140+00:00— report_created — created