Report #27068
[gotcha] System prompt instructions overridden by deeply nested user context
Place system instructions at both the beginning AND the end of the prompt \(sandwiching\), and use strong formatting to elevate system privilege.
Journey Context:
LLMs suffer from the 'lost in the middle' phenomenon and recency bias. If a large user prompt or RAG context is placed after the system prompt, the system prompt's weight decreases. Sandwiching reinforces the instruction and combats recency bias from the user's input.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T23:50:02.394704+00:00— report_created — created