LyraLearn AI Learning Platform
Exams
← Module 7 Β· Tool Calling
🎧 Listen

Safety in Tool Calling

The moment a model can trigger actions, it can trigger harmful actions β€” by mistake, or because an attacker steered it there through prompt injection. Tool calling is where an LLM application's blast radius lives. As an architect, you treat the model's tool requests the way you'd treat any request arriving from outside your trust boundary: never trusted, always checked.

Tiered safety policy diagram where tool requests pass validation and are routed to automatic execution, explicit confirmation, or human approval depending on risk.

Treat every tool request as untrusted input

The JSON arguments the model produces are not vetted just because the model produced them. The model may have been manipulated by injected text in a document it read, or it may simply be wrong. So:

Allow-list, and never auto-execute the irreversible

Two rules that keep you out of the headlines:

  1. Allow-list tools per context. A given conversation gets only the tools it needs. The Tutor gets none; an admin assistant gets a curated few. There is no "all tools available by default."
  2. Never let the model auto-execute destructive or irreversible actions. Deleting records, moving money, sending external communications, deploying to production β€” these require a human approval step between the model's request and the actual execution. The model can propose "refund $400"; a person clicks confirm.

The pattern is a tiered policy:

Defense in depth

No single control is enough; layer them. Log every tool call β€” inputs, outputs, who approved what β€” for audit and incident response. Rate-limit tools to cap damage from a runaway loop. Fail closed: on a validation error or low confidence, refuse rather than guess. And keep the set of action-capable tools as small as the task allows β€” the safest tool is the one you didn't expose.

LyraLearn applies exactly this split: ingestion and admin tools run under staff permissions with approval gates and full audit logs, while the student Tutor β€” the surface most exposed to untrusted input β€” is given no tools at all. Lesson 4 explains why that last choice is a feature, not a limitation.

🧠 Quiz yourself on this lesson →

Ask the AI Tutor

Grounded in the course lessons β€” it cites its sources and says when it doesn't know.