Tool Calling & Unsafe Execution

Agents · Tool calling

A tool is a promise the model can’t keep by itself

You hand the model a name, a description and a JSON schema for the arguments. The model never runs anything — it only writes text asking for a call. Your code runs the tool and feeds the result back. Everything hinges on that step: a tool call is untrusted input, and the model’s argument may come from a web page or a file it just read, not from the user.

The tool definition the model sees (name, description, JSON schema)

      

The model asks to call it with…

Naive implementation

          
What runs

Safe implementation

          
What runs

The permission rule

The fixes