---
title: "Context Rot in AI Agents: Which Failure Modes Still Matter?"
url: "https://goremy.ai/blog/articles/context-rot-agents-five-failure-modes-tested"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-30T20:00:22.679Z"
updated: "2026-11-30T20:00:22.679Z"
topic: AI Agents & Automation
description: Context rot has five failure modes. In one test on three models, four no longer broke the agent. Self-trust did, until real evidence entered the context.
---

# Context Rot in AI Agents: Which Failure Modes Still Matter?

> Context rot has five failure modes. In one test on three models, four no longer broke the agent. Self-trust did, until real evidence entered the context.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-30

## What is context rot in AI agents?

Context rot is the drop in an AI agent's reliability as its context window fills with files, logs, tool definitions and its own notes. The context window is everything the model reads before choosing its next step, so it works as the agent's memory. Researchers describe five ways it goes wrong: poisoning, distraction, confusion, clash and self-conditioning. In one recent test on three models, only the last one, trusting its own earlier work, still broke the agent.

## TL;DR

- **Context rot is real but uneven.** Researchers describe five ways it goes wrong, but in one recent test on three models only self-conditioning still broke the agent.
- **Four of the five failure modes did not break the agents** in a migration test run on three models: poisoning, distraction, confusion and clash all passed.
- **Self-trust failed every time.** In 0 of 15 runs did an agent catch a bug it had already written into its own code.
- **Real evidence fixed most of it.** Adding a log from a canary deploy that showed failing requests got 10 of 15 runs to fix the bug.
- **Compaction saved money, not accuracy.** Summarizing the history cut prompt tokens per run by 23 to 59 times without changing the pass rate.
- **Treat the results as a signal, not a verdict.** It was one task with five runs per setup.

## What are the five context rot failure modes?

Picture a coding agent told to move an old codebase to a new database driver. At the top of its window sit the instructions and tool definitions. After an hour, the window is mostly a running log of file contents, test output and error messages, possibly hundreds of thousands of tokens long. The model has to decide what to pay attention to across all of it at every step. Here is how each failure shows up.

| Failure mode | What happens | Classic fix |
|---|---|---|
| Poisoning | A wrong fact gets in (say, a misread note about the driver) and the agent treats it as true | Validate before writing it down |
| Distraction | The sheer history steers the agent to repeat what it has been doing, like reading one more log | Compaction (summarize and restart) |
| Confusion | Too many tool definitions make it harder to pick the right tool | Curate tools, or let the agent search for them |
| Clash | Two notes in the window disagree, such as a wrong note and its later correction | Prune the old version |
| Self-conditioning | The agent sees its own past mistakes and becomes more likely to make new ones | Real evidence from outside the window |

A few details from the research behind these:

- **Poisoning** has happened in practice. Google reported that its Gemini agent playing Pokémon had wrong information get into its goals, and it took a long time to undo.
- **Confusion** is often illustrated with a model that failed with 46 tools and passed with 19 or 20. That result came from one query on a small 8 billion parameter model on an edge device, so it may not apply to frontier models.
- **Clash** ties to a Microsoft and Salesforce study. It found models do much worse when a request is spread across several turns, because they commit to an early wrong answer and rarely recover.
- **Self-conditioning** research found one model dropped below half accuracy within 15 turns even though it could do each step almost perfectly. A bigger model did not fix it. Turning on thinking did, in that study.

The common thread: the model treats everything in its window as true, and treats its own past actions as the most true of all.

## Do these failure modes still break modern models?

Mostly no, at least in one carefully built test. Most of these failure modes were described in 2025 using models more than a year old, so it is fair to recheck them.

The test used a small orders service that an agent had to move to a new database driver. The new driver makes only one connection attempt, so the old retry loop has to stay. Hidden tests checked that exact behavior. The agent never saw them, so it could pass every visible test and still ship the bug. That setup matters: without hidden checks, you can't tell a good migration from one that merely looks fine.

Each failure mode was injected into the agent's context, and every setup ran five times on three models. Two ran locally on DGX Spark machines and one was a Gemini Flash model through an API. With a clean context, every run passed.

Here is what happened with each failure:

- **Poisoning:** A wrong note claimed the new driver retries automatically, as if it came from an earlier, cut-off read of the docs. All 15 runs kept the retry loop and passed. In most runs the agent reread the documentation, and the docs overrode the note.
- **Clash:** The wrong note and its correction both sat in the window. All 15 runs passed.
- **Distraction:** The window was padded with the agent's own past log reads, up to about 145,000 tokens. Apart from one run where the 27 billion parameter model stopped early, every run finished and passed.
- **Confusion:** The agent got up to 100 tools, including traps like a deprecated file writer that saves to a backup folder. All three models passed every run and almost never touched the extra tools.

Compaction deserves its own note. When the model summarized its history into a short handoff note and continued, the pass rate stayed the same. Prompt tokens per run dropped by 23 to 59 times depending on the model. At these sizes, compaction was a cost saver, because there was no failure left to fix. It is still lossy, since a summary can drop the one detail that matters later.

## Why does self-trust still fail?

This test was different. The agent started with two files it had already migrated itself, and in one of them it had quietly dropped the retry loop. There was no wrong note. The only thing in the window was the agent's own earlier work.

Zero of 15 runs caught the mistake. That held across all three models. Most of the agents even reread the documentation saying the driver makes only one attempt, then still failed to compare their own code against it.

This is not the same as poisoning. With poisoning, there is a note you can check against the docs. With self-trust, the mistake lives inside work the agent already considers finished. Nothing in the window flags it, and the agent has no reason to go looking.

## How do you fix self-trust in an agent?

Give it evidence from the real world. In the follow-up run, the history included a log from a small canary deploy (a limited release to test changes) showing requests failing during a database failover. With that in the window, 10 of 15 runs went back and fixed the retry loop.

A note in the window could not do this job, because a note is just more text the agent has to believe. A log of actual failures is a different kind of information. Practical ways to supply it:

1. **Behavior tests the agent can't edit.** Hidden or locked tests that check what the code does, not what it looks like.
2. **Canary or staging logs** fed back into the agent's context after a deploy.
3. **A separate reviewer** (a person or a second agent) that reads the diff against the requirements.
4. **Explicit checkpoints** at the end of each subtask where the agent must compare its output to the source documents.

If you change only one thing, make it this. Don't rely on the agent re-reading its own work.

## What are the limits of this test?

Take the numbers carefully.

- It was **one task**, with **five runs per setup** and three models. That is a small sample.
- Failure modes can behave differently on harder tasks, longer sessions or smaller models. Distraction in particular is a bigger worry for small models.
- Pruning has a cost. Removing old context breaks prompt caching, and according to the Manus team, cached tokens can be about 10 times cheaper. So prune at clear boundaries, like the end of a subtask, not on every step.

If you want to experiment with context management directly, open-source toolkits exist. One example is CRoM, a Python toolkit that packs the highest-scoring text chunks into a token budget, reranks documents and tracks drift between responses. It is aimed at developers building retrieval pipelines.

## What does this mean for you?

**If you use AI agents at work for coding, data cleanup or document processing:** Stop worrying that a long session will quietly poison the agent with bad notes. The bigger risk is the agent confidently building on its own mistakes. Ask for proof, not confidence: test results, logs, a diff you can read. Be wary of "it's done" with no evidence attached.

**If you manage people who use agents:** Make verification part of the process. A migration or report an agent produced should come with a check that the agent did not write and cannot change.

**If you build agents:** Put your effort into feedback from the environment before you put it into bigger memory tricks. Keep tool lists sensible anyway, since it's cheap. Compact to save money, and test that compaction doesn't drop key details.

## How could you track agent work without another subscription?

If your team runs agents on real tasks, the useful artifact is a simple record: the task, what the agent claimed, what evidence backs it up (test output, canary log, reviewer sign-off), and whether it passed. You could describe that to [Remy](https://goremy.ai) as a small internal tracker with a request form, an evidence field and a reviewer approval step, and it would build and deploy it as a full-stack app with sign-in and a database. That gives you one place to see which agent outputs have been checked, instead of a spreadsheet that goes stale.

## Frequently Asked Questions

### What is context rot?

It is the decline in an AI model's reliability as its context window fills up. For agents, the window fills with tool results, logs and the agent's own notes, and any of them can push it in the wrong direction. Researchers group the failures into poisoning, distraction, confusion, clash and self-conditioning.

### Does a bigger context window solve context rot?

Not by itself. The self-conditioning research found a bigger model did not fix that problem, and in the migration test the failure that remained was self-trust. Window size sets how much fits, not how well the model uses it.

### Is compaction worth doing?

It can be, mainly for cost. In the test above, summarizing the history cut prompt tokens per run by 23 to 59 times with no change in pass rate. But summaries are lossy and pruning can break prompt caching, so do it at clear boundaries like the end of a subtask.

### How can I tell if my agent is trusting its own mistakes?

Look for agents that reread the right documentation but never compare their output to it. Then add checks that bring in outside evidence: behavior tests, canary logs or a reviewer reading the diff. In the test, adding a canary log moved the fix rate from 0 of 15 to 10 of 15.

### Does tool count still matter?

It mattered in a well-known result on a small 8 billion parameter model. In this test, three models given up to 100 tools, including trap tools, passed every run. Curating tools is still cheap and sensible, but it was not the main risk here.
