COPILOT_TOOL_MAP in src/hooks/types.ts canonicalises GitHub Copilot's tool names so that policies written against canonical names (Bash, Read, Task, …) fire on Copilot sessions.
Two documented Copilot tools are missing from it: task and web_search.
Why it matters
Unmapped tool names pass through uncanonicalised. So a policy matching toolName === "Task" silently never fires on Copilot — no warning, no error, it simply doesn't run.
For a guardrail tool that's the worst failure mode: the user believes they're protected and they aren't.
Where to fix
Add to COPILOT_TOOL_MAP in src/hooks/types.ts:
task: "Task",
web_search: "WebSearch",
The existing web_fetch: "WebFetch" entry sits right there as a model to follow.
One small judgement call
Copilot also documents an ask_user tool. It has no filesystem or shell reach, so it's arguably benign and needs no entry at all. We genuinely haven't decided — form a view and say which way you went in the PR description. Either answer is fine if it's reasoned.
Done when
- both entries exist
- a test in
__tests__/hooks/ asserts a Copilot task payload canonicalises to Task — see how the other CLI tool maps are tested for the shape
Reference: Copilot CLI hooks reference
Two lines of source plus a test — a good way to get familiar with how the CLI integrations are wired.
COPILOT_TOOL_MAPinsrc/hooks/types.tscanonicalises GitHub Copilot's tool names so that policies written against canonical names (Bash,Read,Task, …) fire on Copilot sessions.Two documented Copilot tools are missing from it:
taskandweb_search.Why it matters
Unmapped tool names pass through uncanonicalised. So a policy matching
toolName === "Task"silently never fires on Copilot — no warning, no error, it simply doesn't run.For a guardrail tool that's the worst failure mode: the user believes they're protected and they aren't.
Where to fix
Add to
COPILOT_TOOL_MAPinsrc/hooks/types.ts:The existing
web_fetch: "WebFetch"entry sits right there as a model to follow.One small judgement call
Copilot also documents an
ask_usertool. It has no filesystem or shell reach, so it's arguably benign and needs no entry at all. We genuinely haven't decided — form a view and say which way you went in the PR description. Either answer is fine if it's reasoned.Done when
__tests__/hooks/asserts a Copilottaskpayload canonicalises toTask— see how the other CLI tool maps are tested for the shapeReference: Copilot CLI hooks reference
Two lines of source plus a test — a good way to get familiar with how the CLI integrations are wired.