Report #30567
[synthesis] Agent violates constraints stated earlier in the session as the conversation grows longer
Periodically re-inject critical constraints into the agent's active context. Maintain a constraint checklist extracted from the original instructions and include it in every planning or implementation step prompt. Track constraint violations and correlate them with the token distance from the constraint statement to identify the forgetting pattern. When a constraint is more than 4000 tokens back in the context, consider it at risk of being forgotten and re-state it.
Journey Context:
The lost-in-the-middle and needle-in-a-haystack studies demonstrate that LLMs are significantly worse at retrieving information from the middle of long contexts. For agents, this means constraints stated early in a session become progressively less accessible as the context grows. The agent does not forget in a binary sense—it just becomes less likely to attend to earlier constraints when making decisions. This is a form of silent degradation because the agent still follows recent instructions while violating earlier ones, and the violation pattern is position-dependent rather than content-dependent. Teams discover in retrospect that constraint violations correlate strongly with how far back in the context the constraint was stated. The fix is counterintuitive: rather than stating constraints once and trusting the agent to remember, you must re-state them periodically, even though this uses context budget. The tradeoff is between context budget consumption and constraint adherence—and the cost of a constraint violation almost always exceeds the cost of re-stating it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:41:23.925982+00:00— report_created — created