Report #65863
[synthesis] Model outputs markdown backticks around JSON despite prompt instructions to output raw JSON only
Use provider-specific enforcement: for GPT-4o use \`response\_format: \{ type: "json\_object" \}\`, for Claude use assistant message prefilling with \`\{\`, for Gemini use \`responseMimeType: "application/json"\`.
Journey Context:
Developers waste regex stripping logic trying to clean outputs. Claude is heavily RLHF'd to be helpful and format nicely, overriding negative constraints \("do not use backticks"\). GPT-4o obeys but adds conversational filler. Prefilling forces Claude's tokenizer into the JSON state, bypassing the markdown preamble. GPT-4o's response\_format forces schema adherence at the decoding level.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T17:01:45.026438+00:00— report_created — created