AP26 · Context poisoning
Family: Context and memory
Moderate evidence
Original names: context poisoning, session context contamination
A mistake written into the context becomes a fact, which the agent rereads and reinforces at every turn.
Definition
A hallucination or a false piece of data gets into the agent’s goal, summary or notes, and is then carried forward as truth. In its malicious form, an adversary plants it on purpose early in the session.
Observable symptoms
- The agent keeps pursuing an impossible or irrelevant goal.
- The same false statement comes back from one summary to the next.
- Absurd actions repeat in an attempt to reach a state that does not exist.
- Behaviour returns to normal after a restart on a clean context.
Why it hurts
The context serves as both memory and ground truth: nothing in it tells a checked fact from a guess. Every compaction copies the mistake into the next summary, and the more errors the history holds, the more the model makes.
Figures
- In the Gemini 2.5 technical report, the Pokémon-playing agent has its goals and summary “poisoned” by false information about the game state, which takes a very long time to undo; it then fixates on impossible goals. The report presents these observations as anecdotal.
- The more errors are injected into the history, the worse accuracy gets at turn 100, and this is not just an effect of length (ICLR 2026).
- Microsoft’s taxonomy (version 2.0, June 2026) adds a failure mode in which an adversary introduces data early in the session that biases the reasoning of later steps.
Remedies from the catalogue
- D1 · Compaction — Compaction checks the summary before feeding it back: a claim that no tool trace confirms does not get in.
- D2 · Structured notes and recited plan — Structured notes, in JSON rather than free text, where every fact carries its source and can be checked.
- D5 · Context-isolation subagent — Risky explorations run in a disposable subagent: a mistake stays contained there.
- B5 · Generator-evaluator — An evaluator checks facts against the real state before they enter the goal or the notes.
Measures outside the catalogue
- Restart from a clean context, with the request restated, when the agent fixates on an impossible goal.
Misused patterns
Related anti-patterns
Sources
- Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilities — Gemini Team, Google, 2025
- The Illusion of Diminishing Returns — Sinha, Arun, Goel, Staab et Geiping, ICLR 2026, 2025-09
- Updating the taxonomy of failure modes in agentic AI systems: what a year of What a year of red teaming taught us — Microsoft AI Red Team, 2026-06-04
- How Long Contexts Fail — Drew Breunig, 2025-06-22
Content reviewed on 2026-10-05