简介
VAIBot Guard
原始描述
Local VAIBot Guard skill for OpenClaw. Use to run the guard service, enforce tool decisions via the OpenClaw circuit-breaker plugin, manage approvals, and va...
通过你的 Agent 添加
安装目录:vaibot-guard/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: vaibot-guard
description: Policy-gated execution + tamper-evident audit trail for VAIBot/OpenClaw operations. Use to precheck/deny/require-approval before shell execution, and to produce signed receipts (hash-chained logs) for execution decisions and outcomes.
VAIBot Guard (OpenClaw Skill)
This skill provides a local policy decision service plus a vaibot-guard CLI that enforces pre-execution checks and writes a tamper-evident audit log.
Deployment modes
- Local workstation mode (recommended default): run
vaibot-guard as a systemd user service (systemctl --user), optionally coupled to openclaw-gateway.service so it starts whenever OpenClaw starts (typically at login).
- VPS / production mode: run
vaibot-guard as a systemd system service (sudo systemctl) under a dedicated user, with stricter sandboxing and boot-time startup.
vaibot-guard as a systemd user service (systemctl --user), optionally coupled to openclaw-gateway.service so it starts whenever OpenClaw starts (typically at login).vaibot-guard as a systemd system service (sudo systemctl) under a dedicated user, with stricter sandboxing and boot-time startup.See: references/ops-runbook.md and systemd/.
Quick Start (local workstation)
0) One-time configure (recommended)
Fast path (recommended): one-command local install:
./scripts/vaibot-guard install-local
Or run the interactive configurator only (writes ~/.config/vaibot-guard/vaibot-guard.env with chmod 600):
./scripts/vaibot-guard configure
1) Start + smoke test
From this skill directory:
# 1) Start the guard service (foreground)
export VAIBOT_GUARD_TOKEN="change-me"
node scripts/vaibot-guard-service.mjs
In another terminal:
# 2) Precheck + exec (example)
export VAIBOT_GUARD_TOKEN="change-me"
./scripts/vaibot-guard precheck --intent '{"tool":"system.run","action":"exec","command":"/bin/echo","cwd":".","args":["hello"],"expectedOutputs":["hello"]}'
./scripts/vaibot-guard exec --intent '{"tool":"system.run","action":"exec","command":"/bin/echo","cwd":".","args":["hello"],"expectedOutputs":["hello"]}' -- /bin/echo hello
Optional (recommended): install as a systemd service so it auto-starts with OpenClaw:
- Local mode (user service): see
references/ops-runbook.md+systemd/user/ - VPS mode (system service): see
references/ops-runbook.md+systemd/system/
Components
scripts/vaibot-guard-service.mjs — local HTTP policy service
GET /health
POST /v1/decide/exec (precheck)
POST /v1/finalize
POST /api/proof (Merkle inclusion proofs)
scripts/vaibot-guard — CLI shim (calls node scripts/vaibot-guard.mjs)
Required environment (MVP)
- Node.js 18+ on the host
scripts/vaibot-guard-service.mjs — local HTTP policy service
GET /healthPOST /v1/decide/exec(precheck)POST /v1/finalizePOST /api/proof(Merkle inclusion proofs)
scripts/vaibot-guard — CLI shim (calls node scripts/vaibot-guard.mjs)- Node.js 18+ on the host
Optional:
VAIBOT_GUARD_HOST(default127.0.0.1)VAIBOT_GUARD_PORT(default39111)VAIBOT_WORKSPACE(defaultprocess.cwd())VAIBOT_GUARD_LOG_DIR(default${VAIBOT_WORKSPACE}/.vaibot-guard)VAIBOT_GUARD_TOKEN(recommended): bearer token required for service endpoints (/v1/decide/exec,/v1/finalize,/v1/flush,/api/proof)VAIBOT_POLICY_PATH(default:references/policy.default.json): policy configuration (deny/approve tokens, allowlisted domains, redaction patterns, and file-mutation posture).VAIBOT_CHECKPOINT_HASH_ALG(reserved): future knob for migrating checkpoint chaining (checkpoint.hash) to SHA3-512. Currently checkpoint chaining uses SHA-256 for consistency.VAIBOT_API_URL(e.g.https://www.vaibot.io/api) to anchor receipts via/proveVAIBOT_API_KEYbearer token for/prove(Authorization:Bearer <API KEY>)VAIBOT_PROVE_MODEL(defaultvaibot-guard):modelfield required by VAIBot/api/prove.VAIBOT_PROVE_MODE(off|best-effort|required, defaultbest-effort). Inrequiredmode, proving is fail-closed for both per-event receipts and checkpoint roots ("no proof, no action"). For security-first deployments, set this torequired.VAIBOT_MERKLE_CHECKPOINT_EVERY(default50): count-based checkpointing interval (events).VAIBOT_MERKLE_CHECKPOINT_EVERY_MS(default600000): time-based checkpointing interval (ms).
Checkpointing is whichever comes first: if either threshold is met and there are new events since the last checkpoint, a new checkpoint root is created. Recommended: 10 minutes and/or a few hundred–few thousand events depending on expected proof frequency.
Rules (MUST FOLLOW)
- Start the guard service (once per host):
node scripts/vaibot-guard-service.mjs
- Before running any risky action, run a precheck:
./scripts/vaibot-guard precheck --intent '<json>'
-
If the decision is deny, do not execute.
-
If the decision is approve, require explicit human approval (MVP: stop and surface approvalId).
-
If the decision is allow, execute only via:
./scripts/vaibot-guard exec --intent '<json>' -- <command...>
- Ensure the run is finalized (the
exec command auto-finalizes on exit; you can also call it manually):
./scripts/vaibot-guard finalize --run_id <id> --result '<json>'
Intent JSON (minimum fields)
node scripts/vaibot-guard-service.mjs
./scripts/vaibot-guard precheck --intent '<json>'
If the decision is deny, do not execute.
If the decision is approve, require explicit human approval (MVP: stop and surface approvalId).
If the decision is allow, execute only via:
./scripts/vaibot-guard exec --intent '<json>' -- <command...>
exec command auto-finalizes on exit; you can also call it manually):./scripts/vaibot-guard finalize --run_id <id> --result '<json>'
The guard service requires these keys at minimum:
{
"tool": "system.run",
"action": "exec",
"command": "/usr/bin/uname",
"cwd": "."
}
Recommended additional fields (use them when available):
args: string[]env_keys: string[]network:{ destinations: string[] }files:{ read: string[], write: string[], delete: string[] }correlation:{ agent_id, session_id, trace_id }
Policy
See: references/policy.md
See: references/receipt-schema.md
See: references/checkpoint-schema.md
See: references/idempotency.md
See: references/metadata-indexing.md
See: references/merkle-replay.md
See: references/inclusion-proofs.md
See: references/required-mode.md
Output / receipts
- Decisions + finalize events are appended to hash-chained JSONL logs in
.vaibot-guard/.
- These logs are designed to be tamper-evident (each line includes
prevHash).
.vaibot-guard/.prevHash).正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。