LangSmith SDK: Streaming token events bypass output redaction
Moderate severity
GitHub Reviewed
Published
Apr 14, 2026
in
langchain-ai/langsmith-sdk
•
Updated Apr 24, 2026
Description
Published to the GitHub Advisory Database
Apr 16, 2026
Reviewed
Apr 16, 2026
Published by the National Vulnerability Database
Apr 23, 2026
Last updated
Apr 24, 2026
Summary
The LangSmith SDK's output redaction controls (hideOutputs in JS, hide_outputs in Python) do not apply to streaming token events. When an LLM run produces streaming output, each chunk is recorded as a new_token event containing the raw token value. These events bypass the redaction pipeline entirely — prepareRunCreateOrUpdateInputs (JS) and _hide_run_outputs (Python) only process the inputs and outputs fields on a run, never the events array. As a result, applications relying on output redaction to prevent sensitive LLM output from being stored in LangSmith will still leak the full streamed content via run events.
Details
Both JS and Python SDKs are affected. The same pattern exists in both:
traceable.ts:997-1003andtraceable.ts:1044-1050run_helpers.py:1924andrun_helpers.py:1996In both SDKs,
new_tokenevents with rawkwargs.tokenvalues are added during streaming, and the redaction pipeline (hideOutputsin JS,hide_outputsin Python) only processesinputs/outputs— neverevents.References