# Hiding parts of input on Langsmith, when using LangGraph platform

**URL:** <https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514>\
**Category:** Deployment\
**Created:** [July 17, 2025, 10:52am UTC](https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514 "2025-07-17T10:52:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukanarrative](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lukanarrative](https://forum.langchain.com/u/lukanarrative)\
**Post date:** [July 17, 2025, 10:52am UTC](https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514/1 "2025-07-17T10:52:57Z")

</div>

Hi,

We want to not log some parts of input to Langsmith. Is it possible wit this setup:

We are deploying our app to LangGraph platform. We are using LangGraph to define graphs. We are using langchain’s libraries to invoke LLMs (`ChatOpenAI`, `ChatAnthropic` etc.).  
When running the graphs, every node’s input and output get stored in Langsmith.

This is a sample of what our code looks like:

```auto
# State definitions
class GraphInput(TypeDict):
    text: str
    big_text: str # a larger input

class GraphOutput(TypeDict):
    verdict: str

class GraphState(GraphInput, GraphOutput):
    hidden_text: str

# Example of a node
async def example_node(state, config):
   chain = ChatOpenAI() | StrOutputParser()

   res = await chain.ainvoke(state["text"] + state["big_text"])

   return {"hidden_text": res}

```

For this example, I’m interested in hiding in Langsmith traces the values (or entire keys) of `big_text` and `hidden_text`.

How to do that? I don’t want to hide all inputs and outputs, just some of these keys.

I’ve found these docs ([Prevent logging of sensitive data in traces | 🦜️🛠️ LangSmith](https://docs.smith.langchain.com/observability/how_to_guides/mask_inputs_outputs)), but there are no examples of using this for LangGraph platform + langchain libraries, which have tracing automatically failing.

Thanks

---

<div class="post-metadata">

**Author:** ![AbdulBasit](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/abdulbasit/32/72_2.png) [@AbdulBasit](https://forum.langchain.com/u/AbdulBasit)\
**Post date:** [July 17, 2025, 4:15pm UTC](https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514/2 "2025-07-17T16:15:03Z")

</div>

For LangGraph Platform, there’s currently no built-in way to selectively hide specific keys from traces while keeping others visible. The platform doesn’t support custom serializers or tracer configurations that work locally. The environment variables `LANGCHAIN_HIDE_INPUTS=true` and `LANGCHAIN_HIDE_OUTPUTS=true` hide everything, not specific keys. Your only option is to sanitize sensitive data at the source in your nodes - either remove sensitive fields from your state schema entirely, or overwrite them with placeholder values like `"[REDACTED]"` before returning state updates. You could create wrapper functions that strip sensitive keys before logging, but this requires manually managing what gets stored in state versus what gets passed to your LLM calls.

---

<div class="post-metadata">

**Author:** ![lukanarrative](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lukanarrative](https://forum.langchain.com/u/lukanarrative)\
**Post date:** [July 17, 2025, 8:04pm UTC](https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514/3 "2025-07-17T20:04:37Z")

</div>

> there’s currently no built-in way to selectively hide specific keys from traces while keeping others visible  
> Is it on the roadmap?

Thanks

---

<div class="post-metadata">

**Author:** ![austinmw](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/austinmw/32/1062_2.png) [@austinmw](https://forum.langchain.com/u/austinmw)\
**Post date:** [September 23, 2025, 5:46pm UTC](https://forum.langchain.com/t/hiding-parts-of-input-on-langsmith-when-using-langgraph-platform/514/4 "2025-09-23T17:46:29Z")

</div>

@AbdulBasit Any updates on this?

I’d like to selectively hide a specific LangGraph state key from being traced by LangSmith, while retaining its availability for other downstream tools to access it.

For context, I’m currently converting Pandas dataframes to dictionaries and saving them in LangGraph state via a sql\_query tool, and then allowing other tools to access the dataframe results later on if needed. The dataframes. We don’t want that particular state key traced since it is too large:

> Failed to send compressed multipart ingest: langsmith.utils.LangSmithError: Failed to POST [https://api.smith.langchain.com/runs/multipart](https://api.smith.langchain.com/runs/multipart) in LangSmith API. HTTPError(‘422 Client Error: unknown for url: [https://api.smith.langchain.com/runs/multipart](https://api.smith.langchain.com/runs/multipart)’, ‘{“error”:“Unprocessable entity: invalid Content-Length or length parameter for patch.da6609f3-b6ba-4b81-aac5-08489f417722.outputs: field size 214889244 exceeds maximum allowed size of 209715200 bytes”}\n’)
