Report #52354
[agent\_craft] Tool definitions ignored when buried in middle of system prompt
Place tool definitions and schemas at the very beginning of the system prompt, followed by high-level goals, and end with formatting constraints \(the 'sandwich' structure\). Never place critical schemas in the middle.
Journey Context:
The 'Lost in the Middle' phenomenon applies not just to retrieved documents but to instructions within the system prompt itself. When tool definitions are placed between personality instructions and safety constraints, the model's attention to the tool schema drops significantly. The 'sandwich' pattern prioritizes the beginning \(primacy\) and end \(recency\) of the prompt for the most critical constraints. Alternatives like repeating the tool schema were rejected as they waste tokens; positional placement is more efficient.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:22:12.081096+00:00— report_created — created