审批设置

通过编辑 settings.json 配置 Bob Shell 中的工具自动审批。

~/.bob/settings/settings.json 中的 approval 键控制哪些工具组和单个工具会被自动审批。该文件与 IDE 共享;通过 IDE 设置界面所做的更改会写入同一文件。

注意:

对此文件的更改将在下次启动 Bob Shell 会话时生效。

Schema

"approval": {
  "allowed_permissions": [
    "mcp",
    "mode",
    "subtask",
    "subagent",
    "skill",
    "todo",
    "read",
    "execute"
  ],
  "permissionOptions": [
    {
      "groupId": "read",
      "enableOutsideWorkspace": true
    }
  ],
  "allowedExecutors": [
    {
      "toolId": "execute_command",
      "approvedCommands": [
        "cat",
        "git diff",
        "git log",
        "git rev-parse",
        "git show",
        "git status",
        "grep",
        "head",
        "tail",
        "ls",
        "sort",
        "wc",
        "which",
        "du",
        "df"
      ],
      "deniedCommands": [
        "rm"
      ]
    }
  ]
}

顶级键

类型描述
allowed_permissions字符串数组自动审批的工具权限组。请参阅下方的权限组 ID。
permissionOptions对象数组每组的选项。目前支持 read 组的 enableOutsideWorkspace
allowedExecutors对象数组每个工具的命令白名单和黑名单。目前适用于 execute_command

权限组 ID

组 ID涵盖的工具
read文件读取、目录列举、搜索
edit文件写入、创建和删除
execute终端和 shell 命令执行
mcp所有 MCP 服务器工具调用
skill技能激活
todo待办事项列表更新
subtask创建子任务
subagent生成子代理
mode模式切换

allowedExecutors schema

字段类型描述
toolIdstring要配置的工具。目前仅支持 execute_command
approvedCommands字符串数组当与完整命令字符串的前缀匹配时自动审批的命令。
deniedCommands字符串数组始终拒绝的命令,即使启用了自动审批也不例外。优先级高于 approvedCommands
这个主题怎么样?