Diagnosis: Why agent projects fail
The demo works. In week one a order number, a document or an API is missing. Separate the cause before you swap the model.
In the demo the agent finds the right invoice, matches it to the order and prepares the accounting entry. In the first real week the order number is missing, a document is unreadable, the API does not respond. Take one failed run apart before you swap the model. The full argument is in the Insight Why AI agent projects fail.
Three cases in week one
Three questions, in this order. They are three different fixes.
- Were the invoice and the order in the context the agent could see? If the information was missing, you fix data access and source evidence.
- Did it read the details and still decide wrong? Tighten the task and the decision criteria, add examples, or split the step. You try another model in that same round.
- Did it stall because nobody had said what should happen next? A timeout, an unreadable document, an empty response: you write the reaction down.
A new model is a candidate only for the second case.
When the steps are fixed, a workflow is often easier to test. The model classifies the document; ordinary code handles matching and storage. An agent fits when the next step depends on the intermediate state and cannot reasonably be fixed in advance: a missing receipt, an unclear supplier, a second document that overturns the first match. Building effective agents (Anthropic) separates fixed workflows from processes the model directs. Which decision does the model have to make while the run is underway? If there is none, the extra autonomy mostly buys you more states that can go wrong.
Separate the causes
One observation, one first check, one change.
| Observation | Investigate first | Useful change |
|---|---|---|
| Invented customer agreement | Was the agreement accessible in context? | Improve data access and source evidence |
| Correct information, wrong conclusion | Were the task and decision criteria explicit? | Review examples, model or task decomposition |
| Tool call with wrong parameters | Are names, types and error messages clear? | Simplify the interface and validate inputs |
| Action executed twice | Was its status unclear after a timeout? | Check execution state and design for idempotency |
| Task runs indefinitely | Is completion objectively verifiable? | Add a stopping condition, time and call limits |
| Good result, no economic benefit | Does it remove work from the whole process? | Include handoffs and review in the cost calculation |
An API error is not a completed task. A tidy closing message is not one either. You read the destination system to see whether the accounting entry exists and the file is where it should be.
Test outcomes, not answers
For the first set, take ordinary cases, edge cases and known failures from your own process. The cases you build the agent on and the held-out set for acceptance stay apart. Otherwise you tune for tasks whose quirks you already know.
Invoice review, four counters:
- supplier and amount identified correctly
- purchase order matched
- missing evidence escalated — “do not book” can be exactly the response you want when the data is incomplete
- unnecessary escalations counted; a system that refuses everything otherwise looks clean
Run the same cases more than once. The same agent does not react the same way every time. Keep model version, configuration, tools and test data on record. Demystifying evals for AI agents separates task, trial, transcript and grading. You still set the bar for when an invoice is actually done.
A simplified calculation, and no performance promise: ten required steps, each correct 95% of the time, treated as independent. The whole run then succeeds with 0.95^10 ≈ 59.9%. Real errors are often correlated. The figure shows why a strong single answer does not carry the process. Read the handoffs from the destination system:
- Is the file there?
- Was the payment only prepared, or already sent?
- Was the order approved?
τ-bench (Yao, Shinn, Razavi, Narasimhan, 2024) scores the database state at the end. pass^k is the chance, averaged across tasks, that all k independent repeats of the same task succeed. According to the abstract, even strong function-calling agents, gpt-4o among them, succeed on under 50% of the tasks; pass^8 is under 25% in retail. That is the 2024 paper. One green demo does not replace the repeat.
SWE-bench (Jimenez et al., 2023) scores 2,294 GitHub tasks from 12 Python repositories by whether the patch passes the tests. swebench.com still lists that original set at 2,294 instances as of 10 November 2026, plus smaller subsets (Verified: 500). Solve rates are not quoted here.
Write access grows with proof
- Shadow mode. The agent writes proposals. The destination system stays untouched.
- A person approves. A narrow deployment, one task you have actually tested.
- Limited writes. Only for that task. Writes that can be repeated need a plan for the second call.
- Full automation only after the run has held up, the stop is defined, and you can undo the effect.
Stripe’s documentation describes the idempotency-key principle: retries of the same intended action should not create multiple effects. What is actually guaranteed depends on the API. On a blockchain payment, the nonce plays a partly similar protective role; the Insight When AI agents pay works that through. OWASP Excessive Agency describes the risk when permissions or autonomy outrun the task you tested.
Before you widen the deployment, three things are settled: who handles exceptions, how a bad run stops, and how you undo what it did. A pilot is useful when it shows that boundary. That includes the case where a step stays with a person.
Sources
- Building effective agents — workflows and model-directed processes; a provider perspective.
- Demystifying evals for AI agents — task, trial, transcript, grading; a provider perspective.
- τ-bench (arXiv:2406.12045, 2024) — abstract figures in the section above, as of 2024.
- SWE-bench (arXiv:2310.06770, 2023) and swebench.com — 2,294 tasks in the original set, checked 10 November 2026.
- Stripe: Idempotent requests — a specific API example, not a universal guarantee.
- OWASP: Excessive Agency — too many permissions or too much autonomy.
The diagnostic table, the three questions and 0.95^10 ≈ 59.9% are original teaching aids.
Deep dive: Why AI agent projects fail · Next chapter: Chapter 2: Cost — What an agent actually costs
Cheat sheet: formulas and go-live checklist.