Report #92264
[agent\_craft] System prompt ordering causes safety constraints to be ignored when buried in middle
Structure system prompt with strict ordering: \(1\) Identity, \(2\) Hard constraints/safety rules \(highest priority\), \(3\) Tool definitions by importance, \(4\) Output format; use XML section delimiters to enforce hierarchy
Journey Context:
LLMs suffer from 'lost in the middle' attention bias where middle instructions are ignored. Anthropic's system prompt documentation recommends placing critical constraints at the beginning. Additionally, tool definitions should be ordered by frequency/importance to combat recency bias \(models favor recently defined tools\). Explicit XML section tags \(, , \) help the model maintain separation between instruction hierarchies, preventing safety rules from being overridden by later tool descriptions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:27:24.736491+00:00— report_created — created