The Four Failure Modes of Context: A Diagnostic Toolkit

The Four Failure Modes of Context: A Diagnostic Toolkit

The Four Failure Modes of Context: A Diagnostic Toolkit

Understanding how context fails is as important as knowing how to build it. Four distinct failure modes account for most agent misbehaviour, each with a different cause and a different fix. Memorise them; they are your debugging toolkit.

When an agent does something inexplicable, produces nonsense, fixates on a wrong idea, ignores clear instructions, the cause is usually one of four well-documented context failure modes. Practitioners have named and characterised them, and walking through the four almost always reveals the culprit. This is the diagnostic toolkit of context engineering, and it is worth committing to memory.

Context Poisoning

Context poisoning occurs when a hallucination or error enters the context and then gets repeatedly referenced, contaminating every subsequent reasoning step. The model builds confidently on a false premise. The DeepMind team documented this building a Pokemon-playing agent: the agent would occasionally hallucinate a fact, and that false fact would persist, corrupting all later decisions. The fix is validation before persistence, checking anything that gets written into lasting context before it becomes a referenced fact.

Context Engineering: The Complete Guide

Want all four failure modes with their fixes?

40 pages covering the four core strategies, the context window anatomy, all four failure modes, RAG, memory systems, multi-agent isolation, 20 production patterns and a complete 30-day mastery plan.

Get the Complete Guide →

Context Distraction

Context distraction happens when the context grows so large the model over-focuses on accumulated history and neglects what it learned in training. The Gemini 2.5 technical report documented this: as context grew past around 100K tokens, the agent favoured repeating actions from its history rather than synthesising novel plans. The history crowded out the reasoning. The fix is aggressive compression and pruning, keeping context lean so the model draws on its full capability.

Context Confusion

Context confusion occurs when superfluous content influences the response, nudging the model toward decisions it would not otherwise make. Models feel compelled to use the information available to them; include irrelevant tool definitions or marginally related documents, and the model may use them inappropriately simply because they are there. The fix is the select strategy: include only genuinely relevant information, removing the raw material confusion feeds on.

Context Clash

Context clash arises when different parts of the context contradict each other. The model picks one, and you do not get to predict which. This happens easily when context is assembled from diverse sources: documents that disagree, tool descriptions that conflict with the system prompt, or connected third-party tools whose instructions clash with the rest. The fix is isolation and reconciliation: keep conflicting sources apart and resolve contradictions deliberately rather than letting them collide.

The Diagnostic Habit

When an agent misbehaves, run through the four in order. Is there a hallucinated fact being referenced (poisoning)? Is the context huge and the agent repeating itself (distraction)? Is there irrelevant content it is latching onto (confusion)? Are there contradictions (clash)? One of the four is almost always the cause, and each points to a specific fix. This systematic diagnosis beats guessing, and it turns mysterious agent failures into solvable engineering problems.

Ready to engineer context deliberately?

Context Engineering: The Complete Guide covers everything: the anatomy of a context window, the four core strategies (Write, Select, Compress, Isolate), RAG and memory systems, multi-agent isolation, the four failure modes and how to diagnose them, what the research says about formats, 20 production patterns, 12 common pitfalls, and a 30-day plan that takes you from the concepts to real production systems.

Get the Complete Guide →

Instant PDF download · 40 pages · Current as of 2026