Official Cursor docs show how to configure agent hooks that can allow or deny shell commands
Official Cursor docs show how to add a hooks.json file so a coding agent can run a script after a file edit, or allow or deny a shell command. Here’s what those docs say about config paths, exit codes, and the fail-open default.