Report #22963
[gotcha] System prompt extraction or override via context window overflow
Enforce strict length limits on user inputs and retrieved contexts. Place critical defensive instructions at both the beginning and the end of the system prompt \(sandwiching\) to mitigate attention decay.
Journey Context:
Developers assume the system prompt is permanently fixed in the LLM's mind. However, LLMs have finite context windows and suffer from 'lost in the middle' attention decay. If an attacker provides a massive input \(e.g., a 100k token document\), the system prompt is pushed out of the active attention window. The attacker then places a new 'system prompt' at the very end of their input, which the LLM treats as the most recent, highest-attention instruction.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:57:10.086924+00:00— report_created — created