Context poisoning
Definition
When a wrong fact, hallucination or bad tool result enters an agent's context and keeps steering later steps in the wrong direction.
In more detail
Models treat what is in their context as true. Once an error gets in, for example a misread file, a made-up API or an incorrect summary written during compaction, the agent builds on it and may repeat it in memory or notes, where it survives into later sessions.
Prompt injection is the deliberate version, but most poisoning is accidental. Defences include verifying claims against the source before acting, keeping tool outputs short and specific, starting a fresh session when an agent goes in circles, and reviewing what gets written to long-term memory.
Related terms
Compaction
Summarising earlier parts of a long conversation and replacing them with the summary to free context space for the work still to do.
Context rot
The gradual decline in a model's accuracy and instruction-following as its context fills up with long, stale or irrelevant content.
Hallucination
A fluent, confident model output that is false or not supported by its sources, such as an invented citation, quote or API call.
Prompt injection
Input that overrides or subverts a model's instructions, either typed in directly or hidden in content the model reads while it works.
Data poisoning
Tampering with the data used to train a model or build its retrieval index, so that it learns false, biased or hidden behaviour.
Read more about Context poisoning
- What is context engineering?
Context engineering is deciding what a model sees at each step. Why the term replaced prompt engineering for people building agents, and what the work involves.
- Context engineering techniques: what the model should see
What to put in a model's context at each step, what to leave out, and how instruction files, retrieval and tools fit.
- Context engineering
Deciding what instructions, documents, tools and history a model sees at each step.