Describe the bug
Running chat session from Copilot CLI, I have installed a hook that denies all commands.
Affected version
- GitHub Copilot Chat Extension
v1.0.65
Steps 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.exe program:
Program.cs
Console.WriteLine("{\"permissionDecision\":\"deny\"}");
Environment.Exit(2);
Here is a simple session prompt:
Give me the latest powershell Get-Date
I tried everything:
- Exit code
2
{"permissionDecision": "deny"} response to preToolUse hook events.
{"behavior":"deny"} response to permissionRequest hook events.
Still, the tool is called and never denied.
Expected behavior
The tool call SHOULD be denied.
Additional context
No response
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