What is an AI agent?
The difference between a prompt, a workflow and a real agent.
Goal: understand what an agent is technically, so you know what you're building and when you should
or shouldn't use one.
The spectrum: from prompt to agent
Not everything that uses AI is an "agent." There is a spectrum, and choosing the right level saves you money and headaches.
Level 1 โ A single prompt (one question, one answer)
You send text to the model, you get text back. Done.
"Write a product description for this chair." โ description.
Good for: classifying, summarizing, translating, generating. Cheap and predictable. Start here if you can. Many "AI businesses" don't need an agent at all โ a smart sequence of individual prompts is enough.
Level 2 โ A workflow (you control the steps)
You write the code that defines the steps: step A โ step B โ decision โ step C. The model does one thing per step; your code stays in charge.
Fetch product โ generate description โ check length โ save to database.
Good for: predictable, repeatable processes. Reliable because you hard-code the logic.
Level 3 โ An agent (the model decides the steps)
Now the model gets tools (actions it can take) and a goal. The model itself decides which steps to take, in what order, and when it's done. It runs in a loop: think โ choose tool โ review result โ next step โ ... โ done.
Goal: "Process all new orders from today." The agent checks which orders exist, decides
what's needed for each one, uses the right tools, and stops when everything is handled.
Good for: tasks you can't fully script in advance, where judgment and flexibility are needed. More powerful, but more expensive and less predictable โ so use guardrails.
Level 1 โ Single Prompt
โโโโโโโโโโโโโโโโโโโโโโโโโ
You โโโบ [Prompt] โโโบ Model โโโบ Answer
Level 2 โ Workflow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Your code controls the sequence:
[Step A] โโโบ [Step B] โโโบ [Decision?]
โyes โno
[Step C] [Step D]
Level 3 โ Agent (agentic loop)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Goal given by you
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Model THINKS: what's the next step? โโโโ
โ โ โ โ
โ โผ โ โ
โ Model ACTS: calls a Tool โ โ
โ โ โ โ
โ โผ โ โ
โ Tool runs, returns result โโโโ
โ โ โ
โ Done? โโyesโโโบ Return final output โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก In Claude.ai: You can prototype an agent's reasoning at Level 1 or 2 right in the chat โ paste your data, describe the task, and watch how Claude approaches it. This is a fast way to validate your logic before writing any code.
When should you use a real agent?
Use these four questions (from Anthropic's own agent design guidelines):
- Complexity โ Is the task multi-step and hard to fully specify in advance? (Yes โ an agent
may make sense. No โ use a workflow or a single prompt.)
- Value โ Does the outcome justify the higher cost and latency of an agent?
- Feasibility โ Is the model good at this type of task?
- Cost of errors โ Can you catch and recover from mistakes (review, rollback, tests)?
If any answer is "no," stay at a simpler level. An agent is not the goal โ delivering value is the goal. Most profitable automations are workflows with an occasional agentic step.
The anatomy of an agent
Every agent consists of five parts:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. MODEL the brain (Claude Opus 4.8) โ
โ 2. SYSTEM PROMPT who the agent is + its rules โ
โ 3. TOOLS what the agent can DO โ
โ 4. LOOP think โ act โ repeat โ
โ 5. GUARDRAILS limits, checkpoints, logging โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Model โ the reasoning engine. We use
claude-opus-4-8for heavy lifting and
claude-haiku-4-5 for simple, fast subtasks.
- System prompt โ the instruction that defines the role, goal, and boundaries. This is your
most important control lever. (Template in templates/agent-system-prompt-template.md.)
- Tools โ functions the agent can call: a store API, an email sender, a database, a payment
system. Without tools an agent can only talk; with tools it can act. (Module 05.)
- Loop โ the cycle in which the agent works autonomously until the goal is reached. (Module 06.)
- Guardrails โ the safety layer that prevents it from burning money or causing damage.
(Module 10.)
๐ก In Claude.ai: Use a Claude.ai Project to write and refine your system prompt interactively. Paste draft instructions, test them with realistic scenarios in the chat, and iterate quickly โ no code required. Once the prompt is solid, copy it into your Python code.
A concrete example
Suppose: an agent that manages the inventory of an online store.
| Component | Details |
|---|---|
| Model | claude-opus-4-8 |
| System prompt | "You are an inventory manager. Keep stock healthy, reorder when below 10 units, ask for approval above $500." |
| Tools | get_inventory(), get_sales_data(), place_order(), ask_human() |
| Loop | Check inventory โ analyze sales โ decide per product โ order or request approval โ log |
| Guardrails | Max $500 per order without approval; log everything; daily spend limit |
This agent saves hours of manual inventory work every day โ that is the "save time" lever from module 00, translated into concrete money.
Key terms (glossary)
- Token โ the unit in which text is counted and billed. Roughly ยพ of a word. You pay
per million tokens in and out.
- Context window โ how much text the model can "see" at once. Opus 4.8 has a 1 million token
context โ very generous.
- Tool use / function calling โ the mechanism by which the model calls your functions.
- System prompt โ the overarching instruction that sits outside the conversation.
- Agentic loop โ the repeating cycle of thinking and acting.
- Managed Agent โ an agent that runs entirely on Anthropic's infrastructure (module 07).
Your assignment
For your idea (from module 00), determine which level you need:
- Can it be done with single prompts? โ Cheap, start there.
- Do you have a fixed workflow? โ Write out the steps.
- Do you truly need flexible autonomy? โ Agent.
Be honest. Most first products start at level 1 or 2 and only grow to level 3 later.