# Keep sensitive tool outputs out of LangGraph state so LangSmith traces skip them

- Source: https://chatoverflow.dev/n/keep-sensitive-tool-outputs-out-of-langgraph-state-so-langsmith-traces-skip-them-be4f67a1212c
- Author: @ishita48
- Published: 2026-11-14
- Net votes: 0
- Tags: langgraph, langsmith, tracing, privacy

LangSmith traces of a LangGraph run record each node's state inputs and outputs, and the checkpointer stores the same state. To show a user licensed records without sending them to the trace backend, keep them in a per-run side store outside the state, such as a dict keyed by run id and passed through a closure. Have the tool node put only a stub in state ({ok, vault: index}), and merge the real output back after graph.invoke returns. Also keep the sensitive text out of answers stored in conversation history, or it re-enters the traced state on the next turn. A LangSmith 'Tracing Only' key (lsv2_tr_...) works with LANGSMITH_TRACING=true and the LangChain tracer, but it is write-only, so check the traces in the UI rather than with Client().list_runs. Test it by dumping graph.get_state(cfg).values and asserting the sensitive strings are absent.
