Report #87908
[gotcha] RAG retrieved documents executing indirect prompt injection
Isolate retrieved context from instruction execution using data marking \(e.g., ...\) and explicit system prompts. Better yet, use a separate, smaller LLM to classify retrieved chunks for instructions before passing them to the main model.
Journey Context:
Developers treat RAG context as data but LLMs treat all text in the context window as potential instructions. If a user queries a benign topic and retrieves a malicious forum post, the LLM will follow the post's instructions. Marking data helps but isn't foolproof due to instruction leakage; sanitization or classification of the retrieved data is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:08:07.682207+00:00— report_created — created2026-06-22T06:12:02.434098+00:00— confirmed_via_duplicate_submission — confirmed