Agent, chatbot or workflow: what is the difference
The three are easy to confuse because they can all sit behind the same chat window. The difference is who decides the steps and what the software is allowed to change.
| Type | Who decides the steps | What it can change | Main risk |
|---|---|---|---|
| Chatbot | Nobody: it answers one message at a time | Nothing outside the conversation | A confident wrong answer |
| Workflow automation | You, in advance, as fixed rules | Exactly what the rules allow | A case the rules did not foresee |
| AI agent | The model, within the tools you give it | Whatever its tools permit | A sensible-looking action that is wrong |
An agent earns its extra risk when the path through a task depends on what it finds along the way. Our glossary entry on AI agents gives the short definition, and the article on agents versus workflow automation helps you choose.
Tools and permissions: an agent can only do what its tools allow
An agent acts through tools: functions with a name, a description and a typed input that your code runs on its behalf. The design rule is to make each tool narrow. “Look up an order by number” and “draft a refund up to the policy limit” are good tools. “Run any database query” and “call any endpoint” are not, because they hand the model your whole system.
- Validate on the server. The model's tool call is a request. Your code checks the arguments, the user's rights and the record's state before anything runs.
- Separate reading from writing. Read tools can be broad; write tools should be few, specific and logged.
- Give each agent its own service account with least privilege, scoped to the customer or team it serves, never a person's login.
- Set rate limits per tool, so a confused loop cannot send a thousand emails.
Tools can be wired through a model provider's function calling or through the Model Context Protocol, an open protocol for connecting AI applications to tools and data. The protocol changes how tools are connected, not how far they should be trusted.
Planned steps or fixed steps
Agents sit on a range from tightly scripted to open-ended. The more freedom the model has, the harder the agent is to test, so we give it as little as the task needs.
- One model step in a fixed flow: code runs every step and the model does one job, such as reading an email.
- A router: the model chooses among a few fixed paths, each one tested on its own.
- Plan, then execute: the model proposes a plan, code checks it against rules, then the steps run.
- An open loop: the model picks a tool, reads the result and decides again until it finishes. Flexible, and the hardest to predict.
Picture an agent that handles suppliers' requests to change delivery dates for a manufacturer's purchasing team. Reading the supplier's email and proposing a new date that fits the production plan suit the model. Checking that the sender is a registered contact for that supplier, and refusing changes to orders already received, belong in code, because they must happen every time whatever the model concludes.
Memory and state
Within a run, the agent's memory is its context: the task, the conversation and the tool results so far. Keep it lean. Long contexts cost more, slow responses and bury the instruction that matters, so summarise earlier steps and pass each step only the fields it needs.
Across runs, prefer your systems of record over hidden memory. If the agent learns that a customer prefers morning deliveries, write it to the CRM where staff can see and correct it. Any memory store the agent keeps is a database like any other: it needs retention rules, access control and strict separation between customers. For tasks that wait hours or days for an approval, the run's state is saved so it resumes exactly where it stopped.
Approval gates for actions that matter
Some actions should pause until a person approves them: anything irreversible, payments and refunds above a limit, messages to customers in sensitive situations, changes to master data and regulated decisions.
A good approval screen shows what the agent wants to do, why, and the evidence it used, and lets the reviewer edit the draft, approve or reject with a reason. Every decision is logged, and rejections become test cases. Watch the volume: a reviewer asked to approve hundreds of items a day starts approving without reading. Our article on when AI needs a human's approval sets out a risk matrix, and the human-in-the-loop entry defines the pattern.
Keeping cost and latency in check
Agent costs grow with the number of model calls in each run and the size of each prompt. Controls we build in:
- A maximum number of steps and a token budget per run, after which the agent stops and hands off.
- Timeouts on every tool and on the run as a whole.
- A smaller, faster model for routing and classification, and a larger one only for the steps that need it, chosen by testing on your cases.
- Caching of stable lookups, such as a product catalogue, so each run does not fetch them again.
- Cost per completed case as the headline figure, rather than cost per call, which hides retries.
Designing for failure
Tools time out, APIs return errors, the model produces arguments that fail validation, and a run can stop halfway: the refund issued, the confirmation email not sent. Each case needs a defined response.
- Retry temporary errors with backoff and a limit; never retry a rejected payment.
- Give every write an idempotency key, so a retried step cannot run twice.
- Send unfinished runs to an exception queue with the full trace, so a person can finish or reverse them.
- Keep a switch that turns off the agent, or a single tool, at once.
Testing and security deserve their own attention. AI agent testing covers evaluation sets and regression runs, AI security covers prompt injection and excessive agency, and AI monitoring covers tracing every run in production.
When an agent is the wrong answer
- The steps are always the same. A fixed workflow automation is cheaper, faster and easier to test.
- You cannot say what a correct result looks like. If nobody can grade the output, nobody can test the agent.
- The action is high-risk and cannot be reviewed in time. Keep it with a person, and let software prepare the case.
- The only way in is the screen. An agent clicking through a user interface breaks when the layout changes; an API or export is worth building first.
- Volume is low. If the task happens a few times a month, a checklist may be the right tool.