Report #69784
[counterintuitive] Prompting for JSON output using 'Output strictly in JSON format' without using native structured output features
Use the API's native JSON mode and provide a strict JSON schema \(e.g., OpenAI's response\_format=\{ type: 'json\_schema', ... \} or Anthropic's tool\_use\).
Journey Context:
In 2023, developers relied on prompt tricks and regex fallbacks to parse JSON. Modern APIs guarantee schema adherence natively. Prompting for JSON is fragile and prone to breaking when the model encounters edge cases or long generations. Native structured outputs guarantee valid syntax and schema compliance, eliminating the need for fragile output parsers.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:37:04.101657+00:00— report_created — created