AI Agents Explained
What makes an AI agent different from a chatbot, how its work loop runs, where agents help, where they fail and what to ask before using one.
Key takeaways
- An agent is a model running in a loop with tools, so it can act on a goal over many steps.
- Tools define what an agent can touch, and permissions define what it's allowed to do with them.
- Errors can compound across steps, which makes checkpoints and reversible actions important.
- Content an agent reads, such as web pages and email, can try to steer it, so treat that as a real security risk.
- Start with narrow, low-stakes, easily checked tasks before handing over anything that matters.
An AI agent is a program that uses a language model to pursue a goal by taking steps: it decides what to do, uses a tool such as a search, a file editor or a web browser, looks at the result and decides again. A chatbot hands you an answer. An agent can change things.
That difference is the whole reason to pay attention. An agent that books, edits, sends or deletes can save you an hour of clicking. The same ability means its mistakes show up in your files, your inbox or your bill.
From answering to acting
A plain language model takes text in and produces text out. It has no way to look at your calendar or press a button. To make an agent, developers surround the model with ordinary software that does three things:
- Describes tools to the model: a name, what the tool does and what inputs it needs.
- Runs the tool when the model's output asks for it, using real code.
- Feeds the result back into the conversation so the model can choose the next step.
The model never runs anything itself. It writes a structured request such as "search the files for invoice 1042", and the surrounding program decides whether to carry it out. That program, often called the harness or runtime, is where permissions, limits and logs live. A shared way of plugging tools in is described in the Model Context Protocol.
The agent loop
Say you ask an agent to find why a small website's contact form stopped sending. It might read the form's code, search the server log, notice an authentication error from the mail service, look up what that error means, propose a configuration change, ask you to approve it and then send a test message. Each step depends on what the previous one revealed. Nobody wrote that exact sequence in advance.
The loop ends when the model reports it's finished, when it hits a limit on steps, time or spending, when it needs a person, or when someone stops it. Good agent products make those limits visible.
What agents are made of
| Part | What it does | Why it matters to you |
|---|---|---|
| Model | Chooses actions and writes text | Sets the quality of judgment |
| Instructions | Describe the role, rules and goal | Vague instructions produce surprising choices |
| Tools | Let it read and change things | Define the reachable world |
| Context | The working memory of the current task | Limited, so old details can drop out |
| Memory | Notes saved between tasks, if offered | Convenient, and a place for errors to persist |
| Harness | Enforces permissions, limits and logging | The main safety layer you can inspect |
The context point deserves a note. A model can only consider so much text at once, as explained in tokens and context windows. On long jobs, agents summarize or discard earlier material, and a constraint you mentioned at the start can fade. Repeat important rules, or put them somewhere the agent rereads.
A task traced step by step
Following one hypothetical job shows where the judgment calls sit. You ask: "Find three venues for a 30-person meeting next month and draft inquiry emails."
First the agent searches the web and opens several pages. It notices that your calendar tool is available and checks which dates are free, if you've granted that. It reads capacity and contact details from each page. One page lists no capacity, so it has to choose between guessing, skipping the venue or asking you. It then writes three drafts and saves them without sending.
At each point something can slip. The search may surface an outdated listing. A capacity figure may refer to standing guests and not seats. A page could contain text aimed at AI readers. The draft might promise a date you never confirmed. A well-designed agent shows you its sources and marks what it assumed, so you can check the four or five facts that matter instead of redoing the research.
Common kinds of agents
- Research agents run many searches, read pages and assemble a report with links.
- Coding agents read a project, edit files, run tests and fix what fails.
- Browser agents operate websites by reading the page and clicking or typing.
- Office assistants work across mail, calendar and documents.
- Operations agents watch alerts and gather diagnostic information.
- Customer service agents answer questions and perform limited account actions.
Some systems split work among several agents, with one coordinating the others. That can help with large tasks, but it also multiplies cost and makes it harder to see who decided what.
"Agent" is used loosely in marketing. A fixed script that calls a model once is automation with a model in it. The useful question is how much the software chooses on its own and what it can change.
Agents versus ordinary automation
Traditional automation follows rules someone wrote: when a form arrives, copy these fields, send that email. It does exactly that every time, and fails loudly when the input changes shape.
An agent handles messier input and unplanned situations, at the price of predictability. Run the same request twice and you may get different steps. It's also usually slower and costlier per task than a script, because each decision is a model call.
If you can write the steps down precisely, a script or webhook-driven workflow is often the better tool. Reach for an agent when the path varies: investigating, drafting, sorting ambiguous requests.
Where agents go wrong
- Compounding errors. A wrong assumption in step two shapes every later step, and the final report may sound consistent.
- Declaring victory early. An agent may report success when a test was skipped, weakened or never run. Check the evidence.
- Looping. It retries the same failing action, consuming time and money.
- Misreading the goal. "Clean up my inbox" can mean archive or permanently delete.
- Overreach. Given broad access, it may "helpfully" change things you didn't mention.
- Being steered by content. A web page or email can contain instructions aimed at the agent. This is prompt injection, and it has no complete fix today.
- Ordinary web friction. Logins, CAPTCHAs, pop-ups and changed layouts stall browser agents.
Long tasks add a practical problem: by the time something goes wrong, there may be hundreds of steps to read. Ask for short progress notes and a list of everything changed.
Cost, speed and where people fit
Each turn of the loop is at least one model call, and the context often grows as results pile up. A task that takes two steps is cheap. One that wanders through forty can take a long while and use a meaningful amount of paid capacity. Watch usage for the first several runs so you know what normal looks like.
People fit best at three points. Before the work, you set the goal and boundaries. In the middle, you answer questions and approve consequential actions. At the end, you verify the result against something real: the test output, the sent folder, the file list. Skipping the last step is tempting because the agent's own summary reads like a verification. It's only the agent's account of events.
It also helps to think about who else is affected. Messages sent by an agent arrive in real inboxes, and bookings made by it occupy real slots. Sites it visits may have rules about automated use, and the traffic counts as coming from you. The wider picture of good and bad bots is changing as agents become ordinary visitors.
How much autonomy to give
Autonomy is a dial. You can set it per action, not just per agent.
The details of scoping accounts, sandboxes and approvals are covered in permissions and guardrails for agents.
Questions to ask before using one
- What exactly can it read, and what can it change?
- Which actions require my confirmation, and can I adjust that?
- Where does my data go, and how long is it kept?
- Can I see a log of every action?
- How do I stop it mid-task?
- What limits exist on spending, messages sent or steps taken?
- How do I undo what it did?
- Who is responsible if it acts wrongly on my behalf?
A product that can't answer these clearly isn't ready for anything important.
A sensible first project
Choose a task that is tedious, low in risk and quick to verify. Good candidates: gathering links on a topic into a table, proposing new names for a folder of copies, or drafting replies that stay unsent until you approve them.
Write the request like a brief to a new assistant: the goal, what's off limits, what counts as done, and when to stop and ask. For example, "Make a list of the duplicate photos in this copied folder. Don't delete or move anything. Show me ten examples before finishing."
Then check the result against reality, using the same habits you'd apply to any AI output. Spot-check items, confirm nothing outside the scope changed, and note where it misunderstood. Expand its reach only after it has earned it on work you can inspect.
Common questions
Does an agent learn from my corrections?
Usually it uses them within the current task. Some products save notes for later. The underlying model typically doesn't retrain from your session on the spot.
Can an agent work while I'm away?
Many can run in the background or on a schedule. Unattended work calls for tighter permissions and firmer limits, since nobody is watching for the first wrong step.