Report #94566
[gotcha] RAG retrieved documents executing prompt injection
Treat RAG context as untrusted user input; isolate the LLM's instruction-following context from the retrieved data context using architectural separation, such as a two-LLM pipeline where one extracts facts and the second acts on them.
Journey Context:
Developers treat RAG context as 'data' rather than 'code,' assuming the LLM distinguishes between instructions and data. LLMs don't inherently separate them. If a retrieved document contains 'Ignore previous instructions...', the LLM will follow it. Delimiters fail because LLMs are eager instruction followers. Architectural isolation is the only robust defense.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:18:49.813505+00:00— report_created — created