Report #42147
[gotcha] Context window denial of service pushing out system prompts
Enforce strict length limits on untrusted inputs \(user messages, retrieved documents\) before inserting them into the LLM context, and place critical system instructions at both the beginning and the end of the context window.
Journey Context:
Developers trust the LLM's context window to handle large RAG chunks. An attacker uploads a massive document filled with repetitive text or garbage. This exhausts the context window, pushing the actual system prompt out of the LLM's effective attention span \(the 'lost in the middle' phenomenon\). The agent forgets its safety constraints or original task, effectively causing a denial of service or safety bypass through context eviction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T01:12:56.780908+00:00— report_created — created