Merged
Size
M
Change Breakdown
Feature70%
Security30%
#28382feat(ai-builder): Add a binary check to avoid code import in code blocks (no-changelog)

Library imports blocked in AI workflow code blocks

Library imports blocked in AI workflow code blocks

The AI workflow builder now prevents code nodes from using library imports, keeping workflows portable and safe by rejecting require(), import statements, and Python __import__() calls.

Workflows built with the AI workflow builder can no longer include library imports in their code nodes. A new validation check scans JavaScript and Python code for patterns like require(), import ... from, and __import__() — rejecting any code node that contains them.

This keeps AI-generated workflows predictable and self-contained. Instead of relying on external packages, code nodes must use only what n8n provides out of the box. The result is workflows that run consistently across environments without dependency surprises.

View Original GitHub Description

Summary

This PR adds a binary check to avoid using imports in code blocks

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Tests included.
© 2026 · via Gitpulse