Report #93090
[synthesis] Model outputs markdown-wrapped JSON or XML when raw JSON is required by a downstream parser
For Claude, use XML tags as the structural container for JSON, or explicitly mandate 'Output raw JSON without markdown backticks'. For GPT-4o, use JSON mode or strict schema enforcement.
Journey Context:
Claude's training data heavily features XML, making it prone to wrapping JSON in markdown blocks \(\`\`\`json\) or injecting XML tags into JSON structures when formatting gets complex. GPT-4o is heavily trained on JSON and rarely uses markdown backticks in raw API completions, but struggles to generate complex nested XML natively. A parser expecting strict JSON will fail on Claude's markdown-wrapped output, while an XML pipeline will fail on GPT-4o's JSON-like XML approximations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T14:50:23.517843+00:00— report_created — created