AI Agents
An AI agent is a system in which a model pursues a goal by repeatedly deciding which action to take (usually calling a tool), observing the result and deciding what to do next, until the goal is met or it stops.
The difference between an agent and the AI features most systems have today is who decides the steps. In a workflow, you write the steps and the model fills in parts of them. In an agent, the model chooses the steps.
A spectrum, not a switch
- Assistant: a model answers or drafts; a human does everything else.
- Workflow: fixed steps defined in code, with model calls at some of them. This is predictable, testable and often all you need.
- Agent: the model chooses which tools to use and in what order, within limits you set.
- Multi-agent: several specialised agents collaborating or handing work to each other.
The same rule applies as everywhere else on this site: use the simplest approach that works. A deterministic workflow with a couple of model calls is easier to test, cheaper to run and easier to explain than an agent. Use agents where the path to the goal genuinely can’t be known in advance.
The anatomy of an agent
- Model: the reasoning engine.
- Instructions: the goal, the constraints and how to behave.
- Tools: the actions it can take, such as APIs, queries, code execution and other agents. The Model Context Protocol (MCP), an open standard, is now widely used to connect agents to tools and data in a consistent way.
- State and memory: what it knows about the task so far, and what it carries between tasks.
- Environment: where its actions take effect. This is the part that matters most for safety.
- Guardrails: limits enforced outside the model: permissions, budgets, step limits and approval gates.
- Observability: a trace of every decision, tool call, input and output.
Treat agents like new team members
A useful way to think about an agent is as a new and very fast, but inexperienced, member of the team. You wouldn’t give a new starter production admin rights on their first morning, with no explanation of the team’s goals and no one checking their work. The same thinking that makes good teams works for agents:
- Charter: write down its mission, what it’s allowed to do, how it works and who it reports to.
- Identity: give every agent its own identity with least-privilege, short-lived credentials. Never let it borrow a human’s.
- Definition of Done: be clear about what “finished” means and how it will be checked.
- Supervision proportional to risk: review closely at first, and extend trust as evidence builds up.
Earn autonomy with evidence
We recommend a ladder of autonomy, climbed one rung at a time for each type of task:
| Level | The agent… | Humans… |
|---|---|---|
| Suggest | proposes actions or drafts | decide and act |
| Act with approval | prepares a change (for example a pull request) | review and approve every change |
| Act within guardrails | acts on its own inside hard limits | review samples and exceptions |
| Autonomous | acts and reports | monitor outcomes |
Move up only when the evidence (evals, review outcomes, incident history) says it’s safe, and move back down quickly when it doesn’t. Irreversible or high-impact actions, such as deleting data, spending money, changing permissions or contacting customers, should always need explicit human approval.
Give an agent a goal, a boundary and a way to check its work. Never just a goal.
Security and reliability
- Prompt injection is the defining risk. Anything an agent reads (web pages, documents, emails, tool output) may contain instructions that try to hijack it. Treat everything it reads as data, not instructions, and limit what a hijacked agent could do. Guardrails in the prompt are advice; guardrails in IAM policies are enforced.
- Limit the blast radius: separate accounts, scoped permissions and sandboxed execution.
- Budgets and limits: cap steps, time, tokens and spend per task, so a confused agent can’t loop expensively forever.
- Make actions safe to retry: agents retry, so idempotent tools matter.
- Trace everything: you’ll need to answer “why did it do that?” Make sure you can (see Observability).
- Evaluate continuously: test agents against realistic tasks, including adversarial ones, every time the model, prompts or tools change.
One of the most promising uses of agents is building and running infrastructure. See Outcome-Driven Infrastructure.