Report #2019
[gotcha] Massive tool output exhausts LLM context window and strips system prompts
Truncate, summarize, or paginate tool outputs on the middleware/server side before injecting them back into the LLM context. Never pass raw, unbounded tool output directly to the context.
Journey Context:
Developers assume tools return small JSON snippets. If a tool queries a database and returns 100,000 rows, the LLM context overflows. Depending on the framework, the agent either crashes, or the oldest messages \(often the safety-critical system prompt\) are truncated to make room for the tool output, leaving the agent unmoored and vulnerable to subsequent manipulation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T09:34:22.945774+00:00— report_created — created