From dc9f2b1109dacfa4adff44e0528a498515cfec2e Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Mon, 28 Apr 2025 08:31:48 -0700 Subject: [PATCH] Add how-to on headers (#4440) and their configurability for configurability --- .../cloud/how-tos/configurable_headers.md | 20 +++++++++++++++++++ docs/docs/cloud/reference/cli.md | 2 +- docs/docs/how-tos/index.md | 1 + docs/mkdocs.yml | 1 + 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docs/docs/cloud/how-tos/configurable_headers.md diff --git a/docs/docs/cloud/how-tos/configurable_headers.md b/docs/docs/cloud/how-tos/configurable_headers.md new file mode 100644 index 000000000..90a4fe934 --- /dev/null +++ b/docs/docs/cloud/how-tos/configurable_headers.md @@ -0,0 +1,20 @@ +# Configurable Headers + +LangGraph allows runtime configuration to modify agent behavior and permissions dynamically. When using the [LangGraph Platform](../quick_start.md), you can pass this configuration in the request body (`config`) or specific request headers. This enables adjustments based on user identity or other request data (see the [configuration how-to](../../how-tos/configuration.ipynb) for more details on how to access within your graph). + +For privacy, control which headers are passed to the runtime configuration via the `http.configurable_headers` section in your `langgraph.json` file. + +Here's how to customize the included and excluded headers: + +```json +{ + "http": { + "configurable_headers": { + "include": ["x-user-id", "x-organization-id", "my-prefix-*"], + "exclude": ["authorization", "x-api-key"] + } + } +} +``` + +The `include` and `exclude` lists accept exact header names or patterns using `*` to match any number of characters. For your security, no other regex patterns are supported. diff --git a/docs/docs/cloud/reference/cli.md b/docs/docs/cloud/reference/cli.md index b71a660ff..b20073451 100644 --- a/docs/docs/cloud/reference/cli.md +++ b/docs/docs/cloud/reference/cli.md @@ -49,7 +49,7 @@ The LangGraph CLI requires a JSON configuration file that follows this [schema]( | `pip_config_file` | Path to `pip` config file. | | `dockerfile_lines` | Array of additional lines to add to Dockerfile following the import from parent image. | | `checkpointer` | Configuration for the checkpointer. Contains a `ttl` field which is an object with the following keys: | - | `http` | HTTP server configuration with the following fields: | + | `http` | HTTP server configuration with the following fields: | === "JS" diff --git a/docs/docs/how-tos/index.md b/docs/docs/how-tos/index.md index 4cb3b4089..eabbfbbc0 100644 --- a/docs/docs/how-tos/index.md +++ b/docs/docs/how-tos/index.md @@ -248,6 +248,7 @@ LangGraph Platform supports multiple types of runs besides streaming runs. - [How to run multiple agents in the same thread](../cloud/how-tos/same-thread.md) - [How to create cron jobs](../cloud/how-tos/cron_jobs.md) - [How to create stateless runs](../cloud/how-tos/stateless_runs.md) +- [How to use headers as runtime configuration](../cloud/how-tos/configurable_headers.md) ### Streaming {#streaming_1} diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index ef2e2a6d6..5c14b6937 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -216,6 +216,7 @@ nav: - cloud/how-tos/same-thread.md - cloud/how-tos/cron_jobs.md - cloud/how-tos/stateless_runs.md + - cloud/how-tos/configurable_headers.md - Streaming: - cloud/how-tos/stream_values.md - cloud/how-tos/stream_updates.md