Report #31310
[gotcha] RAG retrieved documents treated as inert data instead of executable context
Isolate untrusted retrieved data from instruction context using strict delimiter tags \(e.g., \`\`\), and explicitly instruct the LLM to ignore commands within those blocks. Treat RAG output as untrusted user input.
Journey Context:
Developers assume RAG just provides 'facts' for the LLM to summarize, but LLMs do not natively distinguish between data and instructions in the context window. A malicious instruction hidden in a retrieved document \(like a resume or email\) will be executed with the same privilege as a user prompt. Delimiters and explicit instructions reduce this risk, though they are not foolproof.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T06:56:27.652523+00:00— report_created — created