What Is an AI Agent? When a Chatbot Starts Taking Steps

A chatbot answers a question and stops. An agent answers, uses that answer to choose an action, takes the action, reads what came back, and decides again — repeating until something tells it to stop. The model inside is the same one. What changed is that someone wrapped it in a loop and gave it tools.

That single difference explains most of what follows: why an agent can do work that takes several steps, why it fails in ways a chatbot cannot, and why the useful question is not “how smart is it?” but “what is it allowed to touch, and who checks the result?” Three things are worth keeping separate — what turns a model into an agent, how a loop turns small mistakes into large ones, and where a person has to stay involved.

An agent is a model with hands and a heartbeat

A language model on its own does one thing: it takes text in and puts text out. It has no memory between calls, no clock, no files, and no way to open a page. Everything it appears to know about the world outside the conversation has to arrive inside the prompt.

An agent is what you get when that text-only exchange is placed inside a program that can hand the model a description of available tools, read the model’s request to use one, actually run that tool, and put the result into the next prompt. The model never executes anything. It emits something like “call the search tool with this query,” and the program around it — usually called a harness, an orchestrator, or an agent framework — does the executing.

The heartbeat is the loop. Without one, a model that asks to use a tool makes a single request and stalls. With one, the request is fulfilled, the model gets another turn, and another, until it either declares itself finished or hits a limit: a step count, a time budget, a rule that says stop before spending money.

This is also why an agent is best understood as an algorithm with a language model inside it. An algorithm is a finite sequence of steps with a defined stopping condition. A well-built agent has one. A badly built agent lets the model decide when to stop, which is the same as having no stopping condition at all.

The loop has four beats, and only one belongs to the model

Most agent designs, whatever their branding, run the same cycle.

  1. Observe. The harness assembles the current state: the user’s request, the conversation so far, the results of earlier tool calls, and a list of what tools exist.
  2. Decide. The model reads that state and produces either a final answer or a request to use a tool.
  3. Act. The harness checks the request — is this a real tool, are the arguments well formed, is this caller allowed — and runs it.
  4. Record. The result, including any error, goes back into the state, and the cycle repeats.

Notice how much of that is ordinary software. The model contributes judgement at step two: which tool, which arguments, whether the job is done. The harness contributes everything that makes that judgement safe: permissions, timeouts, retries, logging, and the decision to stop. When people describe an agent as having gone out of control, they usually mean the harness was thin and the model was handed a wide action space.

Tools are where the model leaves the safety of text

Inside a chat window, a wrong sentence costs nothing except a correction. Once a model can call a tool, a wrong sentence becomes a wrong action. Reading a file is mostly harmless. Writing a file, sending an email, publishing a page, issuing a refund, or deleting a record are not.

The useful distinction is reversibility. A tool that only reads can be retried freely. A tool that writes needs a copy of whatever it overwrites. A tool that sends cannot be unsent. Agents usually get a mix of all three, and the mix is where trouble lives. Ask an agent to tidy up a shared folder and you have handed it a delete button along with a reason to use it.

The comparison that fits is a new intern with your login. The intern may be careful and well meaning and still do something you would not have authorised, because they cannot tell which of a hundred files matters. The difference is that an intern hesitates. A model does what the prompt suggests, at speed, without the social friction that makes a person ask first.

Most tools an agent uses are, underneath, an API: a defined request, a defined response, and a set of permissions attached to a key. That is worth remembering whenever an agent is described as autonomous. It is not wandering the open web. It is calling endpoints that somebody chose to expose.

Each step is built on the last, so mistakes compound

A single wrong answer is a dead end. A wrong answer inside a loop becomes a premise.

Picture an agent asked to find research on a topic and summarise it. The search tool returns a list of pages. One is a content farm that imitates the shape of a research abstract — same headings, same cautious phrasing, no actual study behind it. The model, which is good at judging whether text looks like a study and poor at judging whether it is one, treats the page as a source. Every later step inherits that mistake and stays consistent with it: the summary, the comparison, the recommendation. Nothing in the transcript looks broken. This is the failure described in why AI models make things up. The model is optimising for a plausible continuation, and a fabricated citation is a very plausible continuation.

Loops make that worse in two specific ways. They multiply opportunities, so ten steps mean ten chances to accept something unchecked. And they make later steps trust earlier ones, because the earlier output now sits in the context the model reasons from. An agent that has already written “the figure is forty percent” will keep building on forty percent, even if that sentence was invented three steps ago and never came from a document.

Some failures belong to the tools, not the model

Agents also fail in a duller way that gets less attention. A tool returns something unhelpful and the model narrates success anyway.

A search returns nothing. A page times out. A database query returns the first page of results and silently drops the rest. The model receives a thin or empty observation. Because it is trained to continue coherently, it often continues as though the step worked — summarising “the results” when there were none, or reporting that a file was updated when the write was rejected.

The failure a beginner is most likely to hit is not a wrong answer. It is a confident report of an action that did not happen. That is a harness problem before it is a model problem. Errors have to be passed through as errors, in plain language, and the model has to be told that an empty result is a fact worth reporting rather than a gap to fill.

Long loops drift

Every turn adds to the context the model has to hold. Eventually the early instructions — the ones that defined the goal and the limits — sit far behind, buried under tool output. Models attend unevenly across long inputs, and details in the middle of a very long context are easier to lose than details at the start or the end. The practical result is drift: the agent keeps working, but on a slightly different task than the one you set.

There is a subtler version too. An agent that has spent many steps on one approach tends to keep justifying it, because its own earlier reasoning is now part of the evidence it reasons from. Persistence looks like determination in a transcript and is hard to tell apart from stubbornness.

Permission is a design decision, not a setting

The most useful thing you control is not the model. It is the action space.

Three patterns cover most of the ground. Read-only first: the agent gathers and proposes, and a person performs the write. Approval gates: the agent may act, but any irreversible step pauses for a yes. Sandboxing: the agent acts freely inside a copy — a scratch folder, a test account, a staging site — and nothing reaches the real thing until someone promotes the result.

Whichever you choose, insist on a step-by-step log. An agent without a record is not auditable, and an agent you cannot audit should not be trusted with anything you would not hand to a stranger. If it handles other people’s information, the questions in what AI chatbots do with your data apply to every tool call, not only to the chat box.

Where a person belongs in the loop

Before the run, decide what finished looks like and what the worst plausible outcome is. If the worst outcome is an awkward email, let it run. If the worst outcome is publishing something false under your name, put a gate in front of publishing.

During the run, watch for the two signals that come before most trouble: the agent retrying the same failing action, and a growing pile of steps with no checkable intermediate result.

After the run, verify the artefact rather than the report. Open the file. Load the page. Read the message in the sent folder. The agent’s account of what it did is the least reliable evidence you have about what it did.

What to check before you let an agent run

  • Name the stopping condition. Steps, time, or a written definition of done, fixed before the first call rather than chosen by the model.
  • List every tool and mark it reversible or not. Anything irreversible needs a human gate or a sandbox.
  • Ask what happens when a tool returns nothing. If the answer is that the agent summarises anyway, fix that before anything else.
  • Look for a transcript. Every step, argument, and result. Without it you cannot tell a good run from a lucky one.
  • Pick the artefact you will check yourself and check it before anything ships.

Keep exploring

Related: how large language models work, what a transformer model does, and the rest of the AI section.