{"record":{"id":"b48bca73b804ff3c","repo":"langchain-ai/deepagents","slug":"cannot-combine-all-with-other-commands-in-shel","errorCode":null,"errorMessage":"Cannot combine 'all' with other commands in --shell-allow-list. Use '--shell-allow-list all' alone to allow any command.","messagePattern":"Cannot combine 'all' with other commands in --shell-allow-list\\. Use '--shell-allow-list all' alone to allow any command\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/config.py","lineNumber":2363,"sourceCode":"        entry, or `None` if every entry was blank.\n\n    Raises:\n        ValueError: If `'all'` is combined with other commands.\n    \"\"\"\n    commands = [item.strip() for item in items if item.strip()]\n    if not commands:\n        return None\n\n    if len(commands) == 1 and commands[0].lower() == \"all\":\n        return SHELL_ALLOW_ALL\n\n    # Reject ambiguous input: 'all' mixed with other commands\n    if any(cmd.lower() == \"all\" for cmd in commands):\n        msg = (\n            \"Cannot combine 'all' with other commands in --shell-allow-list. \"\n            \"Use '--shell-allow-list all' alone to allow any command.\"\n        )\n        raise ValueError(msg)\n\n    # If \"recommended\" is in the list, merge with recommended commands\n    result = []\n    for cmd in commands:\n        if cmd.lower() == \"recommended\":\n            result.extend(RECOMMENDED_SAFE_SHELL_COMMANDS)\n        else:\n            result.append(cmd)\n\n    # Remove duplicates while preserving order\n    seen: set[str] = set()\n    unique: list[str] = []\n    for cmd in result:\n        if cmd not in seen:\n            seen.add(cmd)\n            unique.append(cmd)\n    return unique\n","sourceCodeStart":2345,"sourceCodeEnd":2381,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/config.py#L2345-L2381","documentation":"parse_shell_allow_list_items validates the --shell-allow-list input; the special value 'all' permits every shell command but is ambiguous when mixed with specific commands, so it is rejected unless it is the sole item. This forces an explicit, unambiguous security posture.","triggerScenarios":"Passing --shell-allow-list 'all,ls' or a TOML shell_allow_list = [\"all\", \"git\"] — any list containing 'all' (case-insensitive) plus at least one other entry.","commonSituations":"Extending a default list by appending 'all' intending to broaden it, scripting config generation that concatenates 'all' with existing entries, or a user misunderstanding 'all' as a command name.","solutions":["Use --shell-allow-list all alone (no other entries) to allow any command.","Remove 'all' from the list and keep only the explicit commands you want to permit.","If you meant 'recommended plus extras', drop 'all' and list 'recommended' alongside the additional commands."],"exampleFix":"// before\nshell_allow_list = [\"all\", \"ls\"]\n// after\nshell_allow_list = [\"all\"]  # or\nshell_allow_list = [\"ls\"]","handlingStrategy":"validation","validationCode":"cmds = [c.strip() for c in raw.split(\",\") if c.strip()]\nif \"all\" in (c.lower() for c in cmds) and len(cmds) > 1:\n    raise ValueError(\"'all' must be the only item in shell-allow-list\")","typeGuard":null,"tryCatchPattern":"try:\n    allowed = parse_shell_allow_list(raw)\nexcept ValueError as e:\n    sys.exit(f\"invalid --shell-allow-list: {e}\")","preventionTips":["Treat 'all' as a mode, not a list entry: either 'all' alone or explicit commands","Deduplicate and lowercase list entries before validation","Prefer explicit command lists over 'all' for security"],"tags":["cli","config","security","validation"],"backgroundTag":"ambiguous-allowlist-value","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}