user@local: ~/agent-hooks
v0.0.1
block-dangerous
protect-secrets
pkg-enforcement
require-plan
definition-of-done
diff-hygiene
context-injection
auto-fix
Global Installation Command (PowerShell)
irm https://raw.githubusercontent.com/Double77x/agent-hooks/main/install-hooks.ps1 | iex
Block Dangerous Commands Pre-Tool Use

Detects and prevents destructive shell operations, including root filesystem targets, home folder deletions, and remote script piping directly in shell tools.

Scope: Shell Tools (Bash, run_command, terminal)
Policy Mode: deny / ask
Source File: src/hooks/pre-tool-use/block-dangerous-commands.ts
Interactive Logs (Simulated)
user@hooks:~$ run-hook block-dangerous
Checking payload command "rm -rf /"...
[ai-hooks:block-dangerous-commands] blocked shell command: {"command":"rm -rf /","inspected":"rm -rf /","level":"DENY","reason":"[rm-root] rm targeting root filesystem","rule":"rm-root"}
Result: DENIED
[agent-hooks] 0:bash- 1:explorer* 2:logs
Built By ❤️ Dan "local-dev" 20:24 26-May-26