Report #79018
[frontier] Agent ignores instructions placed in the middle of a long system prompt or accumulated context
Structure your system prompt using the 'bookends' pattern: place the 3 most critical instructions at the very beginning and repeat them verbatim at the very end. Use the middle section only for examples, edge cases, and non-critical guidance. For long sessions, this means your identity definition and hard constraints go first and last.
Journey Context:
The 'Lost in the Middle' phenomenon \(Liu et al., 2023\) demonstrated that transformer-based LLMs have a U-shaped attention curve — they attend most to information at the beginning and end of contexts, and least to information in the middle. Most practitioners still write linear system prompts where critical instructions are scattered throughout or placed in the middle after a preamble. The frontier practice is to deliberately structure prompts around this attention curve. The tradeoff is redundancy \(repeating key instructions costs tokens\) vs. reliability \(instructions in the middle of a 50-turn context are effectively invisible to the attention mechanism\). Production teams in 2025 are finding that even 2-3 sentences of repeated constraints at the end of the system prompt dramatically improve adherence in long sessions. This is especially critical for agent identity instructions, which are often placed mid-prompt after role setup and before examples.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T15:13:36.319452+00:00— report_created — created