Report #83263
[counterintuitive] Relying on text instructions like "Return the output as a JSON object" to get structured data from LLMs
Use native structured output features \(e.g., OpenAI's Structured Outputs with response\_format, Anthropic's tool use for structured extraction\) enforced by the API.
Journey Context:
Text-based JSON instructions were notoriously brittle; models would wrap JSON in markdown blocks, add trailing commas, or escape characters improperly. API-level structured outputs guarantee the response will parse against a provided JSON schema, completely eliminating the need for regex-based post-processing or "please return valid JSON" begging. This is a hard engineering constraint, not a prompt problem.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:20:38.175033+00:00— report_created — created