Install
openclaw skills install @yottameta/yotta-guardian元盾 —— 跨智能体的危险调用拦截护栏:确定性规则引擎 + 可插拔意图验证(不绑模型),拦截危险 exec / write / edit / read / run / shell 工具调用,提供审计日志。触发:代理要执行高风险命令(递归删除、磁盘格式化、提权、防火墙改动、反向 shell、下载即执行等)、要写入系统敏感路径或修改系统配置、要在执行危险操作前做安全检查、或用户说 护栏/拦截/危险操作/安全检查 等。边界:默认只读评估,不自动执行也不放行危险操作;不替代用户决策;不隐藏审计记录;规则可配置。
openclaw skills install @yottameta/yotta-guardian跨智能体的工具调用拦截护栏:确定性规则引擎 + 可插拔意图验证,对 exec / write / edit / read / run / shell 工具调用做安全评估,输出 allow / deny + 命中规则 + 审计日志。
零依赖(Python 3.8+ 标准库),Windows + Linux + macOS 通用;Claude Code / Cursor / Codex / 通用 Agent 均可调用。
Do NOT trigger:
Windows 用 python,Linux/macOS 用 python3。
# 检查一条 exec(0 = 允许)
python3 scripts/yotta_guardian.py check exec --cmd "git status"
# 检查危险命令(默认拒绝,退出码 3)
python3 scripts/yotta_guardian.py check exec --cmd "rm -rf /"
# 检查写操作
python3 scripts/yotta_guardian.py check write --path /etc/passwd --content "..."
# 批量检查(agent 在执行前把待执行调用列表交给护栏)
python3 scripts/yotta_guardian.py check --batch calls.json --json
# 审计
python3 scripts/yotta_guardian.py check exec --cmd "..." --audit-log .yotta-guardian/audit.jsonl
python3 scripts/yotta_guardian.py audit --file .yotta-guardian/audit.jsonl --tail 20
check(单条或 --batch 批量)。--allow / --allow-path / 自定义规则文件放行并留审计记录;不要绕过检查。--audit-log 落审计日志,供追溯。skill-manifest.json 声明 before_tool + fallback: explicit-unverified。接入方按下面三条做,可避开实测踩过的坑:
permissionDecision: "deny");放行时不输出任何判定,把决定权交回宿主。若放行时回「allow」,会覆盖宿主自身的权限流程,护栏就变成自动放行器 —— 护栏只该「拦」,不该「代批」。python -c "print(1)" 却正常);把引擎 stdout / stderr 重定向到临时文件再读回,判定即稳定(引擎自身的 stdout 是纯净的,--json 可直接解析)。sys.stdin.reconfigure(encoding="utf-8")(引擎已对自身 stdout / stderr 做 UTF-8 处理,stdin 由接入方负责)。另外:引擎对「没跑起来」是 fail-closed 的 —— 规则表加载失败或运行期未预期异常一律以退出码 4 结束并在 stderr 写「致命异常: …」。接入方应把 4 当作不放行 + 报告处理,而不是放行。
| 策略 | 行为 |
|---|---|
| default(默认) | 拒绝 critical / high;中危警告(exit 1) |
| strict | 拒绝 medium 及以上;低危也提示 |
| loose | 仅拒绝 critical;高危仅警告 |
--heuristic:启用内置本地启发式验证(对高影响动词升级为需人工确认);--verifier "命令" 或配置文件:外接任意意图验证器(如 LLM 网关),协议见 references/intent-verifier.md。