⚠️ ADVANCED TIER REQUIRED — This plugin is the blocking engine for Shoofly Advanced ($19/mo). Installing without an Advanced license will enable the hook but you will not have a supported configuration. Get Shoofly Advanced at shoofly.dev/advanced.
🆓 Start with Shoofly Basic (free) — install the free tier first, then upgrade to Advanced for pre-execution blocking.
shoofly-hook
OpenClaw plugin for pre-execution tool call interception. Blocks dangerous tool calls before they execute using the before_tool_call plugin hook.
What it does
shoofly-hook inspects every tool call in the agent loop and blocks those matching known threat patterns:
| Threat | Code | What it catches |
|---|---|---|
| Out-of-Scope Write | OSW | Writes to /etc/, ~/.ssh/, ~/.aws/, ~/.bashrc, ~/.zshrc, ~/.bash_profile, ~/.zprofile, ~/.openclaw/ (outside workspace) |
| Data Exfiltration | DE | Credential patterns in exec commands (sk-*, ghp_*, AKIA*, id_rsa piped to curl) |
| Prompt Injection | PI | Blocked URLs in web_fetch/read calls (configurable blocklist) |
Blocked calls return { block: true, blockReason: "..." } to the agent loop — the tool never executes.
How it differs from shoofly-basic
| shoofly-basic | shoofly-hook | |
|---|---|---|
| Architecture | Hook pack (post-execution observer) | Plugin (pre-execution interceptor) |
| Can block? | No — detects and alerts only | Yes — prevents execution |
| Runs when | After messages are processed | Before each tool call |
They are complementary: use both for defence in depth.
Install
openclaw plugins install ./shoofly-hook
# Add "shoofly-hook" to plugins.allow in your openclaw config
openclaw gateway restart
Configuration
Policy lives at ~/.shoofly/policy/hook-policy.json (auto-created with safe defaults if missing):
{
"sensitivePaths": ["/etc/", "/.ssh/", "/.aws/", "/.bashrc", "/.zshrc"],
"exfilPatterns": ["sk-[a-zA-Z0-9]{20,}", "ghp_[a-zA-Z0-9]{36}", "AKIA[A-Z0-9]{16}"],
"blockedUrls": []
}
Logs
Blocked calls are logged as JSONL to ~/.shoofly/logs/hook-alerts.log.
