Getting Your First Agent Live

The Compounding Error Math: Why Agents Work in Demos but Fail After 10 Steps (And the Architecture to Fix It)

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor
6 min read
Abstract illustration: The Compounding Error Math: Why Agents Work in Demos but Fail After 10 Steps (And the Architecture to Fix It)

What this article gives you

You will leave with the exact math behind agent failure rates, a clear account of why demos hide that math, and a concrete checkpoint architecture you can apply to any workflow longer than three steps. The failure mode is not random; it is predictable, and that means it is fixable.

The arithmetic that demo conditions hide

Take a single agent step with a 95% success rate. That sounds reliable. Run ten of those steps in sequence and the end-to-end success rate is 0.95 to the power of ten, which is approximately 60%. At twenty steps it falls to 36%. Research published in mid-2026 puts those figures plainly: a 95% per-step accuracy delivers only 60% end-to-end success at 10 steps and 36% at 20 steps.

Demo workflows avoid this by design, not by accident. A demo runs four or five steps on a pre-selected input that the agent handles well. The failure distribution is not uniform across inputs; agents fail more often on edge cases, ambiguous instructions, and tool responses that differ slightly from training examples. Demos filter those out. Production does not.

The second problem is that failures in multi-step agents are rarely loud. A step can produce output that is subtly wrong, structurally valid but semantically off, and the next step accepts it and continues. By step fifteen, the workflow has built a coherent-looking result on a corrupted foundation. Your agent observability tooling may not surface this for hours if it is only watching for exceptions rather than output quality.

This partly explains why only 12% of agent initiatives successfully reach production at scale, despite 97% of executives reporting they have deployed AI agents over the past year. The gap is not ambition; it is architecture.

Why stateless chaining fails at scale

The default pattern in most agentic AI frameworks is stateless chaining: step one runs, its output becomes the input to step two, and so on. If step seven fails, the orchestrator has two options: retry from the beginning or surface an error. Both are costly. Retry from the beginning wastes the successful work of steps one through six and re-runs every LLM call. Surfacing an error leaves the workflow incomplete.

Stateless chains also make silent degradation invisible. There is no record of what step four produced, so you cannot compare it against an expected schema or a prior successful run. You only discover the problem when a human reviews the final output, or when a downstream system rejects it.

flowchart TD
    A[Step 1] --> B[Step 2]
    B --> C[Step 3]
    C --> D[Step 4]
    D --> E[Step 5 fails silently]
    E --> F[Step 6 consumes bad output]
    F --> G[Step 7 - final output corrupted]
    G --> H[Human review catches error hours later]

Checkpoint architecture: the non-optional layer

A checkpoint is a persisted state snapshot written after each step completes and passes verification. If a later step fails, the orchestrator rewinds to the last good checkpoint and resumes from there rather than from the beginning. This requires three things: a state store, a verification gate at each step, and a deterministic resume path.

The verification gate is the part most teams skip. Writing state after every step without checking that state is still stateless chaining with extra storage. The gate needs to confirm that the step output matches an expected schema, falls within acceptable value ranges, or passes a lightweight secondary check before the checkpoint is written and the workflow advances.

flowchart TD
    A[Step N runs] --> B{Verification gate}
    B -->|Pass| C[Write checkpoint]
    C --> D[Step N+1 runs]
    B -->|Fail| E[Log failure with context]
    E --> F{Retry policy}
    F -->|Within retry limit| A
    F -->|Limit exceeded| G[Alert and halt]
    D --> H{Verification gate}
    H -->|Pass| I[Write checkpoint]
    H -->|Fail| E

For AI agents workflow teams building on existing frameworks, the state store is often a lightweight key-value system or a purpose-built workflow database. Some orchestration layers offer this natively; others require you to wire it in. Tools like Prefactor sit in this category, providing checkpoint and recovery infrastructure for production agent workflows. Whatever you use, the requirement is the same: writes must be atomic, reads must be idempotent, and the resume path must not re-execute already-checkpointed steps.

Verification patterns that catch failures before they propagate

Three patterns account for most of what production teams use.

Schema assertion checks that the step output matches a defined structure before writing the checkpoint. If step three is supposed to return a JSON object with a numeric confidence field between 0 and 1, assert that before continuing. This catches the most common failure mode: structurally valid but semantically wrong output.

Cross-step consistency checks compare the output of step N against the output of step N-2 or against a known reference. This is useful in workflows where intermediate steps should preserve certain properties, for example, a document processing agent where the word count of the extracted text should not drop below 80% of the source.

Lightweight secondary verification uses a smaller, faster model to score the primary output before checkpointing it. This adds latency, but for high-stakes steps in financial services or healthcare workflows, the cost is justified.

What production deployments show

JPMorgan Chase runs more than 450 agentic AI use cases in production daily, with autonomous agents operating continuously for one to two hours across enterprise workflows. Workflows of that duration and complexity cannot be managed with stateless chaining. The institution has implemented account-level governance guardrails, which function as a form of bounded execution: the agent operates within defined parameters and surfaces for review when it approaches a boundary.

Klarna’s deployment tells the other side of the story. The company deployed an OpenAI-powered customer service agent handling 150 million users across 23 markets, saving $60 million and handling the workload of 853 full-time employees by Q3 2025. It later pivoted to a hybrid model after discovering that the agent hallucinated on complex escalations. The fix was not a better model; it was a routing layer that detected when a query exceeded the agent’s reliable operating envelope and handed off to a human. That is a verification gate applied at the workflow level rather than the step level, but the principle is the same.

Morgan Stanley’s DevGen.AI agent reviewed 9 million lines of legacy code and saved 280,000 developer hours. A code review workflow of that scale runs hundreds of sequential decisions per file. The teams that ship reliably at this scale treat agent evaluation as a continuous process, not a pre-launch gate.

For teams thinking about agentic AI design patterns more broadly, the checkpoint pattern is one of a small number that separate agents that scale from agents that stall. The others, including retry budgets, tool call isolation, and context window management, are covered in the agentic AI architecture guide.

If you are deciding between frameworks, the LangGraph vs CrewAI comparison covers which ones expose checkpoint and state management primitives natively versus which require you to build that layer yourself.

Where to start

Before you invest in checkpoint infrastructure, confirm that your workflow’s failure rate is actually a compounding problem rather than a single-step bottleneck. Run the agent readiness assessment to get a structured view of where your workflows sit on the reliability curve and what architectural changes will move the needle fastest.

Matt Doughty Matt Doughty CEO & Co-Founder, Prefactor

Founder of Prefactor, writing on the operational reality of getting AI agents into production — evaluation, observability, governance, and the plumbing assistants never needed.

Frequently asked questions

Why does a 95% accurate agent still fail so often in production?

Each step multiplies the failure probability of every step before it. At 95% per-step accuracy, a 10-step workflow succeeds only about 60% of the time because you are compounding 0.95 ten times, not adding accuracies together.

What is a checkpoint in an agent workflow and what does it store?

A checkpoint is a persisted snapshot of agent state taken after a step completes successfully. It stores the outputs of that step, the current context window, any tool call results, and metadata needed to resume from that exact position if a later step fails.

How do I know whether my workflow is long enough to need checkpoint architecture?

If your workflow has more than three sequential steps where each step consumes the output of the previous one, the compounding math already puts you below 86% end-to-end reliability at 95% per-step accuracy. Checkpoint architecture is worth the overhead at that point.

Does adding verification steps make the workflow slower?

Yes, by the cost of one additional LLM call or a deterministic assertion per step. In practice, teams find that catching a bad output at step four costs far less than replaying a 20-step workflow from the beginning, or worse, allowing a degraded output to propagate silently for hours.

Stay ahead of the curve

No spam. Unsubscribe anytime. A resource by Prefactor.

Almost there — check your inbox to confirm your subscription.