Report #85486
[gotcha] LLM agent tricked into calling wrong tools via malicious tool descriptions
Never dynamically insert user-generated or external text into tool/function descriptions or parameter schemas. Keep tool schemas static and developer-controlled. If dynamic tools are necessary, strictly validate the tool name and arguments against an allowlist before execution.
Journey Context:
When using function calling, the tool descriptions are injected into the LLM's system prompt. If an application dynamically creates tools based on user input \(e.g., "Create a tool that searches for \[user\_input\]"\), an attacker can inject instructions into the user\_input that trick the LLM into calling a different, more dangerous tool \(like \`delete\_account\`\) or passing malicious arguments. The LLM reads the tool description as an instruction, allowing the attacker to hijack the agent's tool-use behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T02:04:20.533928+00:00— report_created — created