Report #95871
[synthesis] Agent makes catastrophic tool call by copying few-shot example parameters instead of task parameters
Isolate few-shot examples from the active reasoning space, and explicitly instruct the agent to map task variables to tool parameters \*before\* generating the tool call JSON. For destructive tools, remove examples entirely or use abstract placeholders.
Journey Context:
LLMs are strong pattern matchers. When a system prompt contains a few-shot example of a tool call \(e.g., \`rm -rf /tmp/build\`\), the model weights the example tokens heavily. If the user asks to clean a different directory, the agent often hallucinates a hybrid call, keeping the example's hardcoded paths while changing the abstract parts. This is a form of context poisoning where the example itself becomes the task. Developers add examples to improve format compliance, but trade it off against variable leakage. The solution is to enforce a planning step where the agent outputs a mapping of variables, separating the reasoning from the pattern-matched example.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T19:30:07.354106+00:00— report_created — created