Context Window Budgets for AI Agents: What to Load in Each Call
A context window budget sets which memory, tool results and policies enter each model call. Use this method to keep AI agents accurate as tasks grow.

A context window budget is the limit you set on what an agent may place into each model call: which instructions, memory entries, tool results, policy text and task state enter the prompt, in what order, and what stays out. For most business agents, the working rule is to load only what the next decision needs, keep everything else retrievable on demand, and check accuracy at each budget size before the task grows. The budget is a design decision that people make and review, not a setting the model manages for itself.
Key takeaways
- Treat the context window as a budget you allocate for each call, not as storage for everything the agent has seen.
- Load the role, the task state and the fields that decide the next step first, and load everything else by rule.
- Keep the always-on policy short, and load detailed procedures only when their scope matches the task.
- Reduce tool results to the fields a decision depends on, and keep the raw output in logs for replay.
- Compare accuracy at two budget sizes before you widen what enters a call.
Why more context can make an agent less accurate
A larger window feels like a safety margin, so teams often load the full policy manual, every earlier message and all tool output into every call. The model then has to find the one rule that applies among material that mostly does not. Instructions start to compete, older facts override newer ones, and a long raw output can push the decisive field into a part of the input that is easy to miss. Anthropic's guidance on context engineering treats context as a finite resource with diminishing returns, and that framing fits what operators see: when an agent gives a wrong answer on a long task, the cause is often what was included in the call rather than the model's general capability.
Cost and latency follow the same logic. Every extra input token is paid for on every call the agent makes, and a task that runs many steps multiplies that cost. A budget keeps the call focused, makes the cost of each input visible, and gives you a clear place to decide whether an input deserves its space.
How do you build a context budget for one model call?
Start with one role and one kind of decision. A budget written for a general assistant tends to be too loose to enforce anything. Then work through the steps below.
- Write the decision the call must make in one sentence, such as whether a request can be approved within the stated policy.
- List every input the call could receive: system instructions, policies, memory entries, task state, tool results, user messages and prior outputs.
- Assign each input to a class: always loaded, loaded when a condition matches, fetched on demand, or never loaded in this call.
- Set a ceiling for each class and a total for the call, leaving room for the output the agent must produce.
- Define the trimming order for the moment the ceiling is reached, so the harness drops the least decisive material first.
- Record which inputs were included in each call and how large they were, so a bad answer can be traced later.
- Run a fixed evaluation set at two budget sizes and compare the errors that appear at the smaller size.
The last step is the one most teams skip. Without it, the budget is a guess that happens to look tidy.
What memory should enter a call?
Memory is not a transcript. A useful memory entry carries its scope, its source, an owner and, where relevant, an expiry. The harness should load an entry only when its scope matches the current task, such as the account involved, the request type or the tool being used. Loading all memory for a customer on every call is usually the fastest way to exhaust the budget and bury the one fact that matters.
Conflicts need a rule before they reach the model. If two entries disagree, the harness can prefer the most recent verified entry, or it can stop and escalate to a person. Leaving the model to choose between contradictory facts in silence is where many confident wrong answers come from.
Illustrative scenario: a billing support agent receives a question about a refund for a customer on a monthly plan. The call carries the customer's plan type and the refund rule for that plan, along with the open ticket. It does not carry the company's full history of plan changes or notes from unrelated tickets. If the customer record conflicts with the refund rule, the agent stops and routes the case to a person instead of choosing between them.
Which tool results should a call keep?
Tool results are often the largest input in a call, and they are often mostly noise. A search or record lookup may return dozens of fields, while the decision depends on two or three of them. Keep the status, the identifiers the next step needs, and the fields the decision rule names. Drop the rest from the call, but do not discard it from the system. The full output belongs in logs, so that a person can reproduce the run when something goes wrong.
The same principle applies to errors. A short, structured error with its code and the step that failed usually helps the agent more than a full stack trace. For the detailed mechanics of shortening outputs, see tool result truncation. When a bad run has to be explained later, the fields you kept in logs matter as much as the fields you kept in the call, and replay logs show which ones to record.
How do policies and instructions fit into the budget?
Keep an always-on core that states the role, the approval boundaries and the escalation rule. This part should be short enough that a person can read it in one sitting, because it is loaded on every call and any change to it affects every decision. Detailed procedures, such as the steps for a particular type of exception, belong in separate files that the harness loads only when the task matches. This keeps the core stable and the rest easy to version.
Retrieved content needs a clear label. Emails, web pages, uploaded documents and customer messages are data, and the harness should present them that way, not as instructions. The OWASP guidance on prompt injection prevention describes why text inside retrieved material can try to override the agent's rules, and why the boundary between instructions and data has to be enforced by the harness rather than left to the model.
How does Be Human handle context budgets in managed operations?
Be Human treats the context budget as part of the first engagement, not as a tuning detail added later. The first engagement defines the useful role, the memory and tools that role needs, the approval boundaries and an observable success criterion, and the budget follows directly from those choices. Managed operations then keep the budget under review: recurring evaluations check accuracy as memory grows and tools change, permission reviews confirm that each input is still allowed, and changes to the budget go through the same release process as changes to prompts and tools.
What should you review as the task grows?
A budget that worked for a small batch of cases can fail when the same agent handles a larger queue, a longer conversation or a more varied set of requests. Watch for the signs: the agent misses a rule it used to follow, asks for information that is already in a record, or escalates routine cases it should handle alone. When you see one of these, widen only the input class that caused the miss, rerun the same evaluation set, and record the change. Avoid raising the whole ceiling, because that hides the cause and raises cost on every call.
When the task itself becomes long, the budget has to work with state rather than memory alone. Saving verified progress lets the agent resume without reloading everything, which is the purpose of checkpoints for long-running agents. If you are not sure which task is the right first candidate for this kind of controlled setup, take the free Be Human AI diagnostic to find the first task worth handing to an agent.
Frequently asked questions
What is a context window budget for AI agents? It is the set of rules that decides which inputs enter each model call and how much space each input class receives. It usually covers instructions, memory, tool results, policy text and the current task state. Teams set it so the call stays focused and the output has room to be complete.
How is a context budget different from a context window? The window is the technical maximum a model accepts in one call. The budget is the smaller allocation you choose on purpose, and it is almost always below that maximum. A large window does not tell you what belongs in the call, so the budget still has to be designed.
How do I know if my budget is too small? Watch for symptoms such as a missed rule, a request for information that already exists in a record, or routine cases escalated without need. Run the same evaluation set at two budget sizes and compare the errors. If the smaller budget drops decisive fields, widen only the input class that caused the miss.
Should every agent use the same budget? No. Different roles and task types need different allocations, and the budget should be reviewed whenever tools, policies or memory change. A single shared default usually fits none of them well, so keep budgets per role in the harness configuration where changes can be reviewed and traced.
Your next step
See where an AI agent fits in your company first.
Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.
Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.


