Skip to content
AdminKit

Context window

What is Context window?

A model's context window is the maximum number of tokens -- prompt, instructions, tool output and the model's own reply -- it can process in one request, a limit each vendor sets for its own models. AdminKit's guide to securing an MCP server treats anything an agent reads into that window, including tool output, as untrusted by default.

By AdminKit team, Netbase JSC · Updated

A model’s context window is the maximum number of tokens — the prompt, any system instructions, tool definitions, retrieved content and the model’s own output — it can process in a single request, a limit set per model by its own vendor rather than by any shared industry specification — Anthropic and OpenAI both publish the figure per model rather than following one standard. Everything an AI agent feeds into a request has to fit inside this budget together, which means a tool response, a retrieved document or an MCP resource competes for the same space as the user’s own instructions. This matters for security as well as capacity: text embedded in a long tool response or fetched document sits in the same context window as trusted instructions, with nothing in the window itself distinguishing the two, which is exactly the gap prompt-injection defenses have to close outside the model — OWASP ranks prompt injection as LLM01, the first entry in its Top 10 for LLM applications. A server’s resource list is one common source of that competing content, since a client reads a resource’s data by URI and feeds it into the same context window a tool response would occupy.

Context window is part of AdminKit’s AI agents & MCP cluster; the full AdminKit glossary lists other related terms.

Frequently asked questions

What counts toward a model's context window?

Everything in a single request counts together -- the prompt, system instructions, tool definitions and output, retrieved content, and the model's own reply all share the same token budget.

Is context window size standardized across vendors?

No -- each vendor sets its own context window per model rather than following a shared industry specification; Anthropic and OpenAI both publish the figure per model.

Why does context window size matter for agent security?

Because text embedded in a tool response or fetched document sits in the same window as trusted instructions, with nothing in the window itself distinguishing the two -- the gap prompt-injection defenses have to close outside the model.

Does a larger context window remove the need to treat tool output as untrusted?

No -- regardless of size, content an agent reads in from a tool call or MCP resource should still be treated as untrusted by default, since the model can't tell it apart from a system instruction once it's inside the window.