Context Window Hijacking: Definition, Vectors, Controls
AI Agent Security

Context Window Hijacking: Definition, Vectors, and Runtime Controls

Context window hijacking is the manipulation of content an AI agent ingests into its active context, whether through tool outputs, retrieved documents, inter-agent messages, or persistent memory, in order to alter the agent's reasoning or actions without direct user input. It extends the documented risk of indirect prompt injection to the full set of context sources present in agentic architectures, and is best addressed through content provenance tracking, context segmentation, and runtime policy enforcement rather than input filtering alone.

Where Context Hijacking Occurs

A quick reference to the four context sources an agent may trust by default, and what can be manipulated within each.

VectorWhat enters the agent's context
Tool outputsReturned API or tool data, ingested as trusted context by default
Retrieved documentsRAG pipeline content pulled into the model's working context at query time
Inter-agent messagesContent passed between agents in multi-agent orchestration patterns
Persistent memoryState or conversation history retained and reused across sessions

What Context Window Hijacking Means in Agentic Systems

Context window hijacking refers to the manipulation of content an AI agent ing