Langflow Assistant fails with LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false: built-in flow ships Keyword Search as inline custom code (1.13.1)
Bug description
LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false is one of the two lockdowns that Langflow's startup SECURITY warning recommends for multi-user installs. With it set, every Langflow Assistant request fails:
Flow build blocked: custom components are not allowed: Keyword Search (DataFrameKeywordSearch-b8MUN)
Cause (from the 1.13.1 source)
langflow/agentic/flows/LangflowAssistant.json contains node DataFrameKeywordSearch-b8MUN with "edited": true and inline code that matches no server template. The custom-component policy therefore treats a component Langflow ships itself as custom code. It is the only edited node in the Assistant's flows.
Workaround, and a second problem it exposes
We copy that node's code, byte for byte, from the image into a directory on LANGFLOW_COMPONENTS_PATH, which is trusted because allow_components_paths_override defaults to true. The legacy component loader then registers its hash, and the "custom components are not allowed" block goes away.
The component's code uses IntInput without importing it:
from langflow.io import DataFrameInput, MessageTextInput, DropdownInput, BoolInput, Output
...
IntInput(
name="number_candidates",
So the extension loader logs this at every start:
Extension load error: error[module-import-failed]: Failed to import bundle module .../DataFrameKeywordSearch_<hash>.py: NameError: name 'IntInput' is not defined
Suggested fix
Ship Keyword Search as a regular built-in component, so that its code hash is a known server template, and add IntInput to its imports.
Steps to reproduce
- Run
langflowai/langflow:1.13.1withLANGFLOW_ALLOW_CUSTOM_COMPONENTS=false. - Configure a model provider with a model that can call tools.
- Create a new flow, open the Assistant and ask it to build any flow.
Environment
- Langflow 1.13.1, lfx 1.13.1, official image
langflowai/langflow:1.13.1(sha256:9f5220634256d243756d9a59a7210f3e71010eb2dfb20841ccbaae56a22a4267), Python 3.14.8 - Kubernetes; multi-user with external auth (OIDC)
Related
With the workaround above in place, the Assistant then fails at its Directory step when Langflow uses S3 storage. That's filed separately: https://github.com/langflow-ai/langflow/issues/16364.
I'll take this one. Plan: look at the Keyword Search node shipped in LangflowAssistant.json, move it to a regular built-in component so its code hash matches a known server template, and add the missing IntInput import. Then I'll verify the Assistant flow builds with LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false and run the related component/flow tests.
I'd like to send a PR for this, but first I'd like to check which fix you'd prefer. Both options change something visible:
- Ship Keyword Search as a regular built-in component, for example under
processing/, and haveLangflowAssistant.jsonuse it as an unedited built-in. Its code hash then becomes a known template, soLANGFLOW_ALLOW_CUSTOM_COMPONENTS=falseaccepts it like any other built-in. The cost is a new public component in the sidebar and a component-index update. - Trust the inline components of the Assistant flows that ship with the server, without making them public components. For example, register the code hashes of the edited nodes in
agentic/flows/*.jsonas trusted when the component cache is built. The cost is a second trust path inside the custom-component policy.
Either way, the missing IntInput import gets fixed.
I lean towards option 1: it reuses the existing mechanism and keeps the policy simple. I'm happy to send the PR for whichever you prefer.
(The related S3 bug, #16364, doesn't depend on this; a PR for it is on the way.)
LE-3449
The fix has been merged