What is an AI agent?
A model that uses tools in a loop, deciding each next step from what the last one returned, until the task is done.
beginner · Also called AI Agent
A chatbot answers in one go. An agent works in steps. Anthropic's short definition is a good one to keep: an agent is a model using tools in a loop, based on feedback from its environment.
Ask an agent why last week's sales fell and it does not reply straight away. It might open the sales report, then query the order system, then read a log, and only then answer. Each of those is one lap of the loop.
The loop
Every lap has the same 4 steps.
- Think. The model reads everything so far and picks a next step.
- Act. It asks for a tool, with the inputs it wants.
- Observe. The tool's result comes back into the conversation.
- Decide. Answer now, or go round again.
The loop usually ends when the model has enough to answer. It can also stop at a token limit, on a refusal, or when it pauses to ask you something.
The model does not act
This is the part people miss. The model only writes text. A request to use a tool is a structured piece of text: this tool, with these inputs. Code around the model reads that request, runs the tool and passes the result back. That code, with the loop, is often called the harness. It can be your own program, the provider's servers, or a managed agent where the provider runs the whole thing for you.
To the model, each tool is a card with a name, a description and the inputs it takes. It can only ask for what is on those cards.
Why it matters to you
An agent can do far more than a chatbot, and it can also do more damage. It acts on what it reads, so a hidden line in a web page or an email can steer it. This is called prompt injectionPrompt InjectionAn attack that hides instructions in text a model reads, such as a web page, an email or a file, so the model follows the attacker instead of you.. Careful setups give an agent only the access the task needs, and ask a person before anything that matters, such as sending, paying or deleting. Even then, agents can make mistakes or be tricked.
So before you let one loose, ask 2 questions. What can it reach? And what must it ask me before it acts?
Sources
Where each fact comes from
This page was last checked against these sources on 14 October 2026.
- 1Building effective agents
Anthropic · 25 September 2026
An agent is a model using tools in a loop, based on feedback from its environment.
- 2How tool use works
Anthropic, Claude API documentation · 25 September 2026
The model never executes anything on its own. It emits a structured request, your code or the provider's servers run it, and the result comes back into the conversation. The loop usually ends when the model has enough to answer, and can also stop at a token limit, on a refusal or on a pause.
- 3Define tools
Anthropic, Claude API documentation · 25 September 2026
A tool is given to the model as a name, a description and the inputs it takes.
- 4Claude Managed Agents overview
Anthropic, Claude API documentation · 25 September 2026
The agent is the system around the model that runs the loop and the tools, often called the harness. With a managed agent the provider runs the loop and the tools in its own infrastructure.
- 5Mitigate jailbreaks and prompt injections
Anthropic, Claude API documentation · 25 September 2026
Indirect injection hides in a web page, an email, a document or a tool result the model reads. The agent should get only the data and permissions the task needs.
- 6Safety in building agents
OpenAI API documentation · 25 September 2026
A person should approve consequential actions. Even with these measures, agents can still make mistakes or be tricked.