NOTES / AGENTS

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.

UPDATED 18 NOV 2026#agents#definitions#agent-loop

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: a workflow runs fixed steps A, B and C; an agent has a model that chooses among tools in a loop until done

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: a task enters an agent made of a model, tools and instructions; the agent acts on an environment and reads feedback back

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: a spectrum from a single LLM call, to a workflow with a path fixed in code, to an agent where the model picks steps in a loop

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

Sources

  1. [1]Building effective agents — Erik Schluntz and Barry Zhang · Anthropic · 2024PARAPHRASED
  2. [2]A practical guide to building agents — OpenAI · 2025PARAPHRASED
  3. [3]How the agent loop works — Anthropic, Claude Agent SDK docsPARAPHRASED

© Ashish Kumar. All rights reserved. Quoted and cited material belongs to its owners. How I attribute sources.

Product, company and framework names are trademarks of their respective owners. Mentioning them does not imply affiliation or endorsement.