AI Agents
In this article
- Decide whether a system is an AI agent by asking who picks the step after each result comes back.
- Tell an agent apart from a single model call and from a fixed sequence written in code.
- Explain why calling tools, running many steps or picking one of a few listed branches does not settle the question.
- Terms defined here: observation, AI agent, control-flow ownership.
Overview
Three support bots use the same model and the same order database. Their vendors all call them agents. Only one of them is, and you cannot tell which from the marketing page, how many actions it can call or how long each one runs.
You can tell from one question: after the system learns something new, such as what an order lookup returned, who decides what happens next, the application code or the model? That question gives a definition of an AI agent you can apply in a design review, and it sorts most real systems in a minute.
Brightline's support assistant
Brightline, a home-internet provider, runs a support assistant on its website that answers customers. The company and its data are made up. The assistant has four actions: look up the order, ask the customer a question, issue a refund (at most $50; above that a person decides), and hand off to a person on the support team.
A customer writes: the router stopped working, and this month's $35 plan fee was charged twice.
An order lookup would show two facts. The plan fee was charged twice this month. The router was delivered 20 days ago, and Brightline's return window is 14 days from delivery, so the router is past it. Here is the same message handled three ways.
One model call
The code sends the message to a large language model and posts the reply. That single request, text in and text out, is a model call. Claude, Anthropic's model, can only respond with text when it has nothing to act with [4]. The same holds here: this version cannot see the order and cannot act on it. Its reply can only be general: sorry about the router, please contact billing about the charge.
After the call there is no next step, so nobody has to choose one.
A fixed sequence
The second version is a short program. Code checks the customer is signed in, looks up the order, passes the message and the order record to the model, and sends the draft the model writes. The order lookup is a tool: code that does one job and hands its output back as text.
The lookup says the fee was charged twice and the router is past its return window. The draft can now say both, but the next step did not change. The draft step was always going to run after the lookup, because a programmer put it there before this customer wrote in. If nobody wrote a branch for duplicate charges, nobody issues the refund, whatever the record says.
This shape is what Anthropic and LangGraph call a workflow: the model and the tools run along code paths fixed in advance [1][3].
The assistant chooses
The third version gives the model the four actions as tools and lets it ask for them. It asks with a tool call: the model emits the name of one tool with typed arguments, application code runs that tool, and the result goes back to the model as the next message of the conversation [3]. The model then reads that result and asks for the next action, or stops.
Before reading on, predict the assistant's second action. It has just read that the fee was charged twice and that the router is past the return window.
- The model reads the message and asks for look up the order. Code runs the lookup.
- Back comes the record: the $35 fee twice this month, the router delivered 20 days ago.
- The model asks for issue a refund of $35 for the second charge. That is under the $50 cap, so code runs it.
- The model asks for hand off to a person for the router, with a note of what it found. None of its actions can repair or replace a router, and the return window has closed, so a person has to decide.
At step 3, no line of code said "after a lookup that shows a duplicate charge, issue a refund". The model chose it from what it read. Change the record so the fee appears only once, and the same model on the same message could ask the customer a question instead, perhaps whether the second charge is on a different card. The input that changed was the lookup result, and the next step changed with it.
That result has a name. An observation is whatever comes back after an action, such as a tool's output, which the model reads before it chooses its next step [2].
Code still owns a lot in the third version: which four actions exist, how each one runs, and the $50 cap inside the refund action. The model chose to refund; the code that issues refunds can still refuse anything above $50. Who picks the step and what each action is allowed to do are separate design choices.
Who picks the next step
Now the definition. A system is an AI agent when the model chooses the next action from what it has observed, and the code does not fix what follows. In smolagents, agents are programs in which model output controls the workflow [2]; for Anthropic, the model directs its own process and its own use of tools [1].
The property under test is control-flow ownership: which part of the system, the application code or the model, decides which step runs next.
| Version | Who picks the next step | What code fixes | What the model decides |
|---|---|---|---|
| One model call | Nobody: there is no next step | The single request | The words of the reply |
| Fixed sequence | Code | Every step and its order | The words of the draft |
| Assistant chooses | The model | Which actions exist and how each runs | Which action comes next, and when to stop |
Agents usually take several steps, choosing again after each observation, but the count is not the test. Claude Code, Anthropic's coding assistant, adapts its loop to the task: a question about a codebase may need only gathering context, while a bug fix repeats every phase many times [4]. A one-step answer is still the model's choice that one step was enough.
What does not make a system an agent
Tools. The fixed sequence calls a tool and a model, and code still owns every step. Tools give a system things it can do; they say nothing about who decides when to do them. LangGraph builds both its workflows and its agents on chat models that support tool calling [3].
A model that picks a branch. Suppose Brightline adds a first step where the model labels each message "billing" or "technical", and code then runs the path written for that label. The model made a choice, but only among branches code listed in advance, and code owns everything after it. That is still code-owned control flow. smolagents treats agency as a spectrum, not a yes-or-no property, and calls this a router, its lowest level above a model whose output changes nothing [2]; LangGraph lists routing under workflows [3]. The yes-or-no line drawn here is this course's own cut.
Autonomy language. "Autonomous", "smart" and "self-driving" describe a feeling, not a mechanism. Ask instead where the decision after each result is made.
What changes when the model owns the steps
A model that chooses can choose wrong. Such systems need error logging and retries [2]. Anthropic adds that agents cost more and their errors can compound, and it recommends extensive testing in sandboxed environments with guardrails [1]. A cap on the number of iterations is a common safeguard [1].
So the agent shape is worth it when the path cannot be written down in advance. When it can, smolagents recommends plain code, which is fully reliable for the cases it covers [2].
:::note In practice Claude Code describes itself as an agentic loop: it looks around the code, acts, then checks the outcome, and the output of each tool feeds the model's next decision [4]. Asked to fix failing tests, it may run the tests, read the errors, edit files and run the tests again, and the code around the model does not fix that order. :::
:::note In an interview When asked "what is an agent?", give the test, not adjectives: after a tool returns, does code or the model pick the next step? Then give the trade-off: an agent handles paths you cannot predict, at the cost of reliability, cost and harder testing [1][2]. :::
Common mistakes
- "It calls tools, so it is an agent." Check who picks the next tool. If code wrote the sequence, it is a workflow with tools.
- "It ran only one step, so it is not an agent." If the model decided one step was enough, the model owned the control flow.
- "The model classifies the request, so the model decides." It chose among branches code wrote. Code still decides what runs after.
Sources
- Building effective AI agents. Anthropic. Checked 24 Oct 2026.
- Introduction to agents (smolagents docs). Hugging Face. Checked 25 Oct 2026.
- Workflows and agents (LangGraph docs). LangChain. Checked 25 Oct 2026.
- How Claude Code works. Anthropic. Checked 24 Oct 2026.
Check yourself
Check yourself
Question 1 of 13
Which question best tests whether a system is an AI agent?
Your first check counts towards your result.