SimpleA plain explanation, one diagram and an analogy, with where the analogy breaks.
Guess first: Before you read: how would you know when a messy room is finished? Show the answerYou look again and check. An agent does the same: it keeps looking until the job is really done.
Think of a robot tidying a room: look around, pick one thing up, check where it goes, then look again. It keeps going until the room is tidy.
An AI agent works the same way, using computer tools instead of hands.
The agent receives a goal. The model reasons about the next step and requests a tool call.
The harness runs the tool, with permission checks, and feeds the result back into the context.
The loop repeats until the model decides the task is done, a limit is reached, or a person steps in.
The agent loop
Goal: from the user
Think: choose next step
Act: call a tool
Observe: read the result
Done?: stop or continue
Like: A robot tidying a room. Where it breaks: A tidying robot can see the whole room. An agent only sees what's in its context, so long tasks need summaries and memory, and details can get lost.
How it worksAn interactive demo first, then the mechanism: light maths, pseudo-code and trade-offs.
An agent task is a chain of steps: read a file, call a tool, edit, run a test. The whole task only succeeds if every step does.
If each step succeeds with chance p, and steps fail independently, a task of n steps finishes with chance p to the power n. Small per-step errors compound fast.
A check and retry step helps: a test or a second look catches some failures, and the agent gets one more try. Turn it on and watch the curve lift.
Leave each step at 95% and set 20 steps. How often does the whole task finish?
Set 50 steps. How good must each step be for the task to finish at least half the time?
Turn on check and retry at 80%. How much does it lift 20 steps? Now drop the catch rate to 0%.
ResearchWhere the simple picture breaks, open problems and primary sources.
The loop of think, act and observe looks the same for a two-step task and a two-day one, but reliability does not stretch with it.
Long tasks. The length of task frontier agents finish half the time has doubled about every seven months since 2019, and success still falls as tasks get longer (METR, 2025).
Consistency. An agent that solves a task once may fail it on the next try; in one benchmark, leading agents solved under a quarter of one domain's tasks on all eight attempts (τ-bench, 2024).
Gaming the goal. Recent models sometimes changed timers, tests or scoring code instead of doing the task, and telling them not to cheat had little effect (METR, 2025).
Untrusted observations. Every tool result can carry instructions. Injected web content partly hijacked web agents in up to 86% of cases, though they often failed to finish the attacker's goal (WASP, 2025).
Security on this concept: 1 threat Pending expert review
Attackers run AI agents against their targets Pending expert review
Exposed
Coding and computer-use agents that can run scans and exploits
Organisations targeted at machine speed
Attacks
Splitting an intrusion into small, harmless-looking tasks for an agent
Letting the agent do most of the reconnaissance and exploitation, with people approving only key steps
Agent harnesses The program wrapped around a model that turns it into an agent: it runs tools, asks permission, manages context and keeps memory.
Coding agents Agents that work inside a code repository: read files, make edits, run commands and tests, and iterate until the checks pass.
Computer & browser use Agents that operate a screen like a person: look at a screenshot, then click, type and scroll.
Multi-agent systems Several agents with different roles or contexts work together on one task.
Agent permissions & sandboxing Giving an AI agent only the tools, data and network access a task needs, running it in a sandbox, and asking a person before risky actions.
Responding to a compromised agent What to do when an AI agent has been hijacked or misbehaves: stop it, cut its access, find out what it touched, fix the cause and recover.