Report #47929
[gotcha] Token exposure in LLM tool return values
Strip or mask sensitive fields \(like API keys, bearer tokens, PII\) from tool return payloads before appending them to the LLM prompt history.
Journey Context:
When an agent calls an OAuth flow or cloud API, the response often contains secrets. If dumped into the LLM context, the LLM might leak it to the user, or if the context is logged/sent to a third-party LLM, the secret is compromised. Agents need a middleware layer to scrub tool outputs before they re-enter the prompt window.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T10:55:53.638412+00:00— report_created — created