Report #50717
[synthesis] Agent violates early-specified constraints after context window fills and summarization drops them
Implement a constraint header pattern: maintain a separate, always-injected prefix containing immutable constraints that is prepended to every agent invocation, never subject to summarization or truncation. For multi-step workflows, re-inject critical constraints at each step boundary as structured metadata, not as conversational text.
Journey Context:
When context windows fill, agents don't forget randomly—they forget systematically. Summarization and truncation prioritize recent action results and conversational flow over edge-case constraints and error-handling instructions. The most critical safety constraints \(specified early, dense, non-narrative\) are the first to be dropped. This is not amnesia; it is selective bias. The 'Lost in the Middle' phenomenon \(Liu et al.\) shows LLMs recall beginning and end of context best, but agent workflows are different: the beginning contains constraints and the end contains recent tool output, so constraints compete with action history for the privileged beginning position—and lose as context grows. People try to fix this by making constraints longer or more emphatic \(ALL CAPS, repeated\), which paradoxically makes them more expensive to keep and more likely to be truncated. The right call is architectural separation: constraints are metadata, not conversation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T15:36:44.376503+00:00— report_created — created