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
docs: block custom components with env var (#12413)
* initial-changes
* fix-broken-links
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
Custom components and the component code editor allow Langflow users to create and execute Python code in the Langflow runtime.
7
+
While this freedom is a feature of Langflow, in some deployments you might want to block the creation of custom Langflow components to prevent arbitrary code execution.
8
+
9
+
To block custom component creation on a Langflow server, set the following [environment variable](/environment-variables):
10
+
11
+
```bash
12
+
LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false
13
+
```
14
+
15
+
When set to `false`, Langflow blocks creating custom components and changing code in the visual editor.
16
+
17
+
When unset or `true`, Langflow allows custom code.
18
+
Existing Langflow installations will keep the default `true` behavior until you opt in to this restriction.
19
+
20
+
This environment variable is a beta feature, and should not be your only safeguard in production environments.
21
+
22
+
In the event that Langflow could execute untrusted or LLM-generated code, run Langflow in an isolated and containerized execution environment.
Copy file name to clipboardExpand all lines: docs/docs/Deployment/security.mdx
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,8 @@ title: Security
3
3
slug: /security
4
4
---
5
5
6
-
The Langflow UI is an IDE and code execution platform, which means that Langflow is inherently capable of executing arbitrary,
7
-
developer-provided code.
8
-
By design, the Langflow UI includes a code editor allowing developers to author and execute arbitrary Python with full access to the host
9
-
Langflow backend process, filesystem, and network.
6
+
The Langflow UI is an IDE and code execution platform, which means that Langflow is inherently capable of executing arbitrary, developer-provided code.
7
+
By design, the Langflow UI includes a code editor allowing developers to author and execute arbitrary Python with full access to the host Langflow backend process, filesystem, and network.
10
8
In addition, some components wrap and use code execution, including use of AI models to generate code to be executed based
11
9
on user input.
12
10
@@ -25,7 +23,8 @@ You are responsible for the following:
25
23
Langflow is a code execution platform with full access to your local system.
26
24
You are responsible for ensuring the safety of flows you execute.
27
25
28
-
In the event that Langflow could execute untrusted or LLM-generated code, consider using isolated or containerized execution environments. For more information, see [Containerize a Langflow application](/develop-application).
26
+
In the event that Langflow could execute untrusted or LLM-generated code, consider [blocking custom component execution](./deployment-block-custom-components.mdx) and running Langflow in an isolated and containerized execution environment.
27
+
For more information, see [Containerize a Langflow application](/develop-application).
Copy file name to clipboardExpand all lines: docs/docs/Develop/environment-variables.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -433,6 +433,7 @@ See [Telemetry](/contributing-telemetry).
433
433
|`LANGFLOW_AUTO_SAVING_INTERVAL`| Integer |`1000`| Set the auto-save interval in milliseconds if `LANGFLOW_AUTO_SAVING=True`. |
434
434
|`LANGFLOW_BUNDLE_URLS`| List[String]|`[]`| A list of URLs from which to load custom bundles. Supports GitHub URLs. If `LANGFLOW_AUTO_LOGIN=True`, flows from these bundles are loaded into the database. |
435
435
|`LANGFLOW_COMPONENTS_PATH`| String | Not set | Path to a directory containing custom components. Typically used if you have local custom components or you are building a Docker image with custom components. |
436
+
|`LANGFLOW_ALLOW_CUSTOM_COMPONENTS`| Boolean |`True`| If `false`, disables custom components and in-editor editing of component code. This feature is in beta. For more information, see [Block custom components](../Deployment/deployment-block-custom-components.mdx). |
436
437
|`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`. |
437
438
|`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`. |
438
439
|`LANGFLOW_UPDATE_STARTER_PROJECTS`| Boolean |`True`| Whether to update templates with the latest component versions when initializing after an upgrade. |
Copy file name to clipboardExpand all lines: docs/docs/Support/release-notes.mdx
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,11 @@ For all changes, see the [Changelog](https://github.com/langflow-ai/langflow/rel
77
77
Please do not report security vulnerabilities through public GitHub issues or GitHub security advisories.
78
78
For the full policy and what to include in a report, see the [Langflow Security Policy](https://github.com/langflow-ai/langflow/blob/main/SECURITY.md).
79
79
80
+
- Disable custom components
81
+
82
+
Set `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false` to disable custom components and in-editor editing of component code.
83
+
For more information, see [Block custom components](../Deployment/deployment-block-custom-components.mdx).
84
+
80
85
## 1.8.x
81
86
82
87
Highlights of this release include the following changes.
0 commit comments