Skip to content
Course contents · How AI agents actually work

Lesson 6 of 13

What is an AI agent?

An agent isn't a smarter model. It's a model plus a harness, going around a loop until the job is done.

Think of a sat nav. It knows where you're going and where you are, and every few seconds it checks again. Wrong turn? It recalculates. It doesn't plan the whole journey once and then close its eyes. An agent works the same way.

Model plus harness

Agents are models using tools in a loop.

Hannah Moran, Anthropic, as quoted by Simon Willison (May 2025)

That is the cleanest definition going. An agent is not a smarter model. It is the model, plus everything around it, going around a loop. That "everything around it" deserves a name: the harness.

The model
does the thinking: looks at what's in front of it and proposes the next step
The harness
does everything else: holds the tools, manages the context, keeps the memory, runs the loop and enforces the limits

Put simply: the model proposes, the harness executes. If the model is the engine, the harness is the rest of the car.

The loop

"Find 3 suppliers and draft an intro email to each"5 steps
  1. The model sees the goal, the context and the tools, and picks the next step
  2. The harness runs the tool: search, read a document, draft an email
  3. The result is added to the context
  4. The model looks again: is the goal met?
  5. No: around the loop again. Yes: stop.

This is what separates an agent from a chatbot. A chatbot answers and waits. An agent keeps going, step after step, using what it learned from the last step to choose the next.

Knowing when to stop

The last step of the loop is the hard one. A chatbot stops when it finishes a sentence. An agent has to decide the job is done, and "done" is often something you have to define.

Stops too late
loops forever, burning tokens and money. Expensive, but at least you notice fast.
Stops too early
declares victory on a half-finished job. Expensive too, and slow to spot, because someone has to find out and redo it.

So a good harness puts guardrails around the loop:

  • A maximum number of turns
  • A budget
  • An explicit stop condition: what "done" looks like
  • Checkpoints where a person can look in

Why the harness is where the difference is

The same model in two different harnesses can produce very different results. That goes a long way to explaining why two products "powered by" the same model can feel worlds apart.

Very few of us will ever build a model. But almost everyone has access to roughly the same frontier models. So for the rest of us, the work, and the difference, is the harness: the tools, the context, the memory, the loop and the limits.

Running example

The running job

Chasing last month's unpaid invoices, one lesson at a time.

Here is Priya's invoice chaser as a loop. Every box is one trip round:

Step by step6 steps
  1. Find the invoices that are unpaid and past their due date
  2. Check whether any were paid since, or are being disputed
  3. Draft a reminder for the next overdue client
  4. Wait for Priya to approve it
  5. Send it and log it in the spreadsheet
  6. Any overdue clients left? Yes: go round again. No: stop.

The stop condition is clear: every overdue client has been handled. The guardrails: no more than one reminder per client per run, a cap on turns in case something goes wrong, and Priya's approval before anything is sent.

Practice

Try it yourself

About five minutes, in any AI chat app

Write the loop before you build it

  1. Pick a small, repeating job from your own work, like sorting an inbox folder or preparing a weekly report.

  2. In any AI chat app, ask: "Describe this job as a loop an AI agent would run. For each step, say what it looks at, what it does, and how it decides whether to go round again."

  3. Then ask: "What is the stop condition, and what guardrails would stop it running forever or stopping too early?"

What to look for

A vague stop condition ("until it's done") is a warning sign. A good one is something you could check yourself, like "every overdue client has had one reminder".

Common mistakes

  • Thinking a better model will make a better agent.

    Look at the harness first: the tools, the context, the stop condition and the limits.

  • Leaving "done" undefined.

    Write the stop condition down in plain words before you build anything.

  • Running a loop with no limits.

    Always set a turn limit or budget, and a point where a person can look in.

Quick check

3 questions to see what stuck. Nothing is scored or saved.

  1. 1. What is an AI agent?

  2. 2. In "the model proposes, the harness executes", what does the harness do?

  3. 3. An agent declares a job finished when half of it is left. What failed?

Remember

An agent is a model plus a harness going round a loop. The harness, including when it stops, is where the real difference is.

Sources and further reading

  1. 1.The LinkedIn post this lesson grew out of: What is an AI agent?
  2. 2.Simon Willison: Agents are models using tools in a loop (Hannah Moran's definition)
  3. 3.Simon Willison: I think "agent" may finally have a widely enough agreed upon definition

Optional

Try it in LaunchLemonade

New assistants start in Agentic mode: they decide their own steps and use tools to get things done. Everything above works in any AI tool.

Build an assistant

Finished this lesson?

0 of 13 done in this course. Progress stays in this browser, no account needed.