Agents and tools · Explainer

What an AI agent is

For operatorsFor developers 6 min read · Updated Aug 2026

On this page
  1. How the loop works
  2. Agents, workflows, and chatbots
  3. What an agent needs
  4. Why agents cost more
  5. When not to build one
  6. Common questions
  7. Where Gate fits

The short answer

An AI agent is a model given tools and permission to decide its own next step, running in a loop until the job is done or a limit stops it. What separates an agent from a regular AI feature is who chooses the steps: in a workflow your code decides, and in an agent the model does. That single change is what makes agents useful and what makes them expensive.

Everything else about them follows from the loop.

How the loop works

A normal request is one round trip: you ask, the model answers, done. An agent turns that into a cycle.

  1. Someone gives it a task, as a command or a conversation.
  2. It decides what to do first and asks for a tool to be run.
  3. The application runs the tool and hands back the result.
  4. It reads the result, judges progress, and decides the next step.
  5. Repeat, until the task is finished or a limit is reached.
Final answer Model decides the next step chooses, never executes Your code runs the tool or refuses asks for a tool returns the result, and the loop goes again when the task is done, or the step limit is hit
Final answer done, or limit hit Model decides chooses, never executes asks for a tool Your code runs it or refuses the result
Fig. 1
The model chooses, your code acts, and the result decides the next choice.

Anthropic describes it in those terms: an agent plans and works on its own, coming back to a person only when it needs information or a judgement call. What keeps it honest is checking reality at every step, using what the tools returned rather than what it expected, to assess its progress.

Step four is what people mean by autonomy. The model isn’t following a script through branches somebody wrote. It is looking at what came back and choosing.

Agents, workflows, and chatbots

The word gets applied to almost anything with a model in it, which is why it has stopped being informative. The useful distinction is narrow and Anthropic states it directly: “Workflows are systems where LLMs and tools are orchestrated through predefined code paths. Agents, on the other hand, are systems where LLMs dynamically direct their own processes and tool usage, maintaining control over how they accomplish tasks.”

Who decides the stepsGood forThe failure looks like
AssistantNobody. One question, one answerDrafting, summarising, answeringA wrong answer you can see
WorkflowYour code, in advanceWell-defined tasks that repeat the same wayA branch nobody wrote
AgentThe model, at each stepOpen-ended tasks where the steps aren’t knowable in advanceTwenty steps in the wrong direction, at full price

Both of the last two count as agentic systems in Anthropic’s terminology. The distinction that matters operationally is predictability: a workflow does what it did last time, and an agent might not.

What an agent needs

An agent is not a model with a personality. It is a small amount of scaffolding around an ordinary API call.

ToolsA set of operations it can request, each with a name, a description, and an input shape. It cannot do anything you have not given it, and it decides what to call from the descriptions alone.
A driverSomething that runs the loop. The model can’t execute anything itself, so the application sends the request, runs the tool, and sends the result back on the next turn.
A stop conditionTask completion, a step ceiling, or both. A cap on the number of turns is the usual approach. Without one, a confused agent runs until your budget notices.
A sandboxTest it somewhere it cannot do damage, with limits around it. Anthropic makes agent use conditional on trust, because an agent runs for many turns and you have to be willing to let it decide.
A recordWhat it did, in what order, with what result. Without one, a run that went wrong is not reconstructable after the fact.

A framework is not on that list. The scaffolding is a loop, a list of tools, and a stopping rule.

Why agents cost more

The cause is structural rather than a pricing quirk.

Every step is a full round trip, and every round trip carries the whole conversation so far, which is billed again each time. Step ten pays for steps one through nine. Add tool results, which are usually long, and the context grows with every iteration. A ten-step task does not cost ten times a single request. It costs considerably more.

Anthropic is direct about the trade: an agent buys better results with time and money, and the fact that it runs on its own means “higher costs, and the potential for compounding errors.”

Compounding is the second half of the problem. A model that is wrong occasionally is manageable when a person reads each answer. In a loop, a wrong step becomes the input to the next one, and the error is now a premise rather than an output.

When not to build one

The strongest argument against agents comes from the company selling them. Anthropic’s guidance opens with: “we recommend finding the simplest solution possible, and only increasing complexity when needed. This might mean not building agentic systems at all.”

The test is whether the steps are knowable in advance. If they are, a workflow is cheaper, faster, and predictable, and it fails in ways you can enumerate. If they aren’t, and the task needs that flexibility at scale, an agent earns its cost.

There is also a middle setting. A single well-constructed request with the right context solves a surprising share of what gets scoped as an agent, at a fraction of the cost and with none of the loop’s failure modes.

Common questions

Is an agent just a chatbot with tools?+
Tools are necessary but not sufficient. What makes it an agent is that the model chooses the sequence, and keeps choosing based on what comes back, rather than following a path your code laid out.
Does the agent run code by itself?+
No, and this is the most common misconception. The model emits a structured request to run something; your application decides whether to run it and hands back the result. Every action an agent takes is one your code performed on its behalf, which is also where control lives. How that mechanism works is a topic of its own.
How many steps should an agent be allowed?+
Fewer than you think, and it should be an explicit number. A step budget is a cost control and a safety control at once, and a task that regularly exhausts it is usually a task that needed decomposing rather than a bigger ceiling.
Why do agents get more expensive as they run?+
Because the conversation is resent on every step and grows with every tool result. The cost per step rises as the run goes on, so a long run is more expensive than the number of steps suggests.
How many tools should one agent have?+
Fewer than feels natural. OpenAI’s guidance is to keep the initially available set small for higher accuracy, suggesting under twenty at the start of a turn, and to load rarely used tools only when needed. A large tool surface costs input tokens on every request and makes the wrong choice more likely.
What is the biggest risk with agents?+
That the model acts on instructions somebody else wrote. An agent reads web pages, documents, and tool results, and any of those can contain text aimed at it rather than at you. That is prompt injection, and tool access is what turns it from an embarrassing answer into an action.

Keep learning