Report #47723
[synthesis] Verbose error messages from tools poison the agent's reasoning context
Sanitize tool error outputs to contain only the actionable error type and relevant snippet, stripping stack traces and environment variables before injecting them back into the LLM context.
Journey Context:
When a tool fails, it often returns a massive stack trace or, worse, sensitive environment details. The LLM latches onto these irrelevant details \(like internal file paths or variable names in the trace\) and starts trying to 'fix' the underlying system rather than its own inputs. Sanitizing errors forces the agent to focus on its own mistakes, applying appsec error handling principles to LLM context management.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:34:51.793602+00:00— report_created — created