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
累计下载
3,558
星标
-
全站排名
#3,077
全站前 61% · 「AI 智能体」前 65%
平台累计安装累计下载星标评论
ClawHub ↗1133,428--
SkillHub ↗1103,558-—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

ClawGuard 在工具执行前评估调用,可记录调用上下文,并在启用相应配置时拦截高风险操作。评估上下文会发送给已配置的 LLM;第三方插件可能广泛接触工具调用内容,应先审查软件包版本,并谨慎配置日志、指标和模型提供方,避免提示词或参数包含秘密。不要把网关令牌打印到共享日志或终端。

资料发布于 2026-10-29

可以用来做什么

  • 在 OpenClaw 网关部署前评估工具调用防护配置
  • 检查风险评估、日志和拦截选项
  • 排查插件初始化或认证配置问题

什么时候用

  • 需要在工具调用前增加风险评估和可选拦截时
  • 需要检查插件配置对调用内容和凭据的影响时

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

仅解释 ClawGuard 的数据流、日志和拦截设置;不要安装插件或修改网关配置。
审查这段配置是否可能记录秘密或令牌,并给出不显示凭据的核验方法。

月度数据趋势

累计下载3,558
2,1362,9003,6632026-03 · 累计下载 2,2412026-05 · 累计下载 2,8022026-06 · 累计下载 2,9322026-07 · 累计下载 3,2062026-08 · 累计下载 3,3352026-09 · 累计下载 3,55826-0326-09
星标-
0112026-03 · 星标 -2026-05 · 星标 -2026-06 · 星标 -2026-07 · 星标 -2026-08 · 星标 -2026-09 · 星标 -26-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-093,558—-
2026-083,335+4.0%-
2026-073,206+9.3%-
2026-062,932+4.6%-
2026-052,802—-
2026-032,241—-

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),按月更新。口径说明见数据方法。