核准設定
透過編輯 settings.json 設定 Bob Shell 的工具自動核准。
~/.bob/settings/settings.json 中的 approval 鍵控制哪些工具群組和個別工具會被自動核准。此檔案與 IDE 共用;透過 IDE 設定 UI 所做的變更會寫入同一個檔案。
注意:
此檔案的變更將在下次啟動 Bob Shell 工作階段時生效。
結構
"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 | Subagent 生成 |
mode | 模式切換 |
allowedExecutors 結構
| 欄位 | 類型 | 說明 |
|---|---|---|
toolId | string | 要設定的工具。目前僅支援 execute_command。 |
approvedCommands | 字串陣列 | 當與完整指令字串的前綴相符時自動核准的指令。 |
deniedCommands | 字串陣列 | 即使啟用自動核准也始終拒絕的指令。優先於 approvedCommands。 |
這個主題如何?