mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-07-25 02:20:41 +00:00
- docs/agent-hooks.md: handler reference, lifecycle events, security model - examples/hooks/: 5 runnable JSON configs (audit, lint, block-rm-rf, Discord notify, context injector) - docs/17-changelog.md: Wave 0 entry - Makefile: hooks-specific test targets - CLAUDE.md: cross-reference
20 lines
452 B
JSON
20 lines
452 B
JSON
{
|
|
"event": "pre_tool_use",
|
|
"handler_type": "command",
|
|
"scope": "agent",
|
|
"matcher": "^(exec|shell)$",
|
|
"if_expr": "",
|
|
"config": {
|
|
"command": "grep -qE 'rm +-[rR][fF]? +/' && exit 2 || exit 0"
|
|
},
|
|
"timeout_ms": 2000,
|
|
"on_timeout": "block",
|
|
"priority": 100,
|
|
"enabled": true,
|
|
"source": "api",
|
|
"metadata": {
|
|
"notes": "Blocks `rm -rf /` style commands before exec. Lite edition only.",
|
|
"tags": ["safety", "command"]
|
|
}
|
|
}
|