What is an agent: the loop
An agent is a model that chooses its own steps, using tools, in a loop. What that means, what it is made of, and how it differs from a fixed workflow.
A working definition
“Agent” is used loosely. Anthropic notes that some teams mean a fully autonomous system that runs for a long time and uses many tools, while others mean a more prescriptive implementation that follows a predefined workflow. Their answer is to call all of these agentic systems and then draw one architectural line1.
- In a workflow, code decides the path: LLMs and tools are orchestrated through predefined steps.
- In an agent, the model decides the path: it directs its own process and tool use, and keeps control of how it accomplishes the task1.
Diagram: my own, following the workflow and agent distinction in 1.
OpenAI frames it from the user’s side: an agent is a system that independently accomplishes tasks on your behalf2. Both definitions agree on the part that matters for engineering: something other than your code chooses the next step.
What an agent is made of
OpenAI describes the foundation of an agent as three components: a model, tools it can use, and instructions that define its behaviour2. Anthropic’s version is the same idea seen from the loop: an agent starts from a command or conversation with the user, plans, then operates independently, getting “ground truth” from the environment at each step, such as a tool result or code execution, so it can judge its progress1.
Diagram: my own, combining the components in 2 with the action and feedback cycle in 1.
That feedback is what separates an agent from a single clever prompt. Without it, the model is guessing. With it, each step can correct the last.
The loop
Mechanically, the agent is a loop. The Claude Agent SDK documentation describes the cycle plainly: Claude evaluates the prompt, calls tools, receives the results, and repeats until the task is finished3. The model never executes anything itself; the surrounding program does, and that program is the harness. The loop is covered step by step in The execution loop, so this note stays on the concept.
Anthropic also stresses that the run can pause for human input at checkpoints or when it hits a blocker, and that it ends when the task is complete or a stopping condition such as a maximum number of iterations is reached1. Those exits are the subject of Stopping conditions and budgets.
A spectrum, not a switch
It is more useful to think of a range than a category.
Diagram: my own.
Moving right buys flexibility and costs predictability. Anthropic says agentic systems often trade latency and cost for better task performance, and that you should ask whether the trade makes sense1. The note on when not to use an agent takes that question seriously, and Workflows vs agents covers the patterns in the middle.
Where to go next
- How the model asks for an action: Tool calling.
- How it decides what to do next: ReAct and planning.
- How much freedom to give it: Levels of autonomy.
Sources
- [1]Building effective agents — Erik Schluntz and Barry Zhang · Anthropic · 2024PARAPHRASED
- [2]A practical guide to building agents — OpenAI · 2025PARAPHRASED
- [3]How the agent loop works — Anthropic, Claude Agent SDK docsPARAPHRASED