Course B · Module B2 Going Agentic · Lesson 10 of 18

Anatomy of an Agent

A chatbot answers. An agent acts. Here's the difference — and the four parts that make it possible.

~13 min · No tools needed · Prereq: B9 Security Basics

In Course A you built "when X happens, do Y" automations: fixed recipes, every step decided in advance. Powerful — but they can't improvise. An agent is different: you give it a goal and it decides, step by step, how to reach it. That shift is the whole point of Module B2. Your single win in this lesson: by the end you'll be able to name the four parts of any agent and explain what each one does — which means you'll know exactly what to configure, what to constrain, and where things can go wrong.

The four parts

Strip away every framework and buzzword and every agent has exactly four components. Think of them like the parts of a skilled employee:

1 · The Model

The brain. A large language model (like Claude) that reads the situation and decides what to do next. Swap the model and the whole agent's "personality" and capability changes.

2 · Tools

The hands. Specific abilities granted to the model — search the web, read a file, call your CRM, send a Slack message. The agent can only act on the world through the tools you give it. No tool = no action.

3 · Memory / Context

What it knows right now. This includes the original goal, all the steps it has taken so far, the results it got back, and any documents or data you've handed it. Context fills up — this is why agents don't run forever on one task.

4 · The Loop

The engine. The agent repeats a four-beat cycle — decide what to do, act (call a tool), observe the result, repeat — until the goal is met or it gives up. This loop is what makes it agentic rather than a single one-shot reply.

How this differs from a Course-A automation

A fixed automation is like a vending machine: press B4, get a bag of crisps, every time, no surprises. Great for predictable, repeating tasks.

An agent is like a competent assistant: give them a goal ("find me the best flight under £400 and book it"), and they'll search, compare, hit unexpected pages, backtrack, and figure it out — making small decisions the whole way. You didn't script every step; they did.

That's the power. It's also the risk.

Fixed automationTrigger → predefined steps → result. Fast, predictable, no surprises. Perfect for repeating tasks with a known shape.
AgentGoal → the agent chooses its own steps → result. Handles novelty and multi-step problems — but can go off-script.

The promise and the risk

The loop is what unlocks power: an agent can handle tasks that branch, hit dead ends, and need mid-course correction — things a fixed automation can't do. But the same loop creates two risks you need to plan for:

Going off the rails. The agent decides its own steps. A poorly scoped goal — or a missing constraint — can lead it down an expensive, wrong, or even destructive path. (Imagine an agent told to "clean up the database" without being told which records are safe to delete.)

Context overflow. Every step consumes context. A long-running agent will eventually hit its limit and either stall or start forgetting earlier steps.

Guardrails are not optional. Every well-run agent has at least one: a scope constraint (only touch files in this folder), a human checkpoint (ask me before sending), or a hard stop (try at most 10 steps). You'll build these into every agent you deploy. The next lessons show you how.

Check yourself

Answer before opening — recalling it now is what makes it stick.

An agent is given the goal "draft and send the weekly newsletter." It can write, but it sends nothing. Which of the four parts is missing?

Tools. The model can decide to send, but without a "send email" tool actually granted to it, there is no hand to act. The brain without hands can plan all it likes.

What is the decide → act → observe → repeat cycle called, and why does it matter?

The loop. It matters because it's what separates an agent from a one-shot chatbot reply. The loop lets an agent tackle multi-step problems by updating its plan each time it sees a new result — including recovering from dead ends.

You build a "clean up old leads" agent with no guardrails. What's the concrete risk?

It might delete leads you meant to keep — or loop expensively, or take unintended side-actions. Without a scope constraint or human checkpoint, the agent's own definition of "clean up" may not match yours. Always add at least one hard constraint before running an agent on live data.

Read this next (primary source)

Building Effective Agents — Anthropic Research. Anthropic's own guide to the patterns that work (and the common mistakes). Written for builders, readable by non-engineers — especially the "when to use agents vs. workflows" section. See RESOURCES.md for more.

I'm your teacher — ask me anything. Not sure whether your use case calls for a fixed automation or an agent? Describe the task and I'll give you a straight recommendation. That's the judgment call this lesson is designed to sharpen.

Key terms from this lesson — agent, context, hallucination, human-in-the-loop — are defined in the course glossary.