Lesson 4 of 7 · What Is an Agent?
What Agents Can and Cannot Do
A realistic look at AI agents: what they do well, why errors compound, cost and speed limits, risks like prompt injection, and how to design around them.
- 5 min read
- Beginner
- Reviewed
- Name the kinds of tasks agents handle well today
- Explain why small errors add up over long tasks
- Describe the cost, speed and security limits of agents
- Design tasks so agents are more likely to succeed
Where agents shine
Agents do best on tasks with these features:
- Clear goal, checkable result: tests that pass, a file that opens, a number that can be verified.
- Good tools and fast feedback: each action returns useful information.
- Mistakes that can be undone: drafts, code in a branch, read-only searches.
- Moderate length: a few to a few dozen steps.
Coding is the standout example: an agent can run the tests after every change, so it gets instant, honest feedback on whether it's on track.
Why long tasks are hard
Every step carries a small chance of going wrong: a misread result, a wrong argument, a poor choice. If every step must succeed, those chances multiply:
# If each step of a task succeeds with probability p, and every step must succeed,
# the whole task succeeds with probability p x p x ... = p ** steps.
print("Steps 99% per step 95% per step 90% per step")
for steps in [1, 5, 10, 20, 50]:
row = " ".join(f"{p ** steps:>12.0%}" for p in [0.99, 0.95, 0.90])
print(f"{steps:>5} {row}")An agent that's right 95% of the time per step finishes a 10-step task correctly only about 60% of the time, and a 50-step task less than one time in ten. This is why agents work best when steps can be checked and corrected along the way, rather than having to be perfect.
Other limits
| Limit | What it means | How to design around it |
|---|---|---|
| Cost | Each step is a model call, and the history grows | Fewer steps, smaller models for simple steps, budgets |
| Speed | Many calls take seconds to minutes | Use agents where waiting is acceptable; show progress |
| Unpredictability | The same task may take different paths | Logging, tests, evaluation on many runs |
| Security | Text the agent reads can contain instructions | Limit tools and permissions; approve risky actions |
| Judgement | Agents can be confidently wrong | Keep a person responsible for important decisions |
Common mistakes
Work out how reliable a long agent task is when every step must succeed.
per_step = 0.97 # the agent gets each step right 97% of the time steps = 15 # the task needs 15 steps, all correct # Print the chance that the whole task succeeds, as a whole-number percentage: # Task success: 12%
An agent gets each step right 95% of the time. Roughly how often will it complete a 10-step task with every step correct?
Summary
- Agents work best on tasks with clear goals, checkable results, good tools and undoable mistakes.
- Errors compound: per-step reliability multiplies over the length of a task.
- Agents also face limits of cost, speed, unpredictability, security and judgement.
- Design around them: shorter tasks, checks, budgets, limited permissions and human approval.
Next: how to give a model tools.
Finished reading? Tick it off to track your progress.