Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
A project-level beforeShellExecution hook that answers {"permission":"ask"} gets the approval prompt in Allowlist mode and in Run Everything mode (“Hook requested approval: …”). In Auto-review mode the command runs without any prompt. deny is enforced in all three modes.
Steps to Reproduce
ask.ps1, a hook that always asks:
[Console]::In.ReadToEnd() | Out-Null
[Console]::Out.Write('{"permission":"ask","user_message":"hook asked","agent_message":"hook asked"}')
.cursor/hooks.jsonin the project:
{ "version": 1, "hooks": { "beforeShellExecution": [
{ "command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:\\path\\to\\ask.ps1" } ] } }
- Set Auto-Run to Auto-review and ask the agent to run
echo test > t.txt.
Expected: an approval prompt, as Run Everything shows for the same hook answer.
Actual: no prompt;t.txtis written.
Expected Behavior
In Auto-review, the same approval prompt that Run Everything shows (“Hook requested approval”). Actual: no prompt, and t.txt is written.
Screenshots / Screen Recordings
Operating System
Windows 10/11
Version Information
Cursor 3.21.16 (8ae78e8eee1e63479c7e0504b664bc0a80c68000, x64)
For AI issues: which model did you use?
Grok 4.6 Medium (not model-specific: the hook’s answer is skipped before the command runs)
Additional Information
What I measured (a probe hook that logged each call and answered one way per trial; every prompt was declined, so a written file means it ran with no human approval):
| Auto-Run mode | Hook answers ask |
Hook answers deny |
|---|---|---|
| Allowlist | prompt | — |
| Auto-review | no prompt, command ran (two trials) | blocked |
| Run Everything | prompt: “Hook requested approval” | — |
The hook is called before Cursor’s own approval in every mode (it logs a call even when the prompt is then skipped), so the answer is available in time; Auto-review appears to let its own reviewer’s decision replace the hook’s. The hook payload doesn’t include the auto-run mode either, so a hook can’t detect Auto-review and compensate.
Why it matters: hook-based guards (including the one I maintain, Termaxa) use ask for commands that need a human but shouldn’t be refused outright. In Auto-review those currently run unreviewed by a person, while the same hook in Run Everything, nominally the most permissive mode, does get a human.
Also noticed while capturing: the beforeShellExecution payload’s cwd is an empty string in 3.21.16; the project appears only in workspace_roots.
The screenshots come from my logging probe version of the same hook, which answers “probe answered ask”; it differs from the minimal ask.ps1 above only in that it logs each call.
Does this stop you from using Cursor
No - Cursor works, but with this issue

