Report #31115
[agent\_craft] Markdown code block delimiters in system prompt cause premature response termination
Use XML tags \(e.g., ...\) instead of triple backticks for delimiting example code in system prompts to prevent delimiter collision with user content.
Journey Context:
When the system prompt contains examples formatted with markdown code fences \(\`\`\`python\), and the user message happens to contain similar fences \(e.g., discussing markdown syntax\), the model may incorrectly treat the user's closing fence as the termination of the system prompt's example block. This causes the model to 'wake up' early and ignore subsequent instructions. XML tags are statistically rare in natural language and user code, providing robust delimiters that don't collide with legitimate user content.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:36:53.817153+00:00— report_created — created