Sensitive assistant configurable values exposed in LangGraph streaming metadata

Hi LangGraph team,

We are using a self-hosted LangGraph Agent Server with multiple assistants, each having its own LLM configuration, including a dedicated LLM API key.

The API key is stored in the assistant’s configurable section, as it is specific to each assistant and required internally by the graph during execution.

However, we noticed that this sensitive value is exposed in the SSE response when using the messages-tuple streaming mode.

Steps to reproduce

Configure an assistant with the following configuration:

{
  "configurable": {
    "llm-api-key": "<SECRET>"
  }
}

Execute a run using the streaming endpoint:

POST /threads/{thread_id}/runs/stream

With the following request body:

{
  "assistant_id": "<ASSISTANT_ID>",
  "stream_mode": ["messages-tuple", "values"],
  "input": {
    "messages": [
      {
        "role": "user",
        "content": "Hello"
      }
    ]
  }
}

Actual behavior

The LLM API key is returned in plain text within the message metadata:

[
  {
    "content": "Assistant response",
    "type": "ai"
  },
  {
    "assistant_id": "...",
    "thread_id": "...",
    "llm-api-key": "<SECRET>",
    "langgraph_node": "generate",
    "langgraph_step": 5
  }
]

The secret is therefore accessible to the API consumer directly through the raw SSE response, even though it is intended exclusively for internal server-side use.

Expected behavior

Sensitive assistant-specific configuration values should remain accessible to the graph during execution without being exposed to API consumers through streaming metadata or other API responses.

Questions

  • Is the automatic propagation of configurable values into streaming metadata an intentional behavior?

  • Is there an officially supported mechanism to mark specific configurable fields as private or sensitive?

  • Is it possible to exclude specific configurable keys from streaming metadata at the server or graph level while keeping them accessible internally?

Ideally, we would like to retain assistant-specific configuration without exposing sensitive values to API consumers, regardless of the requested streaming mode.

Filtering the metadata on the client side would not address the security concern, since the secret has already been transmitted over HTTP.

Thanks for your help!

I would not put an LLM API key in assistant configurable if those values are echoed into stream metadata. Configurable is part of the run config, and in messages-tuple and values modes I have also seen those keys arrive on the client. Anyone who can call the stream endpoint can read them, so they are not internal.

I have not seen a first-class flag that marks a configurable field as private and reliably keeps it out of stream metadata. Until that exists, I would assume anything in configurable can leak to the API consumer.

Practical options that have worked for me:

Keep secrets in environment variables or a secret store that the graph reads server-side, and only put non-secret routing keys in configurable (model name, temperature, and so on).

If each assistant truly needs its own key, resolve assistant_id to that key in your own server code before the run, and never place the key in the configurable dict that LangGraph serializes.

If you must keep the current shape for a while, wrap the stream and strip known secret keys from the metadata before it leaves the server.

I would also check the other surfaces, not only messages-tuple: thread state, values snapshots, and traces have in my experience carried the same configurable map. A redaction that only covers one stream mode is easy to miss.

Hi @gdrouet, answering your three questions for Python:

  1. It was intentional in older versions. Every string, number or boolean in configurable was copied into run metadata so it showed up in traces, and messages-tuple returns that metadata. This changed in langgraph 1.1.7, which requires langchain-core 1.3.0 or later. From there, only identifiers such as thread_id, assistant_id and checkpoint_ns are copied. I reproduced your case: llm-api-key is in the stream metadata on langgraph 1.1.6 and gone on 1.1.7 and on the current release. Which versions are you running?

  2. There is no flag to mark a configurable field as private.

  3. Upgrading removes it from the stream. I would still move the key out of the assistant config, because the assistant object itself is returned by the Assistants API (GET /assistants/{assistant_id}) with its config. Keep the keys in environment variables or a secret manager on the server and look the right one up by assistant_id inside the graph. For non-secret per-assistant settings, use context (Manage assistants - Docs by LangChain).

@virse_ai agreed on keeping keys server-side. I added the version detail above: the stream metadata part is fixed from langgraph 1.1.7.