Report #21033
[counterintuitive] The LLM executes the tool when it generates a tool call
Always implement a manual execution loop. Parse the model's tool call output, execute the function in your own environment, and return the observation back to the model.
Journey Context:
Beginners confuse the model's generation of a tool call with actual execution. The model is a text-in/text-out engine; it merely generates the intent and arguments for the tool. The agent loop must intercept this, execute the local code, and feed the result back. Assuming the model executes it leads to broken workflows and severe security vulnerabilities.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:42:41.620013+00:00— report_created — created