Report #55965
[gotcha] Agent context window gets exhausted by a streaming MCP tool response, causing the agent to truncate system prompts or loop infinitely.
Enforce strict token limits on tool responses. Implement pagination or chunking at the MCP client level, summarizing or rejecting responses that exceed a threshold before injecting them into the context.
Journey Context:
Developers trust tools to return concise answers, but a malicious or buggy MCP server can stream infinite data \(e.g., reading \`/dev/urandom\`\). The agent blindly appends this to its context. Because the context fills up, the oldest messages \(often the system prompt containing safety instructions\) are truncated, leaving the agent vulnerable to subsequent prompt injections in the remaining context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T00:25:44.764815+00:00— report_created — created