← 返回
安全合规

ClawGuard

Install and configure the ClawGuard security plugin - an LLM-as-a-Judge guardrail that detects and blocks risky tool calls
安装与配置ClawGuard安全插件——基于LLM即裁判的护栏,用于检测并拦截风险工具调用。
lidan-capsule
安全合规 clawhub v0.1.5 1 版本 99578.7 Key: 无需
★ 0
Stars
📥 2,836
下载
💾 11
安装
1
版本
#latest

概述

ClawGuard Plugin Installation Guide

ClawGuard is a security plugin that uses an LLM-as-a-Judge to evaluate tool calls before execution, detecting and optionally blocking risky operations.

Prerequisites

Before installing ClawGuard, ensure the gateway's chat completions endpoint is enabled:

openclaw config set gateway.http.endpoints.chatCompletions.enabled true

Installation

Install the plugin from npm:

openclaw plugins install @capsulesecurity/clawguard

After installation, restart the gateway to load the plugin.

Docker Installation

If running OpenClaw in Docker:

# Install the plugin
docker compose run --rm openclaw-cli plugins install @capsulesecurity/clawguard

# Restart gateway with force-recreate to reload env vars
docker compose up -d --force-recreate openclaw-gateway

Important: Always use --force-recreate when restarting. Plain docker compose restart does NOT reload environment variables.

Verify Installation

Check the gateway logs for the initialization message:

[clawguard] Initialized (logging: true, security: true, block: true, metrics: enabled)

Configuration

Configure ClawGuard via openclaw config set plugins.clawguard.:

OptionDefaultDescription
------------------------------
enabledtrueEnable/disable the plugin
logToolCallstrueLog tool call JSON to gateway logs
securityCheckEnabledtrueRun LLM security evaluation
blockOnRisktrueBlock high/critical risk tool calls
maxContextWords2000Session context word limit for evaluation
timeoutMs15000Security check timeout in milliseconds
gatewayHost127.0.0.1Gateway host for LLM calls
gatewayPort18789Gateway port for LLM calls
metricsEnabledtrueEnable anonymous usage metrics

Example Configuration

# Disable blocking (log-only mode)
openclaw config set plugins.clawguard.blockOnRisk false

# Increase timeout for slower models
openclaw config set plugins.clawguard.timeoutMs 30000

# Disable metrics collection
openclaw config set plugins.clawguard.metricsEnabled false

Gateway Authentication

ClawGuard calls the gateway's /v1/chat/completions endpoint internally. If you see 401 Unauthorized errors:

  1. Check the gateway token in your environment matches the config:

```bash

# Check env var

printenv OPENCLAW_GATEWAY_TOKEN

# Check config token

cat ~/.openclaw/openclaw.json | grep -A2 '"token"'

```

  1. If tokens don't match, update your environment and restart the gateway.

For Docker, ensure .env contains the correct OPENCLAW_GATEWAY_TOKEN and use --force-recreate when restarting.

Troubleshooting

405 Method Not Allowed

The chat completions endpoint is not enabled. Run:

openclaw config set gateway.http.endpoints.chatCompletions.enabled true

401 Unauthorized

Token mismatch between environment and config. See Gateway Authentication section above.

Plugin Not Loading

  1. Check openclaw plugins list shows clawguard
  2. Restart the gateway
  3. Check gateway logs for errors

How It Works

ClawGuard registers a before_tool_call hook that:

  1. Logs tool call details (if logToolCalls is enabled)
  2. Sends tool context to an LLM for security evaluation
  3. Returns a risk assessment (none/low/medium/high/critical)
  4. Blocks execution if risk is high/critical (if blockOnRisk is enabled)

The security evaluation uses your configured LLM provider, so it works with any model you have set up in OpenClaw.

Links

  • GitHub: https://github.com/capsulesecurity/clawguard
  • npm: https://www.npmjs.com/package/@capsulesecurity/clawguard

版本历史

共 1 个版本

  • v0.1.5 当前
    2026-03-28 13:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,135
security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,697
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,145