You've seen it even if you didn't have a name for it. An agent starts sharp — it understands the task, takes the first few steps cleanly — and then, somewhere around step six, it starts making decisions that have less and less to do with what you actually asked. It contradicts something it decided earlier. It "forgets" a constraint you gave it at the start. By the end it's confidently solving a problem that isn't yours.
That drift has a cause, and it isn't that the model "got dumber." It's Context Bleed.
What Context Bleed actually is
An agent's context window is its working memory — everything it can see while it decides the next move. At the start, that memory is clean: your goal, your constraints, the relevant inputs.
But an agent doesn't just read its context. It writes to it. Every step, it appends its own reasoning, its tool calls, the outputs it got back, the dead-ends it explored. Step by step, the context fills up — not with your task, but with the agent's own running monologue, mistakes included.
Context Bleed is what happens when that accumulated self-output starts to outweigh the original goal. The agent stops reasoning about your task and starts reasoning about its own recent history. Its working memory has quietly turned into a transcript of its own confusion — and it trusts that transcript completely.
Why it happens
Three things compound here.
Recency wins. Models weight recent context heavily. After twenty steps, your original instruction is ancient history buried at the top, while the agent's last few (self-generated, possibly wrong) thoughts sit front and center. The thing it's most influenced by is the thing it just said.
Early mistakes become facts. If the agent makes a wrong assumption at step three and writes it into the context, that assumption is now part of the record. At step ten it doesn't re-examine it — it treats it as established truth. One bad turn doesn't get corrected; it gets cited.
The goal gets diluted. Your actual instruction is a shrinking fraction of a context that's now mostly the agent's own output. Signal-to-noise drops with every step. The longer the run, the quieter your goal gets.
Put together: the agent drifts because the loudest voice in its memory is its own — and that voice has been wrong at least once.
Why it's hard to catch
Context Bleed doesn't announce itself. No error, no crash. Each individual step looks locally reasonable — it follows from the step before it. The drift only shows up in aggregate, when you compare where the agent ended up against where you pointed it.
That's what makes it dangerous in production. It's one of the quieter ways agents fail after they leave the demo: your monitoring says everything ran, every step "succeeded," and the output is subtly, confidently wrong.
How to spot it
A few tells:
- The agent repeats itself or loops on something it already resolved.
- It contradicts a decision it made earlier in the same run.
- It forgets constraints you set at the start — the budget, the format, the thing it was told not to do.
- Quality degrades with length — short tasks are fine, long ones fall apart.
- Its choices track its recent output more than your original goal.
If your agent is great in a three-step demo and unreliable in a fifteen-step job, Context Bleed is a prime suspect.
How to stop it
The fix isn't a bigger context window — that just delays the bleed. The fix is treating memory as something you manage, not something you let pile up.
Separate the task state from the chat log. Keep a clean, structured record of what the goal is and what's actually been accomplished, distinct from the raw running transcript. The agent should reason from the state, not from the pile.
Rebuild context from verified state, not raw history. Instead of feeding the agent everything it has ever said, reconstruct its working context each step from a canonical, checked record. What's confirmed goes in; the noise stays out.
Re-inject the goal. Don't let the original instruction get buried. Surface it again at each step, so the most important thing isn't also the oldest thing.
Treat the agent's own output as a draft, not a fact. Prior steps are proposals to be verified, not truths to be trusted. An early mistake shouldn't get to become canon just because it was written down.
Checkpoint and reset. Every few steps, restart from a known-good state. A clean reset every five steps beats a context that's been quietly rotting for fifty.
Most of these come down to one principle: the agent's memory should be a curated record of what's true, not an unfiltered log of everything it said.
Where this fits
Context Bleed is one specific failure inside the broader problem of memory and context governance — and one worth checking explicitly before you ship. The MIMIR AI Systems Audit Checklist scores your system on exactly this: whether your context is rebuilt from verified state, whether prior outputs are treated as untrusted, whether your memory layers are actually separated. €15, run it before your next deploy.
An agent that drifts isn't broken. It's just remembering the wrong things. Fix what it remembers, and the drift goes with it.