Donnell Vaughn
Five industrial steel and glass components in sequence: pristine on the left, each progressively fracturing, the fifth completely shattered. A physical rendering of compound error across sequential steps.

March 20, 2026 · AI agents · agentic workflows · AI architecture

An AI workflow can return a plausible wrong answer and pass it to the next step. Check each handoff, define what happens when a check fails, and save enough progress to recover.

How to Build an AI Agent That Actually Works

The Math That Kills Most AI Agents

A step can look right while the whole job is wrong. Test the final result against the goal, and check the handoffs that produced it.

This is the Compound Error Principle. Every sequential step multiplies failure probability. You cannot prompt your way out of multiplicative decay.

Where Multi-Agent Systems Fail

Check the system around the model as well as the model.

In “Why Do Multi-Agent LLM Systems Fail?” (Cemri and colleagues, NeurIPS 2025), the researchers identify 14 failure modes across system design, coordination between agents, and verification. The study gives builders a way to inspect the system around the model. It does not establish that model quality is irrelevant.

If step three accepts a wrong result from step two, the error can carry through the rest of the job. I check those handoffs and define what happens when a check fails.

The Four Architectural Decisions That Interrupt the Math

The agents that work in production share four structural patterns. None of them are about choosing a better model.

Modular workflow design. Give each step one task, a clear input and a checkable output. Check the result before the next step uses it.

In practice: each piece of the system does one job and hands off a clean result. When something breaks, you know exactly which piece failed. Not just "the agent failed somewhere."

One job. One handoff. That's the unit.

Exception mapping before deployment. AI agents fail silently. They don't throw errors. They produce plausible-looking outputs that are wrong. Map every failure mode you can anticipate before the system goes live.

Write down the failures you can anticipate before deployment. Decide what the system should do when information is missing, a tool returns an unexpected result or a request falls outside its rules.

Silent failures are the expensive ones.

Validation gates between steps. Check each result before the next step uses it. In “The Hidden Cost of Agentic Failure” (O’Reilly Radar, February 23, 2026), Nicole Koenigstein gives a simplified calculation: ten independent steps at 98% success each yield about 81.7% success overall. If checks catch 90% of errors and those errors are successfully corrected, the modeled success rate rises to about 98.0%. These are assumed rates, not measured results from my builds.

Gates don't slow the system. They stop the compounding.

Recovery from saved progress. Save progress at defined checkpoints. When a step fails, check the saved state before resuming. A saved result still needs to be validated.

Think of it as saving your game after every level. If something breaks at step 7, the agent rolls back to step 6. Not back to the beginning. The output that looks correct but isn't is more dangerous than the error that throws an exception. Recovery architecture has to catch both.

No checkpoint, no recovery.

When You Shouldn't Build an Agent at All

Not every problem needs an agent. Sometimes a fixed workflow with a model handling one step is enough.

Use fixed rules when they can do the whole job. If a step needs to interpret an email or document, use a model for that step and check its output. Use an agent when the next action depends on what it finds.

Anthropic’s “Building effective agents” (December 19, 2024) recommends starting with the simplest solution and adding complexity when needed.

Build an agent when the end goal is clear but the path is dynamic and unpredictable. When individual steps require interpreting unstructured data. When the decision tree can't be fully drawn in advance. And when you build it, build it with the four architectural controls. Not as an autonomous system running blind.

Choosing the Right Architecture for Your Team

The question isn't "what tools should I use." It's "what level of autonomy does this task actually require." Three layers, and most teams should start at the first one.

Layer 1: Orchestrated AI Workflow. The overall execution sequence is fixed, but individual steps need to interpret unstructured data: PDFs, emails, forms. You can draw the full process as a flowchart. Some nodes just need AI to read the input. Architecture: a structured workflow platform where the AI is called as a stateless node for specific transformation tasks. Validation gate at each handoff. Human approval channel for anything irreversible. This isn't a true agent. For most SMB use cases, it doesn't need to be.

Layer 2: Lightweight Agentic Deployment. The goal is defined, but the agent needs to make routing decisions between steps. The path is partially dynamic. Define the tools the agent may use, the state it must retain and the actions that require approval. Human-in-the-loop gate on any action that can't be undone.

Layer 3: Full Agentic System. The end goal is clear but the execution path is genuinely unknown until the task is underway. Dynamic, unpredictable, can't be flowcharted. Save progress, define failure handling and check outputs before dependent steps continue. Exception mapping pre-built. Validation gates schema-enforced. Error recovery architecture in place before launch, not after.

The rule governing all three layers: the model is never the controller. The architecture controls the workflow. The model executes specific steps within it. That's the line between a production agent and a demo that worked once.

Start with a task you can explain clearly, with examples of acceptable results and cases that need a person. If you cannot define those boundaries, clarify the task before automating it.

The architecture isn't complicated. The discipline to build it before you need it is the part most people skip. And that's where the compounding starts.

Frequently Asked Questions

Why do most AI agents fail in production?

Failures can come from incorrect instructions, bad handoffs or checks that miss a wrong answer. Trace where the error entered and where it should have been caught. Test that boundary before changing the model.

What are validation gates in AI agent architecture?

A validation gate checks a result against defined requirements before the workflow continues. If the check fails, stop, retry or ask a person. Catching an error prevents it from passing unchecked; completing the job still requires a correct result.

When should you use an AI agent versus a simple script?

Use a script when fixed rules can do the whole job. Use a fixed workflow with model calls when particular steps need interpretation. Consider an agent when it must choose its next action from what it finds. Start with the simplest design that passes your checks.

How much does it cost to build an AI agent for a small business?

Ask for a scoped build price and an estimate of ongoing costs. Include model use, hosting, integrations and the time someone will spend reviewing outputs and handling exceptions. Price and maintenance depend on the work the system must do.