MODULE 01

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):

  1. 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.)

  1. Value โ€” Does the outcome justify the higher cost and latency of an agent?
  2. Feasibility โ€” Is the model good at this type of task?
  3. 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    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

claude-haiku-4-5 for simple, fast subtasks.

most important control lever. (Template in templates/agent-system-prompt-template.md.)

system. Without tools an agent can only talk; with tools it can act. (Module 05.)

(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.

ComponentDetails
Modelclaude-opus-4-8
System prompt"You are an inventory manager. Keep stock healthy, reorder when below 10 units, ask for approval above $500."
Toolsget_inventory(), get_sales_data(), place_order(), ask_human()
LoopCheck inventory โ†’ analyze sales โ†’ decide per product โ†’ order or request approval โ†’ log
GuardrailsMax $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)

per million tokens in and out.

context โ€” very generous.


Your assignment

For your idea (from module 00), determine which level you need:

Be honest. Most first products start at level 1 or 2 and only grow to level 3 later.


โ˜ฐ All modules