360 Secure SkillHub
360 安全技能中心

shoofly-hook

该 Skill 是 OpenClaw 插件,通过 before_tool_call 钩子在工具调用执行前拦截:阻止对系统敏感路径的越界写入、识别 exec 命令中的凭据外泄模式,并按可配置名单阻止 URL 访问;拦截后向 agent 循环返回 block 结果,并以 JSONL 记录到本地日志。策略存于本地策略文件。

wow-leeroy-jenkins05
wow-leeroy-jenkins05
热度 25.80
最近更新 2026-03-25 08:36:49
分类:安全依赖:读写文件应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add shoofly-hook
Metadata
name
shoofly-hook
version
0.1.0
description
Pre-execution tool call interceptor for OpenClaw. Blocks dangerous tool calls before they execute.
trigger
Automatically active as an OpenClaw plugin — intercepts every tool call before execution and blocks out-of-scope writes, credential exfiltration, and prompt injection vectors.

⚠️ 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.