What an agent is
Concepts · topic concepts/what-is-an-agent
An agent is a model placed in a loop with tools, so that instead of only answering it can look things up, act, observe the result and decide what to do next. This topic separates the model from the agent built around it, explains tools and the loop, and introduces the scale from "suggests" to "acts unattended".
Concepts
- Model vs agent
- A model takes text in and produces text out, once. An agent is software that calls a model repeatedly, gives it tools, feeds the tool results back and stops when a goal is met. The model supplies judgment; the agent supplies hands, memory and a loop. Most of what makes an agent useful or dangerous lives in the software around the model. glossary
- Tool
- A function the agent can ask to run, described to the model by name, purpose and parameters. Reading a file, searching the web, running a command or calling an API are tools. The model does not execute anything itself; it emits a request, the agent runs it and returns the result. Tools are how an agent reaches beyond its context window. glossary
- Agent loop
- The cycle an agent runs: observe the current state, think about what to do, act through a tool, observe the result, repeat. The loop ends when the model says it is done, a step limit is hit or a human intervenes. Everything an agent does, good or bad, is some number of turns of this loop. glossary
- Degree of autonomy
- How much an agent may do before a human sees it. At one end it only suggests; further along it acts but asks before anything irreversible; at the far end it runs unattended. Autonomy is a setting chosen for a task, not a property of the product, and the right level depends on how costly a mistake is and how easily it can be undone. glossary
- Harness
- The software around the model that makes it an agent: the loop, the tool definitions, the permission checks, the system prompt, context management and the stop rules. Two agents using the same model can behave very differently because their harnesses differ. When an agent misbehaves, the fix is usually in the harness, not the model. glossary
- Environment
- The files, programs, services and data that an agent's tools act on. The model chooses an action and the harness carries it out, and the effect lands in the environment: a file changes, a command runs, a message goes out. The environment is the third part of an agent, next to the model and the harness. What it contains decides what the agent can reach and what a mistake can damage, so a test copy limits both. glossary
- Model request
- One call from the harness to the model, carrying the instructions, the tool descriptions and the history so far, and answered by one response. A single prompt from a person often leads to many requests. The model asks for a tool, the harness runs it and sends the result in a new request, and this repeats until the model answers without asking for a tool. Each of these round trips is one turn of the agent loop. glossary
- Stateless model
- The model keeps nothing from one request to the next. Each request has to carry everything the model should take into account, so the harness sends the whole conversation again every time. What feels like the agent's memory is text the harness stores and sends again, or notes it writes to files and reads back later. Clearing or shortening that text changes what the model knows at once. glossary
Links
- Builds on: Prompting, Capabilities and limits
- Leads to: Tool use, Grounding and memory, Inspecting what the agent sends, Connecting tools with MCP, Agent risk, Delegating to an agent
- Competencies drawing on it: Reasons about what a model request costs and why, Recognizes an agent, its tools and its degree of autonomy
Lessons
- Watch a tiny agent work (tutorial)
- Assistant or agent? (explanation)
- Who decides the next step (explanation)
- One prompt, many requests (explanation)
Your reference
Each lesson above adds its takeaways and its example here once you finish it. Your reference lists every lesson you have finished.
Watch a tiny agent work
Unlocks when you finish Watch a tiny agent work.
Takeaways
- An agent is a model in a loop with tools. The model produces text, and when that text is a request the loop runs the tool and returns the result as more text. The model never runs anything itself.
- A tool is described to the model by name, purpose and parameters, in plain text, and that description is all the model has to decide when and how to ask for it.
- Each step of the loop is observe (read the task or the last result), think (write a request or an answer) and act (the loop runs the tool). Naming the phase tells you where a mistake came from.
- The loop ends when the model writes an answer, when the step limit is reached, or when a person stops it. A run that ended on a limit or a stop was interrupted in the middle of a step, and its output has to be read that way.
Example
This lesson has no runnable example or prompt block.
Assistant or agent?
Unlocks when you finish Assistant or agent?.
Takeaways
- A model takes text in and gives text out, once. An agent is software that calls the model in a loop, gives it tools, feeds the results back and stops when the goal is met.
- Tell the two apart by what the system can do without another prompt, whatever its interface looks like. A chat window can front an agent, and a button can trigger one plain model call.
- The harness is the software around the model: the loop, the tool definitions, the permission checks, the system prompt, context management and the stop rules. Agents on the same model differ because their harnesses differ, and the fix for a misbehaving agent is most often in the harness.
- List an agent's tools before you judge what it can do. What it can touch is what its tools can touch, and the tool that acts on other people is the one to look at first.
Example
This lesson has no runnable example or prompt block.
Who decides the next step
Unlocks when you finish Who decides the next step.
Takeaways
- The degree of autonomy of a workflow is how much the system may do before a person sees it. Three points cover most conversations: suggests, acts and asks before anything hard to undo, and runs unattended.
- Place a workflow by asking who decides the next step, never by how much text the system produces. Autocomplete that writes a whole function is low autonomy, because a person accepts each suggestion.
- Autonomy is a setting chosen for a task. One coding agent lands on three different points in three permission modes, and the choice depends on how costly a mistake is and how easily it can be undone.
- To move a workflow one step, change which step a person decides. An agent that merges its own pull request has moved up. An agent that shows a change instead of writing it has moved down.
- The safety course's human in the loop section picks the steps that need a person, and the using-agents course's choosing autonomy section applies the same scale to a task you delegate.
Example
This lesson has no runnable example or prompt block.
One prompt, many requests
Unlocks when you finish One prompt, many requests.
Takeaways
- One prompt to an agent usually causes several model requests. Each request is one call to the model and gets one reply, and a new request follows each batch of tool results until a reply asks for no tool.
- A reply can ask for several tools at once, so count requests by the replies, not by the tool calls.
- Every request carries the instructions, the tool descriptions and the whole history so far, and only the history grows.
- The model is stateless. It keeps nothing between requests, so it knows an earlier step only because the harness sent it again.
- The model chooses, the harness sends the requests and checks and runs the tools, and the environment is what the tools act on. Name the part to know where to look when a step goes wrong.
Example
This lesson has no runnable example or prompt block.
Sources
AEC-01What are AI agents: model versus agent, autonomy levels, when a prompt suffices, Agent Engineer Course (course)DLAI-11Agentic AI: M1 workflows and autonomy, M2 reflection, M4 evals and error analysis, M5 autonomous agents, DeepLearning.AI (course)Academy claude-platform-101Claude Platform 101, Claude Academy (course)Claude Code agent loopHow the agent loop works, Claude Code documentation (reference)Claude docs messagesMessages, Claude Platform documentation (reference)