核准設定

透過編輯 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子任務建立
subagentSubagent 生成
mode模式切換

allowedExecutors 結構

欄位類型說明
toolIdstring要設定的工具。目前僅支援 execute_command
approvedCommands字串陣列當與完整指令字串的前綴相符時自動核准的指令。
deniedCommands字串陣列即使啟用自動核准也始終拒絕的指令。優先於 approvedCommands
這個主題如何?