lidan-capsule

ClawGuard

AI 智慧體v0.1.5
作者:lidan-capsule更新於 2026-05-17clawguard@clawhub_lidan-capsule/clawguard
Agent 框架工具呼叫

據 AlphaMoat 統計,截至 2026-09,ClawGuard 累計下載 3,558 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 3,077 位,在「AI 智慧體」分類(969 個)中排名第 624 位。

累計安裝
113
累計下載
3558
星標
-
全站排名
#3,077
全站前 61% · 「AI 智慧體」前 65%
平台累計安裝累計下載星標評論
ClawHub ↗1133428--
SkillHub ↗1103558-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

ClawGuard 在工具執行前評估呼叫,可記錄呼叫上下文,並在啟用相應配置時攔截高風險操作。評估上下文會傳送給已配置的 LLM;第三方外掛可能廣泛接觸工具呼叫內容,應先審查軟體包版本,並謹慎配置日誌、指標和模型提供方,避擴音示詞或引數包含秘密。不要把閘道器令牌列印到共享日誌或終端。

資料釋出於 2026-10-29

可以用來做什麼

  • 在 OpenClaw 閘道器部署前評估工具呼叫防護配置
  • 檢查風險評估、日誌和攔截選項
  • 排查外掛初始化或認證配置問題

什麼時候用

  • 需要在工具呼叫前增加風險評估和可選攔截時
  • 需要檢查外掛配置對呼叫內容和憑據的影響時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

僅解釋 ClawGuard 的資料流、日誌和攔截設定;不要安裝外掛或修改閘道器配置。
審查這段配置是否可能記錄秘密或令牌,並給出不顯示憑據的核驗方法。

月度資料趨勢

累計下載3558
2136290036632026-03 · 累計下載 22412026-05 · 累計下載 28022026-06 · 累計下載 29322026-07 · 累計下載 32062026-08 · 累計下載 33352026-09 · 累計下載 355826-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-06 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-093558—-
2026-083335+4.0%-
2026-073206+9.3%-
2026-062932+4.6%-
2026-052802—-
2026-032241—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

3.9 KB · ClawHub v0.1.5
---
name: clawguard
description: Install and configure the ClawGuard security plugin - an LLM-as-a-Judge guardrail that detects and blocks risky tool calls
metadata: {"openclaw":{"emoji":"🛡️","homepage":"https://github.com/capsulesecurity/clawguard"}}
---

# 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.
展開全部(共 128 行)
## Prerequisites

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

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

## Installation

Install the plugin from npm:

```bash
openclaw plugins install @capsulesecurity/clawguard
```

After installation, restart the gateway to load the plugin.

## Docker Installation

If running OpenClaw in Docker:

```bash
# 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.<option> <value>`:

| Option | Default | Description |
|--------|---------|-------------|
| enabled | true | Enable/disable the plugin |
| logToolCalls | true | Log tool call JSON to gateway logs |
| securityCheckEnabled | true | Run LLM security evaluation |
| blockOnRisk | true | Block high/critical risk tool calls |
| maxContextWords | 2000 | Session context word limit for evaluation |
| timeoutMs | 15000 | Security check timeout in milliseconds |
| gatewayHost | 127.0.0.1 | Gateway host for LLM calls |
| gatewayPort | 18789 | Gateway port for LLM calls |
| metricsEnabled | true | Enable anonymous usage metrics |

### Example Configuration

```bash
# 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"'
   ```

2. 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:
```bash
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

「AI 智慧體」分類下的熱門技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。