How an AI agent works
Every agent runs the same loop. It starts from a goal written in plain language. The model decides the next step and, when it needs information or has to act, calls a tool: a search, a database query, a CRM update, an email draft. The result comes back to the model, which decides again. The loop ends when the goal is met, when a limit is reached or when the agent hands over to a person.
Four things decide how well an agent works:
- The model, which plans, reads results and decides.
- The tools, each with a clear description, often provided through MCP servers.
- The context: instructions, examples and the knowledge the agent can look up.
- The guardrails: limits on steps and spend, approvals for sensitive actions, and a log of everything it did.
AI agents, chatbots and automation
The three are often confused. The difference lies in who decides the steps and whether the system acts in other software.
| Chatbot | Workflow automation | AI agent | |
|---|---|---|---|
| Who decides the steps | No steps: it answers in the conversation | Rules written in advance | The model, while it works |
| Acts in other systems | Rarely | Yes, along fixed paths | Yes, through the tools it chooses |
| Handles exceptions | It can explain them, not resolve them | It stops on cases the rules did not foresee | It adapts, within its limits |
| Fits best | Questions and answers | High-volume, predictable processes | Varied tasks with several steps |
Good systems often combine them: a workflow handles the predictable part and calls an agent only where judgement is needed.
Types of AI agents
Textbooks classify agents by how they choose actions, from simple reflex agents to goal-based, utility-based and learning agents. In business, a more useful split is by the job they do:
- Task agents run one workflow end to end, such as triaging support tickets or reconciling invoices.
- Assistant agents work for one person inside their tools, like Claude Cowork on a desktop, preparing documents, analysis and follow-ups.
- Coding agents, such as Claude Code, read a codebase, make changes and run the tests.
- Voice agents answer and make phone calls, take bookings and hand over to a person.
- Multi-agent systems split a goal across several agents coordinated by an orchestrator. See agentic AI.
Where companies use AI agents
- Customer service: answer, classify and route requests, and hand over to a person with a summary.
- Sales: research accounts before a meeting and update the CRM after it.
- Finance: match invoices to orders and draft follow-ups on exceptions.
- Legal: a first review of contracts against the company’s playbook, for a lawyer to check.
- IT and HR: triage tickets and answer policy questions from the company’s own documents.
The common thread is work with several steps, information spread across systems and a clear definition of done.
How to deploy AI agents safely
Agents act, so the controls matter as much as the model. Gartner expects over 40% of agentic AI projects to be cancelled by the end of 2027, because of rising costs, unclear business value or inadequate risk controls. Most of that can be avoided at the design stage.
Under the EU AI Act, an agent that talks to people must make clear that they are dealing with AI, unless it is obvious, since 2 August 2026. Agents used for high-risk purposes listed in Annex III, such as recruitment or credit scoring, carry high-risk obligations from 2 December 2027. See the EU AI Act checklist.
What the research says
- Gartner expects 40% of enterprise applications to include task-specific AI agents by the end of 2026, up from less than 5% in 2025.
- In McKinsey’s State of AI 2026 survey of 1,719 respondents, about two in ten said their organisation had reached the scaling phase with AI agents. Among companies with more than $1 billion in revenue, the share was 40%.
Sources
- Anthropic: Building effective agents, 19 December 2024
- Gartner: over 40% of agentic AI projects will be canceled by end of 2027, 25 June 2025
- Gartner: 40% of enterprise apps will feature task-specific AI agents by 2026, 26 August 2025
- McKinsey: The state of AI, 25 August 2026
- EU AI Act, Article 50: transparency obligations