Report #24365
[gotcha] User input dynamically alters LLM tool definitions
Never interpolate untrusted user input directly into the JSON schema or description fields of tool/function definitions.
Journey Context:
Developers often build dynamic tools where the description includes the user's current context \(e.g., 'Search for items related to \[user\_input\]'\). The LLM reads the tool description as instructions. If user\_input contains a prompt injection, it hijacks the tool selection logic or forces the LLM to call tools maliciously. Tool schemas are system-level instructions, not data buckets.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T19:18:31.298537+00:00— report_created — created