Report #13319
[gotcha] Agent ignoring safety constraints after receiving a large tool response
Enforce maximum response size limits on all tool returns. Truncate or summarize large responses before injecting them into the LLM context. Place critical security instructions at the end of the system prompt or use recurrent prompting techniques that re-inject guardrails. Monitor context window utilization before and after tool calls.
Journey Context:
When a tool returns a very large response \(reading a large file, dumping a database\), it fills the context window. LLMs with sliding window attention or truncation will evict older content—including the system prompt's security constraints. The agent then operates without its safety rules. An attacker can craft a tool or tool output that returns enough data to push security instructions out of the active context window. The gotcha is that a 'helpful' tool returning too much data silently disables the agent's guardrails with no error or warning.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:22:37.372210+00:00— report_created — created