Our system probes websites for security flaws using a master "thinking" agent and roughly two dozen specialised sub-agents. It routes each task to a cheap or expensive model and fails over between AI providers. We run it only against systems we own or are authorised to test. In a design like this, tool calls are constant, and what a tool returns is the part of the context the prompt author controls least. The configuration described here puts a fixed ceiling on that return path.
What does the tool-output cap enforce?
A tool result is truncated to a hard limit of 50,000 characters before it is fed back to the model. When truncation happens, the result carries an explicit [TRUNCATED] marker. The limit is a fixed number, not something tuned per call.
This note deliberately does not go further than that. It does not specify which portion of an oversized result is kept. It does not say whether the marker counts toward the 50,000 characters or sits alongside them. It does not claim the same cap applies uniformly to every agent and every tool in the system. Treat it as a documented ceiling on tool results returning to the model, not as a full specification of every return path.
Why would one tool response blow the context window?
A common reason is that tool output size is set by the outside world, not by the agent. A security-probing workload touches whatever site is under test, and a fetched page or verbose error output can be far larger than anything the prompt was designed around. The agent cannot know the size until the call returns.
A context window is a shared budget. System prompt, task instructions, history and earlier tool results all compete for it. One oversized result can crowd out the instructions that keep an agent on task, or push a request past a provider's limit. The cap targets that single-response failure.
How should the ~15k token figure be read?
The enforced limit is in characters. The ~15k token figure is an approximation of what 50,000 characters comes to, not a separately enforced token budget. Characters-per-token varies with the tokenizer and the content, so the real token count of a capped result can land above or below that estimate. If you adopt a similar cap, budget with that uncertainty in mind rather than treating the token number as exact.
What does the [TRUNCATED] marker add?
In general, silent truncation is a correctness hazard: a cut-off result that looks complete can be read as complete. An explicit marker puts the fact of truncation into the text the model actually reads, so the shortened output is distinguishable from a naturally short one. This note makes no claim about how models respond to the marker. Whether a given model notices it and adjusts its reasoning is a separate question that has not been measured here.
What does a per-result cap not solve?
- Accumulation. The cap bounds a single tool response. Many responses, each under the ceiling, can still add up across a long agent run.
- Lost content. Whatever truncation removes is not seen by the model. If decisive evidence sits in the removed portion, it is gone from that turn. The marker signals the loss; it does not recover the data.
- Measurement. This note documents a configuration and its purpose. It does not report how often the cap fires or how truncation affects findings.
How should you apply a tool-output ceiling in your own agents?
- Enforce it where results re-enter context. A cap at the boundary does not depend on each tool behaving well.
- Use a hard number. A fixed ceiling is easy to reason about and easy to test.
- Label every cut. Use an unambiguous marker rather than truncating silently.
- Decide where the marker lives. If you need a strict bound, make the marker count toward the limit. If it is appended after the cap, your real maximum is the cap plus the marker.
- Choose what to keep on purpose. Keeping the start, the end, or both trades off different failure modes. Pick based on where useful content tends to sit in your tools' output.
- Size it against your tightest model. If tasks can be routed or failed over to models with smaller windows, leave room for prompts and history on the smallest one.
- Treat frequent hits as a design signal. A tool that often reaches the ceiling may need filtering, pagination or a narrower query interface.
You control your prompts. You do not control what tools return. A fixed ceiling on tool output turns the least predictable part of the context into a bounded one.