In a three-agent pipeline (Agent 1: parse requirements, Agent 2: generate code, Agent 3: write tests), Agent 1 returns a malformed requirements object due to an upstream data issue. Agent 2 uses this data to generate code, and Agent 3 writes tests for the broken code. All three agents report success. The team later finds the entire output is unusable. What pattern would have contained this cascading failure?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Passing bad data between agents without checking it first is like handing a typo-filled blueprint to a builder who passes it to an inspector — everyone does their job faithfully and the building is still wrong. Output validation gates at each handoff catch bad data before it propagates, stopping the cascade at the first agent that produces garbage instead of letting it corrupt all downstream output.
Full explanation below image
Full Explanation
Cascading failures in multi-agent pipelines occur when bad output from one agent flows unchecked into the next, which processes it and produces its own corrupted output, and so on. Each agent reports success because it successfully processed whatever input it received — but the input was invalid.
The solution is output validation at each handoff: before Agent 2 consumes Agent 1's output, the orchestrator (or Agent 2 itself) validates that the output conforms to the expected schema, contains required fields with valid values, and meets quality thresholds. If validation fails, the pipeline halts immediately and alerts the operator rather than continuing with bad data. This turns a cascading failure that wastes all downstream compute into an early stop that preserves resources and makes the failure obvious.
Option A (parallel execution) doesn't help here — all three agents consume data from Agent 1, which is the corrupted source. Running them in parallel means all three fail simultaneously instead of sequentially, but the total failure is the same.
Option C (single monolithic agent) might catch some inter-step data issues through tighter coupling, but eliminates the modularity, testability, and specialization benefits of a multi-agent design. It also does not guarantee that an internal data corruption within the monolithic agent would be caught.
Option D (Agent 3 validates Agent 1) is a partial fix — it catches the problem at the last stage but after Agent 2 has already consumed the bad data and generated broken code. Validation at the first handoff (before Agent 2 consumes Agent 1's output) catches the problem earlier and saves Agent 2's compute entirely.
Validation at every handoff, not just the final stage, is the complete solution.