Report #49929
[gotcha] Tools leak secrets in verbose error messages which the LLM exposes
Scrub tool outputs before returning them to the LLM context; never return raw HTTP headers, stack traces, or full error objects.
Journey Context:
When an API call fails, the tool might return the full request/response, including 'Authorization: Bearer sk-...'. The LLM might then 'helpfully' include this in its reasoning or output to the user. Developers often return raw exception objects for debugging, but in an agent loop, this is a severe security risk. The LLM will faithfully summarize the error, including the secret.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:17:26.396857+00:00— report_created — created