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/Components/policies.mdx
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,15 @@ slug: /policies
5
5
6
6
The **Policies** component leverages [ToolGuard](https://github.com/AgentToolkit/toolguard) to automatically generate guard code that validates tool execution against defined business policies.
7
7
8
-
With this component, developers define business policies in natural language and integrate policy enforcement into agent workflows. It automatically generates validation code for tools from those policies, protects tool execution by enforcing policy compliance at runtime, and caches generated guard code for better performance.
8
+
With this component, developers define business policies in natural language and integrate policy enforcement into agent workflows. It automatically generates validation code for tools from those policies, protects tool execution by enforcing policy compliance at runtime, and stores generated guard code in the flow for reuse.
9
9
10
10
The component supports **Generate** activity, which runs ToolGuard’s buildtime flow to produce new guard code from policies, and **Guard** activity, which reuses previously generated guard code for faster runs.
11
11
12
12
## Use the component in a flow
13
13
14
14
When `enabled` is `true`, you must supply at least one policy before generating guards.
15
15
Generated guard code is written under `tmp_toolguard/{project_name}/`, with **Step 1** producing guard specifications from policies in `Step_1/`, and **Step 2** turning those specifications into executable guard code in `Step_2/`.
16
-
If you switch to **Guard** (apply cached guards), the project directory must already contain valid generated guard code. The component handles module caching and cleanup automatically.
16
+
The generated code is also stored in the Policies node. After switching to **Guard**, the component loads that stored code, so the local `tmp_toolguard`directory is not required. If the node does not contain complete generated code, run **Generate** again.
17
17
18
18
For more information, see the [ToolGuard GitHub repository](https://github.com/AgentToolkit/toolguard).
19
19
@@ -22,11 +22,10 @@ For more information, see the [ToolGuard GitHub repository](https://github.com/A
22
22
| Name | Type | Description |
23
23
|------|------|-------------|
24
24
| enabled | Boolean | Input parameter. If `true`, ToolGuard runs before tool execution; if `false`, policy validation is skipped. |
25
-
| mode | String | Input parameter. **Activity**: **Generate** runs buildtime to create guard code, or **Guard** loads existing guards from the project folder. |
25
+
| mode | String | Input parameter. **Activity**: **Generate** runs buildtime to create guard code, or **Guard** loads generated guards stored in the flow. |
26
26
| project | String | Input parameter. Folder name for generated code under `tmp_toolguard/` (default `my_project`). |
27
27
| in_tools | List[Tool]| Input parameter. Tools the agent can use; they are wrapped with policy guards when enabled. |
28
28
| policies | List[String]| Input parameter. One or more clear, self-contained business policy strings. Required when generating guards. |
29
29
| model | Model | Input parameter. LLM used for Policies buildtime; Anthropic Claude Sonnet is recommended. Required when generating guards. |
30
30
| api_key | String | Input parameter. Model provider API key (advanced). Required when generating guards. |
31
31
| guarded_tools | List[Tool]| Output parameter. Tools with policy enforcement applied. Returns the original tools when the component is disabled. |
Copy file name to clipboardExpand all lines: docs/docs/Deployment/deployment-block-custom-components.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ To block custom component creation on a Langflow server, set the following [envi
12
12
LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false
13
13
```
14
14
15
-
When set to `false`, Langflow blocks creating custom components and changing code in the visual editor.
15
+
When set to `false`, Langflow blocks creating custom components, changing code in the visual editor, and running [registered built-in code-execution components](/api-keys-and-authentication#multi-tenant-component-hardening).
16
16
17
17
When unset or `true`, Langflow allows custom code.
18
18
Existing installations keep the default `true` behavior until you opt in to this restriction.
@@ -62,4 +62,4 @@ Default is `true`, which preserves existing behavior. The setting has no effect
Copy file name to clipboardExpand all lines: docs/docs/Develop/api-keys-and-authentication.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -507,12 +507,12 @@ For more information, see [Docker image defaults](/deployment-docker#docker-imag
507
507
508
508
Enable these flags when untrusted users can build flows on this server.
509
509
510
-
The `LANGFLOW_ALLOW_CUSTOM_COMPONENTS` and `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS` flags are _complementary_.
511
-
`LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`blocks user-authored component code, but built-in code-execution components still pass that check because their class code is trusted. Set `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true` to block those built-in components as well.
510
+
The `LANGFLOW_ALLOW_CUSTOM_COMPONENTS` and `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS` flags support two deployment modes.
511
+
`LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`blocks user-authored component code and registered built-in code-execution components at runtime. Set `LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS=true` independently when custom components should remain enabled but built-in code execution should be disabled.
512
512
513
513
To enable these flags, set the following:
514
514
515
-
* `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`: blocks user-authored component code. See [Block custom components](/deployment-block-custom-components).
515
+
* `LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false`: blocks user-authored component code and registered built-in code-execution components. See [Block custom components](/deployment-block-custom-components).
Copy file name to clipboardExpand all lines: docs/docs/Develop/environment-variables.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -446,7 +446,7 @@ See [Telemetry](/contributing-telemetry).
446
446
|`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. |
447
447
|`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. |
448
448
|`LANGFLOW_COMPONENTS_INDEX_PATH`| String | Not set | File path or URL (`http://` or `https://`) to a prebuilt component index JSON file used to populate built-in components in the visual editor. When not set, Langflow uses the included index. Useful for supplying a curated component index, for example in airgapped deployments. For more information, see [Block custom components](/deployment-block-custom-components). |
449
-
|`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-block-custom-components) and [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
449
+
|`LANGFLOW_ALLOW_CUSTOM_COMPONENTS`| Boolean |`True`| If `false`, disables custom components, in-editor editing of component code, and registered built-in code-execution components at runtime. This feature is in beta. For more information, see [Block custom components](/deployment-block-custom-components) and [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
450
450
|`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-block-custom-components). |
451
451
|`LANGFLOW_BLOCK_CODE_INTERPRETER_COMPONENTS`| Boolean |`False`| If `true`, blocks built-in code-execution components (Python Interpreter, REPL/Code tools, Smart Transform, and code-running agents). See [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
452
452
|`LANGFLOW_RESTRICT_LOCAL_FILE_ACCESS`| Boolean |`False`| If `true`, confines built-in file components to the upload storage directory and blocks local-file SQL dialects and local Git clones. See [Component hardening for untrusted users](/api-keys-and-authentication#multi-tenant-component-hardening). |
0 commit comments