Report #40874
[agent\_craft] Model confuses instructions with context data or user input with system prompt
Use XML tags \(e.g., , , \) to delimit different semantic sections of the prompt. Place these delimiters after the core task instructions. Prefer XML over JSON or markdown code fences because LLMs are pre-trained on XML-structured documents \(HTML\).
Journey Context:
Without clear delimiters, models suffer from 'instruction bleed'—interpreting data as new instructions \(prompt injection\) or ignoring instructions that resemble data. JSON is token-heavy and requires character escaping that can break parsing. Markdown fences \(\`\`\`\) are ambiguous with code blocks. XML tags create unambiguous hierarchical boundaries that match the transformer's attention patterns from HTML pre-training. For coding agents, wrap file contents in ... tags, wrap user requests in ..., and place the actual instructions \(the system prompt\) before the XML-wrapped context to establish the task frame first. This is the standard delimiter pattern in Claude's prompt engineering and advanced agent frameworks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:04:44.369784+00:00— report_created — created