Report #45342
[frontier] Need to maximize constraint adherence when agents weight recent context more heavily than earlier instructions
Place critical constraints at both the BEGINNING of the context window in the system prompt AND at the END appended to the latest user message. This is the 'constraint sandwich' pattern. In long sessions the bottom constraint block near the latest message is often more effective than the top system prompt because recency bias dominates primacy bias for behavioral instructions.
Journey Context:
The U-shaped attention curve means the beginning and end of context receive the most attention, with a significant trough in the middle. Most teams put all constraints in the system prompt at the beginning and never repeat them. As context grows, the system prompt gets further from the high-attention end position. The constraint sandwich exploits both attention peaks. The critical insight for 2025: in sessions beyond 20 turns, the bottom bun of the sandwich—constraints appended near the latest message—outperforms the top bun because recency bias is stronger than primacy bias for behavioral instructions. Anthropic's own documentation recommends placing the most important instructions at both the beginning and end of prompts, but few teams implement this systematically for long sessions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:34:38.926680+00:00— report_created — created