AI Agent Context Window Poisoning: How a Single Bad Retrieval Steers an Entire Session
An AI agent runs in a context window: the system prompt, the user request, the retrieved documents, the prior tool calls, and the prior model responses. The window is the model''s working memory for the session. Context window poisoning is the attack pattern where attacker-controlled content lands in the window and steers the model''s subsequent decisions. A single bad retrieval can alter the model''s behavior for the rest of the session. This article walks the attack vectors, the detection signals at the gateway, the redaction patterns that prevent the poison from reaching the model, and the audit record that supports investigation.