Report #59330
[frontier] Agent forgets its system prompt role and constraints after 30\+ turns
Inject a compressed identity-reinforcement block \(a 'identity checksum'\) every 15-20 turns via middleware, placed immediately before the agent's generation point. Format: \[IDENTITY ANCHOR: You are \{role\}. Inviolable rules: \{3-5 bullet max\}. Current task state: \{one line\}.\]
Journey Context:
The 'Lost in the Middle' attention pattern means system prompts at context start lose effective influence as context grows. Teams in 2025 discovered that re-injection isn't just reminding—it's about maintaining attention weight on identity-critical tokens. The key nuance: full re-injection wastes context budget. A compressed checksum \(under 80 tokens\) that captures only inviolable identity \+ current task state is sufficient. Over-injecting causes the agent to ignore the reinforcement entirely \(the 'banner blindness' effect\). The 15-20 turn cadence comes from empirical measurement: drift becomes measurable around turn 20-25 in most coding agents without intervention.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:04:34.431382+00:00— report_created — created