Skip to content
mentoor

Topic 3 of 5 · 5 min read

Early mistakes that cascade through agents

Goal: Identify where an early worker error propagated into the final answer and add a check that would have stopped it.

In a chain of agents, a wrong output is not an isolated error: the next agent treats it as input, repeats it and builds on it. By the end, one bad number has become a conclusion that several agents agree on.

Check yourself · 1 of 3

Three agents all report the same market figure, and it is wrong. What explains this?

Choose one answer

Why it matters

A single model can make a wrong claim. In a pipeline the wrong claim is passed on as a fact, and downstream agents rarely re-check what a colleague handed them. When two agents then agree, the answer looks confirmed, but they both read the same wrong source. Agreement between agents that share an input is not independent evidence. Anthropic notes that errors compound in long-running agent systems and that agents need to resume from checkpoints, not restart, when something breaks.

How a cascade looks

  1. A search worker returns a figure from a blog post: "market size 4.2 billion".
  2. The analyst agent uses it in a growth calculation.
  3. The writer quotes the growth result and the reviewer agent checks that the arithmetic is consistent. It is, so it passes.
  4. The report ships with a number nobody ever verified.

How to stop it

  • Carry provenance. Every claim in a handoff has a source field (URL, file:line, tool call id). A claim without one is marked unverified.
  • Check at the boundary. Validate the output of each worker before the next agent sees it: schema, ranges, and a spot check against the source.
  • Verify the load-bearing facts. Not every fact, only those the final answer depends on.
  • Keep checkpoints. Save each stage's output so you can rerun from the bad stage, not from the start.

Before and after

# Before: the analyst trusts whatever the worker returns
def analyst(state):
    return grow(state["market_size"], rate=0.07)

# After: a gate refuses unsourced or out-of-range facts
def gate(fact):
    if not fact.get("source"):
        raise Unverified(fact["name"])
    if not (1e8 <= fact["value"] <= 1e12):
        raise OutOfRange(fact["name"], fact["value"])
    return fact

def analyst(state):
    size = gate(state["market_size"])
    return grow(size["value"], rate=0.07)

What goes wrong

  • Agreement taken as proof. Two agents repeating one source is one vote.
  • Late detection. The error is found at the end, and the whole run is repeated at full cost.
  • Confidence inflation. Each retelling drops hedges such as "estimated" or "one source says".

Examples

The 4.2 billion figure

A research run reports a market of 4.2 billion. The source is a blog that meant 4.2 million. The analyst computes growth from it, the writer quotes it and the reviewer confirms the arithmetic. The run log shows the first wrong value in the search worker's output. A gate that requires a primary source for any figure used in a calculation would have flagged it.

Hedge erosion

Worker output: "One forum post suggests the library drops support in v5." Orchestrator to writer: "The library drops support in v5." Final report: "Plan your v5 migration now." The fact never got stronger. Only the wording lost its qualifier. Fix: pass a confidence and a source_count field and forbid the writer from stating a claim more strongly than its fields.

Key points

  • A downstream agent treats an upstream output as fact, so one early error spreads through the whole run.
  • Agreement between agents that share a source is not independent confirmation.
  • Carry a source with every claim, and mark claims without one as unverified.
  • Validate each worker's output at the boundary: schema, plausible range and a spot check.
  • Checkpoint each stage so you can rerun from the failed stage, not from the start.

Common mistakes

  • Counting the number of agents that agree as a measure of how likely the answer is correct.
  • Checking only the final answer and never the intermediate outputs.
  • Rerunning the whole pipeline after a failure instead of the stage that failed.
  • Letting a worker return prose with no source and no confidence.

Check yourself · 2 of 3

Which handoff field most directly lets a downstream agent decide whether to trust a claim?

Choose one answer

Check yourself · 3 of 3

A pipeline fails at stage 5 of 6 due to a wrong stage 2 output. What saves the most cost on the retry?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic