bigonotes
AITool Calling

Who Runs It

The model only asks for a tool call. Your code decides whether to act and runs it, which makes your code the safety boundary.

2 min readLast updated

The model never runs anything itself. It only produces text that describes what it wants to run. Your code reads that request, decides whether to act on it, and executes the function. This is the most important idea in tool calling.

The model can only ask#

The model has no direct access to your database, your filesystem, your APIs or anything else. All it can do is ask. Your code is what actually touches those systems.

The model sits on one side and can only send requests; your code sits on the boundary, checks each request, and is the only thing that reaches the database, files, APIs and email

Your code is the safety boundary#

Because only your code acts, your code is the safety boundary, not the model.

  • If the model asks to delete a file, your code decides whether that is allowed.
  • If the model asks to send an email to 10,000 people, your code is what would send it.

A request from the model is a suggestion, not a command. The model asking for something does not mean it should happen.

Never let a model's request run automatically without your code checking it first. Check the arguments, check that the user is allowed to do it, and ask the user before anything irreversible.

The next three notes cover those checks: validation, limits and risky actions.

Short line#

The model never executes a tool. It produces a request, and your code decides whether to run it. That makes your code, not the model, the safety boundary, so no request should run without a check.

Key takeaways#

  • The model only produces text that describes the call it wants.
  • It has no direct access to databases, files or APIs. Your code does.
  • Your code decides whether a request is allowed and runs it.
  • Your code is the safety boundary, not the model.
  • Never let a model's request execute automatically without a check.
Revision notes · 1 min

Core idea#

The model never runs anything. It only produces text that describes the call it wants. Your code decides whether to run it.

Key points#

  • The model has no direct access to databases, files or APIs.
  • Your code reads the request, decides, and executes.
  • Your code is the safety boundary, not the model.
  • A model request is a suggestion, not a command.

Examples#

Model asks to Who decides and acts
Delete a file Your code
Email 10,000 people Your code

Pitfalls#

  • Do not let a model request execute automatically without a check.

Short line#

The model only asks. Your code runs the tool, so your code is the safety boundary.

Found a mistake? Email ask@bigonotes.com