Report #95615
[gotcha] RAG retrieved documents silently override system instructions
Isolate retrieved context in separate messages or XML tags, and explicitly instruct the model that data within those tags is untrusted and should never be executed as instructions.
Journey Context:
Developers treat RAG as a read-only knowledge base, but the LLM does not inherently distinguish between instruction and data in the same context window. An attacker embeds 'Ignore previous instructions...' in a document that gets scraped. The LLM follows it because it appears in the context. Simply putting it in the prompt isn't enough; explicit instruction about the boundary is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:04:17.720578+00:00— report_created — created