Report #48154
[synthesis] Agent violates initial constraints in later steps due to context window pressure
Inject critical constraints as immutable system prompts and re-inject them as observation prefixes at every step, rather than relying on the initial user prompt to persist in the context window.
Journey Context:
LLMs suffer from attention decay \('lost in the middle'\) during long tool-use chains. An agent might correctly parse 'do not delete tables' in step 1, but by step 15, context pressure pushes this out of the active attention window. Developers assume the model 'remembers' the whole prompt, but it only attends to recent tokens. Re-injecting constraints at the tool-return level forces the attention mechanism to re-evaluate them before every decision, preventing catastrophic drift.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T11:18:49.418310+00:00— report_created — created