AI Roadmap · Step 06

AI Agents & Automation

← Back to upskilling path

One line of code separates the two

Everything so far has been a conversation. You ask, the model answers, you do something with the answer. Even RAG — the model reads, then tells you. The doing stayed with you.

An agent is what you get when the model can ask for things to be done and then see the results. That's it. Not a different model, not a special API — the same model, called in a loop, with permission to request actions.

A chatbot calls the model once and shows you the answer. An agent calls it again, with the results of whatever it last asked for, until it stops asking.

That loop is the entire difference. And the crucial thing to hold onto: the model still never does anything itself. It emits text saying "I'd like to run search_issues with these arguments." Ordinary code you wrote reads that, runs the function, and hands the output back. The model's only power is choosing what to ask for next.

Watch the loop run

Abstract descriptions of agents are confusing; watching one is not. Here's an agent with two tools — get_current_user() and search_issues() — answering a question it cannot possibly answer on its own. Watch the message travel, or pause and step through it yourself.

Notice what the model never did: it never queried a database, never knew who "me" was, never counted anything. It made three decisions — ask who the user is, ask for their bugs, stop asking and answer — and your code did all the work in between.

📝 Note: This is why an agent that "can't do X" is usually missing a tool, not intelligence. And why an agent doing something alarming is usually a permissions problem, not a rogue AI. For a deeper treatment of the machinery around the model, see the companion post The AI Harness.

Tools are an interface you design

The model chooses tools by reading their names and descriptions — that's all it has. Tool definitions are therefore documentation written for a reader who will act on it immediately and cannot ask follow-up questions.

Which means the same capability, described two ways, produces visibly different behaviour from an identical model. Compare:

Which tool set will the model use better?
A  manage_data(action, entity, payload)
B  get_user(id) · search_issues(filters) · close_issue(id)
B. One tool that does everything pushes all the ambiguity into arguments the model has to guess — what counts as an action? what shape is payload? Narrow tools with honest names make the right choice obvious and the wrong call impossible to express. The rule of thumb: if you can't describe a tool in one clear sentence, split it.

Three things earn their keep in every tool description: what it does, when to reach for it — including when not to — and what comes back. Vague descriptions produce an agent that flails between plausible options; precise ones produce one that moves in a straight line.

MCP: why it exists

Once tools are useful, everyone wants the same ones — your files, your database, your issue tracker, your calendar. The problem is that every agent framework historically spoke its own dialect, so every tool had to be rebuilt for every agent.

The Model Context Protocol is a standard for that connection: tools describe themselves once, in a common format, and any agent that speaks the protocol can use them. Toggle between the two worlds:

Agent A
Agent B
Agent C
Files
Database
Issues
Calendar

It's the same shape of fix as device drivers, or USB. The value isn't cleverness, it's that the integration count stops multiplying — and that a tool someone else wrote works with your agent without either of you having met.

Where the human goes

An agent that can act can act wrongly, and it does so at machine speed and without hesitation. But gating every action behind approval defeats the point — you've rebuilt manual work with extra steps.

The workable rule is the one from Step 03, applied to actions instead of answers: gate on blast radius. How bad is this if it's wrong, and can it be undone?

Auto-run, ask first, or never?

Action 1 of 3
read_file("src/auth.js")
Auto-run. Reading changes nothing and is trivially undoable by doing nothing. Gating reads is the fastest way to make an agent useless — it needs to look at many files to be any good, and an approval prompt per file means you may as well read them yourself.
Action 2 of 3
git push --force origin main
Ask first — and this is the category that matters most. It's legitimate occasionally, destroys other people's work when wrong, and is hard to reverse. "Ask first" exists precisely for actions that are sometimes correct; reserve "never" for things that are never worth the risk, or the agent will learn you always say yes.
Action 3 of 3
send_email(to: customer_list, body: draft)
Never — not without a human explicitly sending it themselves. Messages to other people cannot be recalled, and the cost of a wrong one is reputational rather than technical, so no rollback exists. Drafting is a great agent task; sending is yours.
💡 Tip: Give agents a place to work where mistakes are cheap — a branch, a scratch directory, a staging account. Most oversight anxiety disappears when the worst realistic outcome is "delete the branch and try again." Design the blast radius before you tune the permissions.

What's worth automating

Agents pay off where a task is multi-step, tedious, and checkable — triaging inbound issues, migrating a pattern across a codebase, gathering scattered data into one report, following a runbook that's always the same until it isn't.

They pay off badly where the work is one clear step (just call the model), where being wrong is expensive and hard to detect, or where you couldn't tell a good result from a bad one. That last case is the real trap: an agent will complete the task either way.

The whole lesson, in five lines
  1. An agent is a model in a loop with tools. The loop is the whole difference.
  2. The model still acts only through your code. It asks; your functions do.
  3. Tool descriptions are the interface. Narrow, honestly described tools beat one flexible one.
  4. MCP turns N×M integrations into N+M by standardising how tools describe themselves.
  5. Gate on blast radius. Auto-run reads, ask before damage, never for anything you can't recall.

Up next

AI in Your Career →

Turning all of this into genuine fluency — and keeping it current as the field moves.

Start lesson →