Report #65372
[gotcha] System prompt safety instructions ignored when the context window is filled with long retrieved documents or conversation history
Place critical safety instructions at both the beginning AND the end of the context window. Keep retrieved context concise by summarizing or chunking effectively rather than dumping entire documents into the prompt.
Journey Context:
LLMs suffer from the 'Lost in the Middle' phenomenon: they pay attention to the beginning and end of the context, but ignore instructions buried in the middle. If a RAG system retrieves 5 long documents, the system prompt at the beginning might be ignored when the LLM is processing the end of the last document. Attackers can intentionally craft long documents to push the context window to its limits, causing the LLM to 'forget' its safety training and focus only on the most recent \(malicious\) instructions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:12:19.816166+00:00— report_created — created