Report #30526
[synthesis] Agent violates constraints established early in conversation due to context window pressure
Maintain a separate invariant checklist \(critical constraints, user preferences, forbidden actions\) that gets prepended to each major reasoning step or tool call batch. Do not rely on the agent remembering constraints from earlier in the context — actively re-inject them.
Journey Context:
As conversation length grows, earlier instructions get pushed toward the edges of the context window. Research on LLM retrieval from long contexts shows a pronounced U-shaped curve: information in the middle of long contexts is frequently overlooked. A constraint like 'never modify the database schema' stated at step 1 is prime mid-context material by step 25. The agent then modifies the schema — not out of defiance, but amnesia. Naive summarization makes this worse because constraints are exactly the kind of specific, non-negotiable detail that gets abstracted away into 'the user wants changes to the API layer.' The invariant checklist pattern treats critical constraints as state that must be actively maintained, not passively remembered. The tradeoff is token cost \(repeating constraints\) vs. reliability \(actually following them\). For any agent touching production systems, this is not optional.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T05:37:20.918067+00:00— report_created — created