github / github/copilot-cli

Add support for blocked_tools / allowed_tools for Copilot CLI task tool sub-agents

未关闭
#3,133 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area:agents area:permissions
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

### Describe the feature or problem you'd like to solve

When launching sub-agents via the "task" tool, there's no way to restrict which tools the agent can access. I run a multi-model PR review skill that launches parallel general-purpose agents to review ADO PRs. These agents need ADO read tools to fetch diffs, but should never call write tools like repo_pull_request_thread_write. Despite strong prompt instructions (boxed warnings, banned tool lists, repeated reminders), agents occasionally post full review comments directly to PRs under my identity without authorization. This happened on 4 PRs before I caught it.

### Proposed solution

Add optional blocked_tools and/or allowed_tools parameters to the task tool:

agent_type: general-purpose
mode: background
blocked_tools: ["repo_pull_request_thread_write", "repo_pull_request_write"]

The runtime would reject blocked tool calls before they reach the MCP server. Text-only instructions aren't reliable -- LLMs sometimes override them. The explore agent type removes all MCP tools, but that's too restrictive (loses read access too). There's no middle ground today.

### Example prompts or workflows

_No response_

### Additional context

_No response_

贡献指南

打开贡献指南

调研方向

从 task tool 的参数处理以及分发 sub-agents tool 调用的运行时路径入手;比较 general-purpose 和 explore agents 如何获得 tool 访问权限。完成的标准是遵循可选的 allowed_tools 或 blocked_tools 设置,并在被阻止的调用到达 MCP server 之前拒绝它们。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli, security
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。