AI basics

What Is an AI Agent? What It Does and How It Works

An AI agent is a language model that picks its own next step and uses tools to carry it out. Here is what happens inside one, how well it works, and how it goes wrong.

Follow one job through an agent

The clearest way to understand an agent is to watch one work. Picture an invented email reaching a small distributor: “Order 5127 was supposed to be here Tuesday. Can you credit the shipping?”

A chatbot could write a polite reply. An agent moves the job forward. It reads the email and works out that it needs the order record, so it calls the order system. The record says shipped, so it checks the carrier and finds the delivery ran two days late. It then reads the credit policy, which allows shipping credits on late orders. It drafts a reply and prepares the credit. Then it stops, because money is about to move.

One email, worked by an agent

Sample data, invented
  1. A request is typed in: Handle this email about a late order.
  2. The work moves through Read, Look up, Check policy, Draft.
  3. Results appear: Order 5127 found, shipped; Delivered two days late; Shipping credit allowed.
  4. Credit $18.40 and send reply waits for a person, who acts on it.
  5. Approved by Customer Service Lead, 10:22 am.

Before: by hand

A staff member opens three systems, works out what happened, then writes back.

Sample data, invented

After: credit approved, reply sent

Order 5127 found, shipped. Delivered two days late. Shipping credit allowed. Credit $18.40 and send reply waits for a person.

Approved

Approved by Customer Service Lead, 10:22 am

  • Picks its own next step
  • Uses your tools
  • Stops for a person

Illustrative example. Actual results vary.

Nobody wrote a script telling it to check the carrier next. Had the record shown the order never left the warehouse, it would have taken a different path. That is the defining feature.

So here is the definition: an AI agent is software that uses a large language model to decide its own next step, and tools to carry that step out. Anthropic draws the line this way: in a workflow, the model and tools follow paths written in advance, while an agent directs its own process and its choice of tools.[1] OpenAI’s shorter version is a system that independently completes tasks on your behalf.[2] If the terms are new, start with what AI is.

The loop inside every agent

Under the surface, an agent is a loop with a language model at its center.

How an AI agent works, one turn at a time

  1. 1GoalA task, with its limits
  2. 2DecideThe model picks the next step
  3. 3ActSoftware runs one tool
  4. 4ObserveThe model reads the result
  5. 5CheckFinished, stuck, or needs approval?

Then the loop repeats, with what you learned

Blue steps are the model. Grey steps are ordinary software, which behaves the same way every time. The person sets the goal and its limits.

On each turn, the model receives its instructions, the task and everything that has happened so far. It replies with one of two things: a request to use a tool, or a final answer.

Here is the detail that matters most to a business owner. The model never touches your systems. It only produces text that says, in effect, “please look up order 5127.” Ordinary software around the model reads that request and decides whether to run it. A spending limit written into that software will hold. A limit written only in the instructions is a polite request.

The loop also needs a way to end. Agents can pause at checkpoints or when they hit a blocker.[1] OpenAI suggests handing control to a person when an agent exceeds a failure threshold, and before high-risk actions.[2] Stopping conditions such as a maximum number of iterations are also common,[1] and a cap on spend works the same way, so a confused agent stops instead of circling.

Why long tasks are hard

Each turn costs money and adds a chance of error. In one academic benchmark, tasks took about 27 steps and more than $4 each at the API prices of the time, which have since changed.[7] Anthropic reports that agents use about 4 times the tokens of a chat, on its own data.[14] A token is a word fragment, and it is the unit most model pricing is based on.

Errors also compound, a risk Anthropic names directly.[1] Imagine an agent that is right 95% of the time at each step. Over ten independent steps, that imagined agent finishes cleanly only about 60% of the time. Real agents do better than this arithmetic, because they can notice a bad tool result and try again. Still, the arithmetic explains why shorter, narrower jobs succeed more often than long, open-ended ones.

The four parts, and the choice each one forces

OpenAI lists three core components: a model, tools and instructions.[2] AWS and IBM add memory and planning.[3][4] Planning is what the loop does, so that leaves four parts to decide on.

The model: the one doing the reading and deciding

The newest model is not always the right one. A narrow task may run well on a cheaper, faster model, and only a test on your own samples will tell you. Changing the model can change behavior, so treat an upgrade as a change to be retested.

Tools: what it can actually do

A tool is any function the agent may call, such as reading an order, searching documents or sending an email. Tools are where an agent’s real power and real risk sit. The main design choice is width. A tool that issues a credit up to a fixed amount on one order is far safer than one that can run any database command. OWASP’s guidance calls this least privilege: give only the access the job needs.[5]

Separate read tools from write tools, too. An agent that can only read can produce a wrong answer, but it cannot change anything. Standards such as the Model Context Protocol make tools easier to connect. They do not make them safe by themselves, as our guide to AI integrations explains.

Instructions: the job description

Instructions tell the agent its role, the steps it should usually follow, your policies and what to do when something is unclear. Good ones read like a careful handover to a new hire. Most of the work in a good agent goes here and into testing, because vague policies that staff quietly interpret become visible the moment software has to follow them.

Memory: what it carries forward

Short-term memory is the running record of the current task. Long-term memory carries facts from one task to the next. It is useful and it adds risk: Microsoft’s failure taxonomy highlights memory poisoning, where corrupted memory stores an attacker’s instruction and the agent acts on it later.[6] A sensible default is to keep long-term facts in your existing systems, where people can see and correct them.

Chatbot, assistant, workflow or agent?

The word “agent” now appears on products that are not agents. OpenAI is explicit that applications using a language model without letting it control the flow of work, such as simple chatbots and sentiment classifiers, do not count.[2] That does not make those products bad. It means you should know what you are buying.

AI agent vs. chatbot, and the two in between

TypeWho picks the next stepCan it change your systems?Good for
ChatbotNo one. It replies to each messageNoDrafting, explaining, general questions
Knowledge assistantFixed: find passages, then answerNoQuestions about your documents, with sources
AI workflowYour team, in advance. The model handles one stepYes, along set pathsRepeated work with one messy step, such as reading a form
AI agentThe model, within limits you setYes, through approved toolsWork where the steps depend on what it finds
One quick test: ask what happens when a step fails. If the answer is always the same, it is a workflow. If the system works out what to try next, it is an agent.

For plain document questions, an agent is usually overkill. Microsoft says FAQ bots and document search with summaries need classic retrieval, not an agent.[20] See company knowledge and RAG. For a fuller comparison with rule-based tools, see AI agents vs. RPA.

How well agents work today

Benchmarks date quickly, because models keep improving. Read them for the pattern, and do not take any of these as a general failure rate.

  • A simulated company. In TheAgentCompany, a preprint from a Carnegie Mellon-led team, the best model finished 30.3% of 175 office tasks.[7] Data science, administration and finance were the weakest areas.
  • Real freelance projects. In the Remote Labor Index, the top agent produced work as good as a professional’s on 2.5% of projects at launch in October 2025.[8] An undated leaderboard showed the top entry at 21.25% as of November 2026.[9] That is fast progress, and most client-grade projects still fall short.
  • Business software tasks. In CRMArena-Pro, vendor research from a Salesforce team on invented customer data, agents succeeded on about 58% of single-turn tasks and about 35% of multi-turn ones.[10] Top agents exceeded 83% on rule-following workflow tasks in single-turn tests, and the authors found almost no built-in awareness of confidentiality.[10]

Three patterns hold across these. Agents do best where rules are clear. They slip when a task needs a long back-and-forth. And they do not protect sensitive data unless the system is designed to make them.

In one large vendor sample, most agent activity still appeared to be supervised. Anthropic estimated, using its own model on about a million tool calls through its public API, that 73% had some human involvement and 0.8% of actions appeared irreversible.[13] That is vendor data, weighted toward software engineering, and the authors call some figures upper bounds.

Five ways agents fail, and what stops each one

  1. It obeys the wrong text. An agent reads email, web pages and files, and any of them can contain hidden instructions. This is prompt injection, ranked first in OWASP’s list of risks for AI applications.[5] In the EchoLeak flaw in Microsoft 365 Copilot, researchers showed a crafted email could pull data out with no user click.[16] The control: treat everything the agent reads as data, and limit what an agent exposed to outside content can do.
  2. It has too much reach. Excessive agency, meaning more permission or freedom than the job needs, rose to third in OWASP’s 2026 list.[17] The control: narrow tools, separate accounts and approval steps. These hold even when the model is fooled.
  3. It claims success falsely. The control: have ordinary software verify the end state, by confirming the credit exists in the ledger and not by trusting the agent’s summary.
  4. It loops or overspends. The control: caps on steps and spend, plus an alert when a case runs long.
  5. It drifts. A model update, a new policy or a change in your data can quietly lower quality. The control: evals, which are structured tests run on real samples.[18] Build them from your closed cases, and rerun them before every change.

People are the last control. OpenAI says actions that are sensitive, irreversible or high stakes should trigger human oversight until confidence in the agent grows, and gives refunds and payments as examples.[2] We apply a simple version: people approve anything that moves money, reaches a customer or cannot be undone.

Review has a cost too. Google notes that the human-in-the-loop pattern adds architecture someone must build and maintain.[19] Our guide to human-in-the-loop AI covers how to design that review so it holds up.

When an agent is the right tool

OpenAI offers three tests. An agent suits work with complex decisions, rules that have become hard to maintain, or heavy reliance on unstructured data such as emails and PDFs.[2] If your use case does not clearly meet them, it says, a deterministic solution may be enough.[2]

The other major vendors agree. Anthropic advises finding the simplest solution that works, which may mean no agent at all.[1] Microsoft advises the lowest level of complexity that reliably meets your needs.[15] When the companies selling agents tell you to try something simpler first, it is worth listening.

Here is how we think through it for a client:

  1. Write down the steps. If they rarely vary, build a plain workflow.
  2. If one step is messy, such as reading a document, add a model to that step only.
  3. If the path truly depends on what is found, build a single agent with narrow tools.
  4. Test it on closed cases, with the hard ones included.
  5. Add autonomy slowly, as the measured results earn it.

Larger jobs may eventually call for several specialized agents, and our guide to AI agent roles shows how those fit together. Start with one. To see how we build them, read about AI agents and automation.

Questions

What is the difference between an AI agent and a chatbot?

A chatbot replies. An agent decides what to do next and acts through tools. A chatbot can tell a customer your refund policy. An agent can check the order, apply the policy and prepare the refund for a person to approve.

What are some examples of AI agents at work?

Vendor guides describe support-ticket triage that reads a ticket, checks logs, tries a fix and escalates only when needed, and an expense flow that reads receipts, checks policy and calls an approval system.[20] OpenAI uses a home insurance claim as an example.[2] What they share is messy input and steps that depend on what is found.

Can an AI agent make a mistake without anyone noticing?

Yes, and that is the main reason to design for it. Wrong output can look fine, and an agent’s report of its own success is not reliable proof. Keep an automatic check on the end result, sample finished work, and log every step in plain language.

How much does an AI agent cost to run?

It depends on the steps per task, the model and the volume. Published build-cost ranges mostly come from vendors, and we found no independent figures we would repeat. Expect running costs above a chat tool, and ask to see cost per completed task during a pilot. We price our projects at a fixed price.

Is my company data safe with an AI agent?

That depends on the design. Give the agent its own limited account, read-only access wherever possible, and no reach into data its job does not need. Check that the model provider’s terms suit your data. We keep client data in the client’s own accounts. Our guide to AI security and data privacy goes further.

Can an agent work with the software we already use?

Often, yes, if the software has an API or a connector. If it only has a screen, it gets harder. Agents in testing struggled with complex web interfaces, so older systems may need a different bridge.[7]

Sources

  1. Anthropic (vendor), Building effective agents, December 2024.
  2. OpenAI (vendor), A practical guide to building agents, read November 2026.
  3. AWS (vendor), What are AI agents?, read November 2026.
  4. IBM (vendor), What are AI agents?, read November 2026.
  5. OWASP, LLM01:2025 Prompt Injection, 2025.
  6. Microsoft (vendor), New whitepaper outlines the taxonomy of failure modes in AI agents, April 2025.
  7. Xu et al., TheAgentCompany: Benchmarking LLM Agents on Consequential Real World Tasks (preprint, v3), September 2025.
  8. Mazeika et al., Remote Labor Index: Measuring AI Automation of Remote Work (preprint), October 2025.
  9. Scale AI, Scale Labs Leaderboard: Remote Labor Index (RLI), undated, read November 2026.
  10. Huang et al., CRMArena-Pro: Holistic Assessment of LLM Agents Across Diverse Business Scenarios and Interactions (preprint, vendor research), May 2025.
  11. Anthropic (vendor), Project Vend: Can Claude run a small shop? (And why does that matter?), June 2025.
  12. Anthropic (vendor), Project Vend: Phase two, December 2025.
  13. Anthropic (vendor), Measuring AI agent autonomy in practice, February 2026.
  14. Anthropic (vendor), How we built our multi-agent research system, June 2025.
  15. Microsoft (vendor), AI agent orchestration patterns, read November 2026.
  16. Reddy and Gujral, arXiv, EchoLeak: The First Real-World Zero-Click Prompt Injection Exploit in a Production LLM System (preprint), September 2025.
  17. OWASP, OWASP GenAI Security Project unveils 2026 Top 10 for LLM applications, September 2026.
  18. OpenAI (vendor), Evaluation best practices, read November 2026.
  19. Google Cloud (vendor), Choose a design pattern for your agentic AI system, read November 2026.
  20. Microsoft (vendor), Business plan for AI agents, read November 2026.
A practical place to start

See where AI fits in your business.

In two weeks we map how your business runs, where AI helps and where it does not, and hand you a written plan.