-
Notifications
You must be signed in to change notification settings - Fork 1.9k
preToolUse agent hook denial does not work #3874
Copy link
Copy link
Closed
Labels
area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictionsTool approval, security boundaries, sandbox mode, and directory restrictionsarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agentsPlugin system, marketplace, hooks, skills, extensions, and custom agents
Description
Activity
Metadata
Metadata
Assignees
Labels
area:permissionsTool approval, security boundaries, sandbox mode, and directory restrictionsTool approval, security boundaries, sandbox mode, and directory restrictionsarea:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agentsPlugin system, marketplace, hooks, skills, extensions, and custom agents
Describe the bug
Running chat session from Copilot CLI, I have installed a hook that denies all commands.
Affected version
v1.0.65Steps to reproduce the behavior
.github/hooks/hooks.json
{ "version": 1, "hooks": { "preToolUse": [ { "cwd": "src", "bash": "bin/Debug/net10.0/hook", "powershell": "bin/Debug/net10.0/hook", "timeoutSec": 15 } ] } }A simple C#
hook.exeprogram:Program.cs
Here is a simple session prompt:
I tried everything:
2{"permissionDecision": "deny"}response topreToolUsehook events.{"behavior":"deny"}response topermissionRequesthook events.Still, the tool is called and never denied.
Expected behavior
The tool call SHOULD be denied.
Additional context
No response