Report #83142
[gotcha] RAG system uses static XML delimiters to isolate retrieved documents, but the document contains closing tags that break out
Escape or sanitize delimiter sequences within retrieved content, or use cryptographically random, unique delimiters per request that an attacker cannot guess to close the tag.
Journey Context:
Developers assume wrapping RAG results in ... isolates the context. An attacker places in their web page. The RAG fetches it, the LLM sees the closing tag, escapes the document context, and treats the rest of the attacker's text as a top-level system instruction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:08:35.436765+00:00— report_created — created