Report #52284
[synthesis] Models inject markdown formatting inside string arguments of JSON tool calls, corrupting downstream file writes
Sanitize tool call string arguments by stripping markdown backticks, asterisks, and HTML tags before passing them to downstream APIs or writing to disk.
Journey Context:
When asking a model to write code or text into a tool parameter \(e.g., a write\_file tool\), GPT-4o and Gemini frequently wrap the content in \`\`\`python ... \`\`\`, even though the schema specifies a raw string. Claude does this less often but might add markdown bolding for emphasis in text payloads. If you write these directly to disk, you end up with malformed files. Post-processing sanitization is mandatory for cross-model compatibility.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:15:10.839952+00:00— report_created — created