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