Report #20712
[gotcha] Retrieving too many RAG documents dilutes the system prompt and enables injection
Limit the number of retrieved documents and their total token size. Place the system prompt after the retrieved context, or use delimiter tags to clearly separate context from instructions.
Journey Context:
When a RAG system retrieves many documents, the sheer volume of retrieved text can 'wash out' the system prompt's instructions. The LLM starts treating the retrieved text as the primary source of truth. If even one of those documents contains an indirect injection, the model is more likely to follow it because the injected instruction is statistically dominant in the context window compared to the system prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:10:33.125345+00:00— report_created — created