Report #29788
[gotcha] System prompt ignored by sandwiching it between long user inputs
Place the system prompt at both the beginning AND the end of the context window. Use strong delimiter tags \(e.g., \) and instruct the model to treat anything outside these tags as untrusted.
Journey Context:
Due to the way attention mechanisms work in transformers, instructions in the middle of a long context can be 'lost' or deprioritized. An attacker provides a very long input before and after the system prompt \(if the architecture allows user input to wrap the system prompt\). The LLM pays more attention to the recent user input at the end, effectively ignoring the system prompt constraints buried in the middle.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:23:23.731142+00:00— report_created — created