You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/Develop/api-keys-and-authentication.mdx
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -457,16 +457,60 @@ SSRF protection prevents requests to internal or private network resources, such
457
457
458
458
| Variable | Format | Default | Description |
459
459
|----------|--------|---------|-------------|
460
-
| `LANGFLOW_SSRF_PROTECTION_ENABLED` | Boolean | `False` | Enable SSRF protection for the **API Request** component. When enabled, the component blocks requests to private IP addresses. When disabled, requests are not blocked. |
460
+
| `LANGFLOW_SSRF_PROTECTION_ENABLED` | Boolean | `True` | Enable SSRF protection for the **API Request** component. When enabled, the component blocks requests to private IP addresses. When disabled, requests are not blocked. |
461
461
| `LANGFLOW_SSRF_ALLOWED_HOSTS` | List[String] | Not set | A comma-separated list of allowed hosts, IP addresses, or CIDR ranges that can bypass SSRF protection checks. For example: `192.168.1.0/24,10.0.0.5,*.internal.company.local`.|
462
+
| `LANGFLOW_CONNECTOR_SSRF_VALIDATION_ENABLED` | Boolean | `True` | Apply SSRF host validation to connector components that take a tenant-controlled host or URL, including vector stores, SQL databases, model-provider discovery, and remote service base URLs. It defers to `LANGFLOW_SSRF_PROTECTION_ENABLED` and `LANGFLOW_SSRF_ALLOWED_HOSTS` for the host policy. Set to `false`, or allowlist specific hosts, only when a trusted single-tenant deployment intentionally connects to private-network services. |
463
+
| `LANGFLOW_CONNECTOR_SSRF_ALLOW_LOOPBACK` | Boolean | `True` | Preserve literal `localhost`, `127.0.0.0/8`, and `::1` connector targets for common local deployments. Set to `false` when mutually-untrusted tenants must not reach services bound to loopback. Hostnames that merely resolve to loopback are still validated. |
464
+
465
+
:::note Multi-tenant recommendation
466
+
In a multi-tenant deployment where mutually-untrusted users build flows, keep `LANGFLOW_CONNECTOR_SSRF_VALIDATION_ENABLED=true` and `LANGFLOW_SSRF_PROTECTION_ENABLED=true`. Allowlist your own internal hosts with `LANGFLOW_SSRF_ALLOWED_HOSTS`.
The following environment variables close code-execution and local-file-read surfaces that remain reachable through *built-in* components even when user-authored custom components are disabled.
472
+
They are disabled by default to preserve single-tenant behavior, and are meant to be set together with [`LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`](/deployment-block-custom-components) in deployments where mutually-untrusted users build flows.
473
+
474
+
| Variable | Format | Default | Description |
475
+
|----------|--------|---------|-------------|
476
+
| `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS` | Boolean | `False` | When `true`, blocks execution of flows containing built-in arbitrary-code-execution components, including Python interpreter/REPL tools, lambda evaluators, and code-running agents. |
477
+
| `LANGFLOW_RESTRICT_LOCAL_FILE_ACCESS` | Boolean | `False` | When `true`, built-in file-reading components can read only from the authenticated user's or executing flow's storage namespace, and `save_file` writes are confined there. This also blocks local-file database dialects and local-filesystem Git clones. |
478
+
| `LANGFLOW_MCP_SERVER_DOCKER_HARDENING` | Boolean | `False` | When `true`, MCP Docker transports are limited to isolated `docker run` invocations. Host file/API/device access, namespace sharing, named networks, published ports, custom runtimes, restart persistence, and sandbox downgrades are rejected. Published Langflow images enable this by default. |
479
+
| `LANGFLOW_MCP_SERVER_ALLOWED_PACKAGES` | String | Not set | A comma-separated allowlist of exact package names that MCP `npx` and `uvx` stdio servers may download and execute. Version pins are permitted, but direct URL/path references and package-injection options are rejected. Published Langflow images allow only `mcp-proxy` and `lfx` by default. |
480
+
| `LANGFLOW_MCP_SERVER_INTERPRETER_HARDENING` | Boolean | `False` | When `true`, MCP stdio configurations cannot execute tenant-selected Python modules/scripts, Node.js files, or direct shell scripts. Validated package-runner wrappers and Langflow's authenticated internal agentic MCP module remain available. Published Langflow images enable this by default. |
481
+
482
+
:::caution Upgrade behavior
483
+
This hardening limits `LANGFLOW_RESTRICT_LOCAL_FILE_ACCESS=true` to the authenticated user's or executing flow's storage namespace. Before upgrading a deployment that already enables this setting, move component-managed files stored directly under `config_dir` into the appropriate user or flow storage namespace and update saved paths.
484
+
:::
485
+
486
+
:::note Multi-tenant recommendation
487
+
For a deployment where mutually-untrusted users build flows, set `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`, `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true`, `LANGFLOW_RESTRICT_LOCAL_FILE_ACCESS=true`, `LANGFLOW_MCP_SERVER_DOCKER_HARDENING=true`, `LANGFLOW_MCP_SERVER_INTERPRETER_HARDENING=true`, and `LANGFLOW_MCP_SERVER_ALLOWED_PACKAGES` together. Pair these controls with the SSRF settings above.
488
+
:::
489
+
490
+
:::warning Tracing in multi-tenant deployments
491
+
External tracing integrations are configured process-wide, not per user. When one is enabled in a multi-tenant deployment, every tenant's flow inputs, outputs, and prompts are sent to that external project. Do not enable a shared SaaS tracing backend where mutually-untrusted tenants can build flows; use built-in local tracing instead.
For a multi-tenant deployment served over HTTPS, harden the access-token cookie. These default to permissive values for local/HTTP development and for the current frontend, which reads the access token in JavaScript.
497
+
498
+
| Variable | Format | Default | Description |
499
+
|----------|--------|---------|-------------|
500
+
| `LANGFLOW_ACCESS_SECURE` | Boolean | `False` | When `true`, the `access_token_lf` cookie is sent only over HTTPS. Recommended `true` for any HTTPS deployment. Leave `false` for plain-HTTP/localhost development, where a `Secure` cookie would not be sent. |
501
+
| `LANGFLOW_ACCESS_HTTPONLY` | Boolean | `False` | When `true`, the `access_token_lf` cookie is not readable by JavaScript (mitigates token theft via XSS). The default is `false` because the bundled frontend currently reads this cookie in JavaScript; enabling `HttpOnly` requires a frontend that does not read the token directly. |
502
+
| `LANGFLOW_ACCESS_SAME_SITE` | String | `lax` | The `SameSite` attribute of the access-token cookie (`lax`, `strict`, or `none`). |
503
+
504
+
The refresh-token cookie is already `HttpOnly` + `Secure` + `SameSite` by default.
462
505
463
506
### Login rate limiting {#login-rate-limiting}
464
507
465
-
The following environment variables configure IP-based rate limiting on the `/login` endpoint to protect against brute-force attacks.
508
+
The following environment variables configure IP-based rate limiting to protect against brute-force attacks on the `/login` endpoint and abuse of public flow endpoints.
466
509
When the limit is exceeded, Langflow returns HTTP 429 with a `Retry-After: 60` header.
467
510
468
511
| Variable | Format | Default | Description |
469
512
|----------|--------|---------|-------------|
513
+
| `LANGFLOW_RATE_LIMIT_ENABLED` | Boolean | `True` | Enable rate limiting globally. Set to `False` to disable all rate limiting (not recommended in production). |
470
514
| `LANGFLOW_RATE_LIMIT_PER_MINUTE` | Integer | `5` | Maximum number of login attempts allowed per minute from a single IP address. |
471
515
| `LANGFLOW_RATE_LIMIT_STORAGE_URI` | String | `memory://` | Storage backend for rate limit counters. Use `memory://` for single-server deployments or `redis://host:port` for multi-server deployments where the limit should be shared across instances. |
472
516
| `LANGFLOW_RATE_LIMIT_TRUST_PROXY` | Boolean | `False` | When `true`, Langflow reads the client IP from the rightmost `X-Forwarded-For` header entry instead of the direct connection IP. Enable only when Langflow is behind a trusted reverse proxy or load balancer. Do not enable if users can reach Langflow directly, as this allows header spoofing. |
Copy file name to clipboardExpand all lines: docs/docs/Develop/environment-variables.mdx
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -446,6 +446,7 @@ See [Telemetry](/contributing-telemetry).
446
446
|`LANGFLOW_ALLOW_COMPONENTS_PATHS_OVERRIDE`| Boolean |`True`| When `false` alongside `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`, components contributed by `LANGFLOW_COMPONENTS_PATH` and `LANGFLOW_COMPONENTS_INDEX_PATH` no longer bypass the block. Has no effect when `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=true`. For more information, see [Block custom components](../Deployment/deployment-block-custom-components.mdx). |
447
447
|`LANGFLOW_LOAD_FLOWS_PATH`| String | Not set | Path to a directory containing flow JSON files to be loaded on startup. Typically used when creating a Docker image with prepackaged flows. Requires `LANGFLOW_AUTO_LOGIN=True`. |
448
448
|`LANGFLOW_LOAD_FLOWS_OVERWRITE_ON_NAME_MATCH`| Boolean |`False`| When a flow file in `LANGFLOW_LOAD_FLOWS_PATH` shares a name with an existing DB row but has a different `id`, controls whether to overwrite the existing row. `False` (default) skips with a warning so UI edits are preserved on restart when file UUIDs regenerate. Set to `True` to opt into prepackaged-flows-are-source-of-truth semantics, typically for CI/CD pipelines. |
449
+
|`LANGFLOW_LOAD_FLOWS_PRESERVE_VARIABLE_BINDINGS`| Boolean |`True`| Preserve global-variable bindings configured in the visual editor when an existing flow is reloaded from `LANGFLOW_LOAD_FLOWS_PATH`. Bindings explicitly configured in the flow file still take precedence. Set to `False` to restore blind replacement of the flow data on restart. |
449
450
|`LANGFLOW_CREATE_STARTER_PROJECTS`| Boolean |`True`| Whether to create templates during initialization. If `false`, Langflow doesn't create templates, and `LANGFLOW_UPDATE_STARTER_PROJECTS` is treated as `false`. |
450
451
|`LANGFLOW_UPDATE_STARTER_PROJECTS`| Boolean |`True`| Whether to update templates with the latest component versions when initializing after an upgrade. |
451
452
|`LANGFLOW_LAZY_LOAD_COMPONENTS`| Boolean |`False`| If `true`, Langflow only partially loads components at startup and fully loads them on demand. This significantly reduces startup time but can cause a slight delay when a component is first used. |
@@ -485,4 +486,4 @@ You can hide individual elements without enabling the umbrella flag.
485
486
|`LANGFLOW_HIDE_NEW_PROJECT_BUTTON`| Boolean |`False`| If `true`, hides the new project/folder button in the sidebar. Automatically enabled when `LANGFLOW_EMBEDDED_MODE=true`. |
486
487
|`LANGFLOW_HIDE_NEW_FLOW_BUTTON`| Boolean |`False`| If `true`, hides the new flow button in the header. Automatically enabled when `LANGFLOW_EMBEDDED_MODE=true`. |
487
488
|`LANGFLOW_HIDE_STARTER_PROJECTS`| Boolean |`False`| If `true`, hides the starter projects tab in the templates modal. Does not affect database seeding of starter projects. Automatically enabled when `LANGFLOW_EMBEDDED_MODE=true`. |
488
-
|`LANGFLOW_HIDE_GETTING_STARTED_PROGRESS`| Boolean |`False`| If `true`, hides the getting-started onboarding progress UI. Not automatically enabled when `LANGFLOW_EMBEDDED_MODE=true`. |
489
+
|`LANGFLOW_HIDE_GETTING_STARTED_PROGRESS`| Boolean |`False`| If `true`, hides the getting-started onboarding progress UI. Not automatically enabled when `LANGFLOW_EMBEDDED_MODE=true`. |
0 commit comments