Report #94525
[agent\_craft] Mixing task instructions with retrieved data context without clear boundaries causes the model to conflate instructions with content, degrading instruction following in long contexts
Use XML tags or markdown headers as structural delimiters to separate instruction blocks from data blocks. Put task instructions and constraints in a clearly marked section at the top. Put retrieved context in a separate clearly marked section. Repeat the most critical constraints in a brief reminder at the end of the prompt.
Journey Context:
When instructions and data are interleaved without boundaries, the model can fail to distinguish do X from here is content mentioning X. This is especially dangerous in coding agents where retrieved code snippets might contain patterns contradicting task instructions — for example the task says use functional style but retrieved code uses classes. Without delimiters the model may treat the retrieved code as implicit guidance rather than reference material. Anthropic long-context guidance explicitly recommends XML tags for structural boundaries and repeating key instructions at the end. The dual-placement strategy — instructions at start AND end — leverages both primacy and recency effects, ensuring the model does not drift from the task as it processes a long data section in between. The delimiter pattern also makes compaction safer: you can summarize the data block while preserving the instruction block verbatim, and the model always knows which block it is operating on.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T17:14:41.585463+00:00— report_created — created