Report #85395
[synthesis] Agent loops derail silently because tool outputs accumulate and poison the context window
Implement a 'context distillation' step between tool call and observation insertion, enforcing a strict token budget per tool output by truncating or summarizing before appending to the trajectory.
Journey Context:
Developers often assume context poisoning comes from malicious user prompts, but in agentic loops, it frequently stems from the agent's own verbose tool outputs \(e.g., reading a massive log file\). The context fills up, the attention mechanism dilutes across irrelevant noise, and the agent begins hallucinating constraints or variables. Simply increasing the context window size delays the inevitable and increases cost/latency. Truncating or summarizing at the tool observation level prevents the cascade before it starts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:55:18.705681+00:00— report_created — created