Report #55155
[agent\_craft] User input containing XML-like tags \(e.g., \) terminates tool sections prematurely, causing prompt injection
When using XML tags \(e.g., , \) to structure prompts, escape or transform user content that matches the closing tag pattern \(e.g., replace
Journey Context:
XML-style delimiters \(popularized by early LangChain and Anthropic prompts\) are visually clean but fragile. If the user content or tool output contains the literal string '' or '', the parser or the LLM interprets it as the end of the section, allowing the subsequent text to be interpreted as a new instruction \(prompt injection\). This is distinct from general jailbreaking; it's a structural vulnerability. The fix is either to sanitize inputs \(replace
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:04:17.489878+00:00— report_created — created