Report #10280
[gotcha] Oversized tool results evict system prompt and safety instructions from context
Enforce maximum size limits on tool return values. Truncate or summarize large results before injecting them into the LLM context. Monitor context window utilization after each tool call. Re-inject critical system instructions after large tool results if context budget allows.
Journey Context:
LLMs have finite context windows. When a tool returns a very large result—a full file, a large API response, a database dump—that result consumes context window space. If large enough, it pushes the system prompt and safety instructions out of the active context. The agent then 'forgets' its constraints and behavioral guardrails. A malicious MCP server can deliberately return oversized results to cause this eviction. The agent was well-behaved until a specific tool call returned megabytes of data, and then it started ignoring safety instructions—not because of prompt injection, but because the instructions were literally evicted from the context window. This is a denial-of-safety attack that requires no injection payload at all, just volume.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T10:15:23.551782+00:00— report_created — created