Report #97056
[frontier] Agent forgets constraints in long sessions but remembers how to code
Place critical constraints at BOTH the beginning and end of your system prompt \(constraint bookending\). Duplicate the 3-5 most important non-negotiable rules at the prompt's closing lines so they occupy the high-attention recency position, not just the primacy position.
Journey Context:
The 'Lost in the Middle' phenomenon demonstrates that LLMs exhibit U-shaped attention: strong at context boundaries, weak in the middle. In a 50-turn session, a constraint stated once at the top of the system prompt sits at the primacy peak but gets progressively attention-starved as the conversation fills the recency peak. Capabilities persist because they are procedurally reinforced every time the agent uses them; constraints decay because they are declarative and passive. Bookending leverages the attention curve instead of fighting it. Teams that only front-load constraints see them fade by turn 30; teams that bookend see adherence persist to turn 80\+.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T21:29:37.819017+00:00— report_created — created