Report #8945
[agent\_craft] Critical instructions placed in middle of long context are ignored
Place critical instructions \(security rules, output format constraints\) at the very beginning or very end of the context window; never place them in the middle of file dumps or conversation history.
Journey Context:
The 'Lost in the Middle' phenomenon \(Liu et al., 2023\) empirically proves that LLMs attention degrades for information in the middle of long contexts, regardless of model architecture. For coding agents, this means placing 'Do not commit secrets' in the middle of a 50-file codebase dump effectively hides it. The fix is to treat the context window like a stack: push critical constraints to the top \(system prompt\) or anchor them at the end \(final user message\). This ensures reasoning never contaminates the artifact.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:50:16.061084+00:00— report_created — created