FlowiseAI/Flowise · error · Error
Argument '${arg}' is not allowed for command '${command}'.
Error message
Argument '${arg}' is not allowed for command '${command}'. What it means
Thrown by validateCommandFlags when an arg, after lowercasing and trimming, exactly equals one of the dangerousFlags for that command (e.g. 'node' -> '-e', '--eval', '-r', '--require'; 'npx' -> '-c', '--call', '-y', '--yes', '--node-options'; 'python' -> '-c', '-m'; 'docker' -> 'run', 'exec', '-v', '--privileged', etc.). It blocks code-execution flags on otherwise allow-listed commands.
Source
Thrown at packages/components/nodes/tools/MCP/core.ts:386
'--env-file' // Read env vars from a local host file (local file access)
]
}
const dangerousFlags = dangerousFlagsByCommand[command] || []
// Collect single-char dangerous flags (e.g. '-c' -> 'c') for combined flag detection
const dangerousShortChars = new Set(dangerousFlags.filter((f) => /^-[a-zA-Z]$/.test(f)).map((f) => f[1].toLowerCase()))
for (const arg of args) {
if (typeof arg !== 'string') continue
const normalizedArg = arg.toLowerCase().trim()
// Check for dangerous flags in various forms (exact, =value, space-separated value)
for (const flag of dangerousFlags) {
const lowerCaseFlag = flag.toLowerCase()
if (normalizedArg === lowerCaseFlag) {
throw new Error(`Argument '${arg}' is not allowed for command '${command}'.`)
}
if (normalizedArg.startsWith(lowerCaseFlag + '=')) {
throw new Error(`Argument '${arg}' contains flag '${flag}' that is not allowed for command '${command}'.`)
}
if (flag.startsWith('-') && normalizedArg.startsWith(lowerCaseFlag + ' ')) {
throw new Error(`Argument '${arg}' contains flag '${flag}' that is not allowed for command '${command}'.`)
}
}
// Check for combined short flags (e.g. "-yc" = "-y" + "-c")
// A combined flag starts with a single '-', is not a long flag '--', and has multiple characters after '-'
if (/^-[a-zA-Z]{2,}/.test(normalizedArg)) {
const flagChars = normalizedArg.slice(1) // strip leading '-'
for (const ch of flagChars) {
if (dangerousShortChars.has(ch)) {
throw new Error(`Argument '${arg}' contains dangerous flag '-${ch}' for command '${command}'.`)
}
}View on GitHub (pinned to abe4a8601a)
Solutions
- Remove the dangerous flag from the args (e.g. drop '-e'/'--eval' from node invocations).
- Run the script as a file rather than via -e/-c/--call so no eval flag is needed.
- Choose a command/invocation that does not require auto-confirm or eval flags.
Example fix
// before
{ command: 'node', args: ['-e', 'console.log(1)'] }
// after
{ command: 'node', args: ['/opt/mcp/server.js'] } Defensive patterns
Strategy: validation
Validate before calling
const dangerousFlagsByCommand = { npx: ['-c', '--call', '-y', '--yes', '--node-options'], node: ['-e', '--eval', '-p', '--print', '-r', '--require', '--loader', '--import', '--env-file'], python: ['-c', '-m'], python3: ['-c', '-m'], docker: ['run', 'exec', 'build', 'compose', '-v', '--volume', '--mount', '--privileged', '--cap-add', '--security-opt', '--device', '--entrypoint', '--network', '--pid', '--ipc', '--env-file'] }
const flags = dangerousFlagsByCommand[command] ?? []
if (args.some(a => typeof a === 'string' && flags.includes(a.toLowerCase().trim()))) {
throw new Error(`Removing dangerous flag for ${command}`)
} Type guard
const argsHaveNoDangerousExactFlags = (command: string, args: string[]): boolean => {
const flags = new Set((dangerousFlagsByCommand[command] ?? []).map(f => f.toLowerCase()))
return !args.some(a => typeof a === 'string' && flags.has(a.toLowerCase().trim()))
} Try / catch
try {
validateCommandFlags(command, args)
} catch (e) {
if (e.message.endsWith(`is not allowed for command '${command}'.`)) {
// strip the named flag from args and retry
}
throw e
} Prevention
- Avoid eval/auto-confirm/eval-print flags for MCP server commands.
- Prefer file-based invocations over -e/-c/--call.
- Run validateCommandFlags during local development to catch issues before deploy.
When it happens
Trigger: validateCommandFlags(command, args) called from validateMCPServerConfig when serverParams.command is one of npx/node/python/python3/docker and an element of args case-insensitively matches a dangerous flag for that command.
Common situations: Custom MCP node using 'node -e ...' or 'npx -y pkg'; 'docker run ...' or 'docker -v ...' as the MCP server command; flags supplied by users in an arguments input.
Related errors
- Argument '${arg}' contains flag '${flag}' that is not allowe
- Argument '${arg}' contains dangerous flag '-${ch}' for comma
- Argument contains potentially dangerous characters: "${arg}"
- Environment variable '${key}' contains null byte
- Security validation failed: ${error.message}
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/c85675e0dab2a3e8.
Report an issue: GitHub.