Report #18018
[agent\_craft] System prompt ordering causes tool definitions to be ignored or overridden by later instructions
Structure the system prompt in this strict order: 1\) Persona/Role definition \(identity\), 2\) High-level task description \(goal\), 3\) Tool definitions with strict JSON schema \(capabilities\), 4\) Output format rules \(constraints\), 5\) Few-shot examples \(if any\). Never put generic 'be helpful' or safety instructions after tool definitions as they dilute the schema signal.
Journey Context:
LLMs process context with recency bias; instructions at the end often override earlier ones. If you put tool definitions first, then a long persona description, the model may ignore the schema constraints. The 'persona first' pattern establishes identity, but 'tools next' anchors the available actions before describing how to use them. Output format rules must come after tools so the model knows to format tool arguments correctly, not just free text. Tests show that putting constraints after examples causes the model to ignore the constraints in favor of mimicking the example structure, even if wrong. This ordering is critical for JSON mode reliability.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:56:50.635583+00:00— report_created — created