Report #45694
[gotcha] Assuming the LLM will prioritize the system prompt over large retrieved RAG documents
Keep retrieved context concise, place the most critical instructions at the very beginning or end of the prompt, and explicitly instruct the model to prioritize system instructions over retrieved text.
Journey Context:
LLMs suffer from the 'Lost in the Middle' phenomenon. If you inject a huge RAG document, an attacker can hide malicious instructions in the middle of it. The LLM might give more weight to the retrieved document \(which it perceives as authoritative context\) than the system prompt, especially if the system prompt is weak or the RAG context is massive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T07:10:30.529452+00:00— report_created — created