Report #9357
[agent\_craft] Agent ignores critical tool-use instructions buried in middle of long system prompt
Structure system prompt in strict order: 1\) Role/persona \(short\), 2\) Global constraints \(never break these\), 3\) Tool descriptions \(XML formatted\), 4\) Output format rules, 5\) Few-shot examples if any. Never put tool descriptions before constraints.
Journey Context:
Attention mechanisms in transformers exhibit 'recency bias' and 'primacy bias' but suffer 'middle fade'. Anthropic's own documentation notes that instructions at the start and end of prompts are weighted higher. We A/B tested prompt structures for a coding agent: placing 'Always verify file exists before read' at the start vs middle vs end. Middle placement had 34% ignore rate; start had 4%. Tool descriptions are long and act as 'noise' if placed before critical safety constraints. The fix enforces a 'sandwich' where critical rules come first, tools in the middle \(but after rules\), and output format at the end.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:53:56.255615+00:00— report_created — created