A tool-using AI agent is a language model that works in a loop: it picks a tool, calls it, reads the result and decides the next step until the goal is met. Moving from answering to acting changes the risk. A wrong sentence can be ignored, but a wrong action has to be undone, and some actions cannot be.
- A chatbot returns text. An agent runs a loop of decide, act and observe, choosing its own next step.
- Read tools and write tools carry different risks: reading changes nothing, writing leaves a trace.
- Set the approval line by reversibility, not importance. Payments, deletions and outgoing messages should wait for a person.
- OWASP traces damaging agent actions to three root causes: excessive functionality, excessive permissions and excessive autonomy.
- Cap the loop with step limits, spend limits and a stop control, and log every action.
- An agent earns trust by where it stops, not by how much it can do.
What is a tool-using AI agent?
An AI agent is a system that is given a goal, breaks it into steps, and at each step decides whether to use a tool, which one and with what inputs. It then reads the result and chooses what to do next. Anthropic's widely cited guide draws the line clearly: workflows are "systems where LLMs and tools are orchestrated through predefined code paths", while in agents the models "dynamically direct their own processes and tool usage" (Building effective agents).
A tool is any capability the model can trigger outside its own text: searching the web, reading a calendar, querying a database, sending an email, creating an invoice. The model does not run the tool itself. It produces a structured request, the surrounding application executes it, and the result is fed back into the model's context.
A concrete example: ask an assistant to "move my Thursday dentist appointment to next week and let the clinic know". A chatbot drafts a polite message for you to send. An agent checks your calendar, looks for free slots, calls the clinic's booking system, moves the appointment and sends the confirmation. Same request, very different consequences if something goes wrong.
How an agent differs from a chatbot
The difference lies in the loop. A chat model receives input and returns text, and the reader decides what to do with it. An agent receives input, acts, observes what happened and continues, so its output lands in systems rather than in front of a reader.
| Dimension | Answering model | Acting agent |
|---|---|---|
| Where the output lands | In text a person reads | In systems: records, messages, payments |
| Who chooses the next step | The person reading | The model, at runtime |
| Cost of an error | Reread and correct | Undo, compensate or apologise |
| How errors spread | They stop at the reader | They can chain across steps |
| What needs governing | Accuracy of content | Permissions, approvals and limits |
The capability that expands what an agent can do also expands what it can get wrong. Anthropic's guide states the trade-off plainly: "The autonomous nature of agents means higher costs, and the potential for compounding errors." So the useful question for any task is how much of it should be left to an agent's judgement. Often a fixed workflow is the safer and cheaper answer.
A rule of thumb helps. If you can write the steps down in advance, such as "when a form is submitted, save it, then email the owner", build a workflow: it is cheaper, faster and easier to test. Reach for an agent when the steps genuinely depend on what it finds along the way, such as comparing suppliers or untangling a messy support case, and accept that you will need the limits described below.
How an agent decides when to call a tool
An agent calls a tool when it judges that it cannot complete the next step with what it already knows. That judgement comes from the model's reading of the situation, not from a fixed rule, which makes it flexible and brittle at the same time.
The main input to that judgement is the tool's description. In the Model Context Protocol, an open standard for connecting models to tools, each tool is published with a name, a human-readable description and a JSON schema for its inputs (MCP tools specification). Vague descriptions produce vague behaviour. A tool described as "manages orders" will be called at the wrong moments, while "cancels one unpaid order by ID; cannot be undone" tells the model both what it does and what it costs. Writing those descriptions well is a form of context engineering.
Calling errors come in three kinds:
- Premature calls
- The agent reaches for a tool when it already had what it needed, which costs time and money and touches a live system for no reason.
- Missing calls
- The agent assumes it knows something, such as a price, a date or a stock level, and answers from its own guess instead of checking. It is wrong with confidence.
- Wrong-tool calls
- Two tools overlap and the agent picks the more powerful one, for example a bulk update where a single-record edit would do.
Good systems reduce all three with fewer, sharper tools rather than many overlapping ones.
Why reversibility sets the approval line
How freely an action can be allowed depends mainly on whether it can be undone. A reversible action can be corrected if it goes wrong. An irreversible one has to be compensated, and compensation is not always possible: a sent email stays sent, a record deleted without a backup stays deleted, and a payment taken from the wrong customer becomes a refund, a support ticket and a loss of trust.
A practical classification has four levels:
| Action class | Examples | Default policy |
|---|---|---|
| Read | Search, look up a record, check availability | Allow freely and log it |
| Reversible write | Create a draft, add a tag, move a record to a holding status | Allow, and make undo easy |
| Irreversible write | Delete data, cancel an order, change permissions | Require approval or a delay window |
| External effect | Send a message, take a payment, publish a post | Require human approval |
This matches published security guidance. OWASP's 2025 list of risks for LLM applications advises: "Utilise human-in-the-loop control to require a human to approve high-impact actions before they are taken" (OWASP LLM06:2025 Excessive Agency). The MCP specification makes the same point for tool calls in general: there should always be a human in the loop with the ability to deny tool invocations.
The line moves with context. Sending a message to yourself is harmless; sending the same message to every customer is not. Good systems classify the action as it will actually run, with its real recipients and amounts, rather than by the tool's name.
The three ways agents get too much power
OWASP calls the vulnerability Excessive Agency and traces it to three root causes. Each has a plain fix.
- Excessive functionality. The agent has tools it does not need, such as a general shell command when it only needs to read files. Fix: give each agent the smallest set of narrow tools that does the job.
- Excessive permissions. The tools run with more access than the task requires, such as a database login that can delete when the agent only reads. Fix: scoped credentials per agent, read-only wherever possible.
- Excessive autonomy. High-impact actions run without a check. Fix: the approval gates above, plus limits on steps and spend.
Prompt injection makes these risks sharper. An agent that reads web pages, emails or documents is also reading text written by strangers, and some of that text may contain instructions. With narrow tools and scoped permissions, an injected instruction has little to work with. With broad ones, it can act. Code-writing agents face a related risk when they install packages that do not exist, or that an attacker registered under a plausible name, the problem described in phantom packages.
How to build a responsible action loop
Safety works when it is designed in from the start rather than added as a warning dialog at the end. This order works for a personal automation as well as for a product feature.
- List the tools and classify each action. Mark every action as read, reversible write, irreversible write or external effect.
- Describe each tool precisely. State what it does, what it cannot do and what it costs, including whether it can be undone.
- Grant the least access that works. Use separate credentials per agent and per tool, read-only by default.
- Gate the irreversible. Put a human approval step before payments, deletions, permission changes and outgoing messages.
- Cap the loop. Set a maximum number of steps and a spending limit. Anthropic's guide recommends stopping conditions "such as a maximum number of iterations".
- Log every step. Record each tool call with its inputs and result, so you can trace a mistake back to where it started.
- Test in a sandbox first. Run realistic tasks against test data and test accounts before the agent touches anything live.
- Widen limits from evidence. Loosen a gate only when the logs show the agent handles that action reliably.
Most of this is ordinary engineering discipline applied to a new kind of actor. Checking whether an agent's output is good enough is a skill of its own, covered in evaluating what is generated.
How to tell whether an agent is trustworthy
For an answering system, trust meant correct answers. For an acting system, trust means predictable behaviour, and above all predictable stopping. A model that answers well can still break trust by calling the wrong tool at the wrong time.
Three properties are worth checking. An agent is auditable if it can show what it did, step by step. It is accountable if each action can be traced to a request and a permission. And it is cautious if it halts and asks when it is unsure, rather than guessing and carrying on.
Trust is also judged by worst behaviour, not by averages. An agent that works a hundred times and crosses a boundary once has a problem the average hides, because one irreversible mistake can outweigh many saved hours. When agents are combined into teams, these properties have to hold across every hand-off too, a challenge explored in multi-agent orchestration.
See these guardrails in a working agent: WisyLink
WisyLink is a tool-using agent you can try without writing code. In a chat, you say what site, web app or browser game you want. Wisy, the assistant, asks a short question when it needs to, then a build agent writes the app and deploys it to its own address. The patterns above are part of how it works:
- Least privilege. The build agent works in an isolated environment, without standing access to your account, stored credentials, other people's sites or platform settings.
- Visible steps and a stop control. A live report shows the build's tasks in the chat, and a Stop button halts the build.
- Reversible by design. Deploys are all-or-nothing: if a build fails, visitors keep seeing the previous version.
- Secrets kept out of the conversation. Provider keys are entered once under Integrations, stored encrypted and never displayed again. Never paste a key into a chat.
- Verified actions in the apps it builds. When a built app takes payments, orders are confirmed by a verified webhook from the payment provider, never by the customer's redirect.
- Spend limits for automation. If you drive WisyLink from your own scripts or agents through the API, each API key can carry its own spending cap per day, week or month, up to $10 per window.
For the isolation and deploy model, see the product page. To automate builds, start with the API reference and our walkthrough of the AI website builder API. To see the loop for yourself, start free, describe a small app, watch the build report and test the result before you share it.
F.A.Q.
