Report #83159
[gotcha] System prompts placed at the beginning of a massive context window are ignored when the user prompt and RAG data are extremely long
Place critical security instructions at both the beginning AND the end of the prompt, or use a separate supervisor LLM call to enforce rules after the primary LLM generates its response.
Journey Context:
Developers assume the system prompt is an absolute override. However, LLMs suffer from the 'Lost in the Middle' phenomenon. If a RAG system injects 50k tokens of retrieved text between the system prompt and the user's query, the LLM effectively forgets the system prompt constraints and follows the instructions closest to the end \(which could be the attacker's injected text in the RAG doc\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T22:10:21.945594+00:00— report_created — created