An AI agent is a program that uses a model to choose the next step, call a tool, read the result, and keep going until a goal is met or a limit is hit. A chatbot returns an answer. An agent moves work forward. The difference is not how smart the model is — it is how many decisions the model is allowed to make on its own.
Table of Contents
Most guides stop at that definition. The more useful questions come next: what happens when twelve mostly-correct steps are chained together, what a run actually costs, and how to notice failure before a customer does.
The 0.9512 trap
A single agent step that is 95% correct sounds good. Twelve of them in a row are not.
0.95 × 0.95 × … twelve times = 0.54
A twelve-step agent with 95%-correct steps finishes the job correctly about 54% of the time. The other 46% of runs end in a wrong answer, a stalled loop, or a quiet handoff to nobody.
| Steps in one run | 95% per step | 99% per step |
|---|---|---|
| 5 | 77% | 95% |
| 12 | 54% | 89% |
| 20 | 36% | 82% |
This is why an agent can feel magical in a demo and disappointing in week three. Demos use short paths. Real work uses long ones. Reliability is multiplied, not averaged.
Raising step quality from 95% to 99% changes a twelve-step run from 54% to 89%. That is a bigger win than most prompt rewrites.
So what counts as an agent, really
Three conditions must all be true. If one is missing, the label is being used loosely.
- A goal instead of a single request. “Find three suppliers and draft outreach” is a goal. “Explain suppliers” is a request.
- A loop. Observe → decide → act → observe again. One model call is not a loop.
- A stop rule. Success, failure, a budget cap, or a human handoff. Without one, there is no edge.
A model with a search button is a tool-using chatbot. A scheduled script with a template is a workflow. Both are useful. The line blurs in real products, so the AI agents in the workplace breakdown keeps the distinction grounded in day-to-day tasks before any code gets written.
Four parts, one loop
Every agent has four working parts:
- Model — decides the next action from the current state.
- Tools — read or change something outside the model.
- Memory — carries facts and outcomes between steps.
- Stop logic — decides when enough is enough.
The stop rule breaks agents more often than the model does. Teams spend weeks on model choice and minutes on the rule that ends the run.
Memory deserves one extra line. “Memory” means three different things — the current run, past traces, and stored facts. Stale stored facts are worse than no facts, because they arrive with confidence attached. Date-stamp every retrieved fact, and let the agent check freshness before trusting it. The same stale-evidence problem is unpacked in why RAG systems still hallucinate.
The cost math most guides leave out
One agent run is many model calls. A useful approximation:
run cost ≈ steps × (input tokens + output tokens) ÷ 1,000 × price + tool fees
Worked example, using a mid-tier model at $2 per million input tokens and $8 per million output tokens:
- 12 steps per run
- 6,000 input tokens per step → 72,000 tokens → $0.144
- 800 output tokens per step → 9,600 tokens → $0.077
- Tool and API fees → $0.020
- Run cost: about $0.24
At 5,000 runs a month, that is roughly $1,200. A fixed workflow doing the same predictable task might cost $0.004 a run, or about $20 a month. This is the run-level version of the broader AI cloud cost problem that finance teams are suddenly having to forecast.
But the sharper number is this:
True cost per win = run cost ÷ run success rate
At $0.24 per run and 54% success, the true cost per completed task is about $0.44. At 89% success, it drops to about $0.27 — same model, same price, better steps. That single metric explains more budget surprises than token pricing does.
Cheaper models are not always cheaper agents. A weaker model often needs more steps, and steps multiply twice — once in cost, once in failure risk.
Seven quiet failures that look like success
Loud crashes are easy to catch. These are the ones that pass a demo and fail in week three.
| Quiet failure | Signal to watch | Cheap fix |
|---|---|---|
| Loop drift | Same tool called three times | Step cap plus a state checkpoint |
| Compounding drift | Polished answer, wrong middle step | Check the trajectory, not only the output |
| Stale memory | Correct answer for old data | Date-stamp every retrieved fact |
| Confident wrong tool | Plausible text, wrong API call | Tool allowlist plus schema validation |
| Approval fatigue | Approvals clicked in under two seconds | Diff view plus batched approvals |
| Budget bleed | One run consumes the monthly cap | Per-run cap and a kill switch |
| Handoff loss | Human restarts from scratch | Resume packet on every escalation |
Approval fatigue is the sleeper problem. When a human sees ten approval popups a day, approval becomes a reflex. A different view and two careful approvals beat ten careless ones.
The resume packet
An agent that escalates well is worth more than an agent that never escalates. Every handoff should carry six fields:
- Goal — the original request, restated.
- Steps taken — short list, not a raw log.
- Evidence IDs — ticket, order, document, or trace references.
- What failed — the exact tool or rule that stopped progress.
- Suggested next action — one line, written for a human reader.
- Budget left — steps and spend remaining.
This turns a failed run into a five-second fix. Without it, the human repeats work the agent already finished — which is the hidden cost most ROI sheets ignore. The escalation half of this story, including where handoffs break, is covered in AI chatbots in customer service.
Three kill tests before building
This section saves the most money, and it is the one most guides skip.
The path test. Can every step be drawn before the run starts? Then build a workflow. Unknown paths justify agents; known paths do not.
The reversibility test. Can the action be undone in one click? If not, keep approval in place and limit the tool set.
The regret test. Would one wrong action cost more than the hours saved in a year? If yes, the permission model is not ready, whatever the demo looks like.
When all three pass, build the boring version: one agent, three tools, a written stop rule, and traces from day one. Narrow and measurable usually beats clever and broad.
Write the role before the prompt
A page-sized role document beats a long system prompt. Something like this:
Role: Support Triage Agent
Goal: Tag and route tickets to the right team with the right priority.
Inputs: Ticket text, order status, past similar tickets.
Allowed tools: Read ticket, read order, write tag. Refund tool excluded.
Budget: 12 steps, $0.30, 2 retries.
Stop on: Confidence below 0.7, refund request, angry tone.
Escalate with: Ticket ID, evidence, suggested next action.
Success metric: Correct-tag rate — not percent of runs completed.
Notice the success metric. “Runs completed” rewards wandering. “Resolved correctly” rewards judgment.
Grade the trace, not just the answer
Output-only grading hides wandering and over-spending. Seven checks catch both:
- Did the first tool call match the stated intent?
- Did state actually change between steps?
- Was the stop condition hit for the right reason?
- Did escalation include the resume packet?
- Cost per win versus the old baseline
- Recovery rate after a tool error
- Human edit distance on the final output
Seven checks, one spreadsheet, no special platform needed.
Frequently asked questions
Is a 95%-accurate agent good enough?
Not for the long run. Twelve steps at 95% each complete correctly about 54% of the time. Short paths are forgiving; long ones are not.
What is the true cost per successful task?
Run cost divided by run success rate. A $0.24 run that succeeds 54% of the time costs about $0.44 per completed task. Token price alone hides this.
Does a better model fix a bad agent?
Sometimes, but not always. Raising step quality from 95% to 99% helps a lot. Clear tool schemas, step caps, and a written stop rule usually help more per unit of effort.
When should a workflow beat an agent?
When you can draw the steps in advance, agents earn their cost only when the path must be chosen at runtime.
Can an agent be trusted with refunds or payments?
With scoped tools, low limits, and approval on the write action — yes. With blanket access and no stop rule — no. Reversibility is the deciding factor.
The useful shift is not from chat to agent. It is from clever demos to narrow roles with a written budget, a written stop rule, and a trace a human can read in under a minute.





