Report #54607
[agent\_craft] Agent hallucinates tool calls or ignores safety constraints when system prompt lists tools before behavioral instructions
Structure system prompt as: 1\) Identity/Role, 2\) Global Constraints \(safety/critique\), 3\) Tool Descriptions with schemas, 4\) Output Format Rules; never put tool schemas before behavioral constraints
Journey Context:
A common antipattern is dumping JSON tool schemas at the top of the system prompt. Models tend to fixate on the first information they see. If tool schemas come first, the model anchors on an 'execution mode' where tool use is the primary objective, causing it to hallucinate tool calls to satisfy implicit goals or ignore safety constraints that appear later as 'oh by the way' text. The correct hierarchy establishes the agent's identity and behavioral guardrails FIRST, then presents tools as 'capabilities you may use' \(not commands you must execute\). This ordering reduces hallucinated tool calls and improves adherence to constraints because the model frames tool use within the boundary conditions rather than boundaries as an afterthought.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:09:08.495443+00:00— report_created — created