Skip to content
Finic
AI and agents

What is a context window?

A context window is the maximum amount of text, measured in tokens, that a language model can take in and consider at once, including the prompt, any attached data and its own reply.

Also called: context length, context size

How it works

Every request to a model has a budget of tokens. The system instructions, the conversation so far, any retrieved documents and the model's answer all share that budget. If the total is too large, the oldest or least important content must be cut or the request fails.

Larger windows let a model work with longer documents in one pass. But a big window does not guarantee the model uses all of it well. Details in the middle of a long input can get less attention than details at the start or end.

Why it matters for risk work

Fraud and compliance cases are often long: transaction histories, account notes, emails and documents. Teams must decide what goes into the window. Putting in too little can hide key facts; putting in too much adds cost and noise.

A common approach is to store case data outside the model and pull in only the relevant parts with retrieval-augmented generation. Summaries of older events can also keep long histories in view without filling the window.

Security points

Everything in the window can influence the model. If an agent reads a web page, email or file that contains hidden instructions, those instructions sit in the same window as your own. This is the root of prompt injection, and it is why untrusted content should be clearly separated and treated with care.

Example

A hypothetical analyst asks a model to review a merchant's last year of activity. The raw data is far too large for the window, so the tool first groups transactions by week, flags outliers and passes only those summaries and flagged rows to the model.

← All glossary terms

Ship fraud, bot and KYB checks in minutes.

Start with $5 of free credit, or copy a prompt and let your coding agent set Finic up.

Sign up See pricing