360 Secure SkillHub
360 安全技能中心

Clawguard Skill

这是OpenClaw的出站数据防泄漏工具,核心功能是拦截所有出站工具调用,通过60+硬编码正则、熵分析扫描密钥、PII等敏感数据,支持自定义规则,可执行阻止、脱敏或放行操作。工具完全本地运行,无外部连接,仅存储扫描元数据不保留敏感内容,适用于AI Agent对外调用时防范数据泄露场景,支持一键安装、随OpenClaw自动启动,提供仪表盘管理配置。

stanxy
stanxy
热度 29.28
最近更新 2026-05-18 12:07:34
分类:安全依赖:代码执行 / 读写文件 / MCP 服务应用场景:数据处理 / 自动化脚本 / 法律文档

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add clawguard-skill
Metadata
name
clawwall
version
0.3.0
description
Outbound DLP for OpenClaw — hard regex blocks secrets & PII from leaving the machine. Domain control, no LLM.
author
Stanxy
openclaw
{"requires":{"bins":["python3","pip","node","npm"],"envs":[]},"hooks":[{"event":"gateway:startup","handler":"hooks/openclaw/dist/handler.js","export":"onStartup"}]}

ClawWall — Outbound DLP for OpenClaw

GitHub: https://github.com/Stanxy/clawguard PyPI: https://pypi.org/project/clawwall

ClawWall sits between your AI agent and the outside world. Every outbound tool call is intercepted and scanned against 60+ hard-coded patterns before anything leaves the machine. If content matches — it is blocked or redacted. No LLM, no approximation: regex and entropy only.

Setup

One command:

bash setup.sh

This installs the Python service, builds the plugin and hook, registers the plugin in your OpenClaw config, sets up a system service, and verifies the health endpoint.

The gateway:startup hook auto-starts the service whenever OpenClaw boots — no manual clawwall command needed.

Trust & Permissions

What this installs:

Component What It Does
Python service (port 8642) Receives every outbound tool call for scanning
OpenClaw plugin (before_tool_call) Intercepts outbound content and routes to the service
Startup hook (gateway:startup) Auto-starts the service when OpenClaw boots
SQLite database Stores scan metadata (finding type, severity, action, duration)
systemd/launchd service Fallback auto-start via OS service manager

What the database stores: finding type, severity, position offsets, action taken, and duration. It never stores raw content, secrets, or PII values.

What it does NOT do: no telemetry, no external connections, no data leaves the machine. The service is fully local.

Verify Installation

# Health check
curl -s http://127.0.0.1:8642/api/v1/health

# Test scan
curl -s -X POST http://127.0.0.1:8642/api/v1/scan \
  -H "Content-Type: application/json" \
  -d '{"content": "key=AKIAIOSFODNN7EXAMPLE"}'

# Dashboard
open http://127.0.0.1:8642/dashboard

What ClawWall Detects

  • Secrets (52 patterns): AWS, GCP, Azure, GitHub, GitLab, Stripe, Square, PayPal, Slack, Discord, Telegram, Twilio, SSH/PGP private keys, database URIs, JWT/Bearer tokens, SaaS API keys, and more
  • PII (10 patterns): SSNs, credit cards (Luhn-validated), emails, phone numbers, IP addresses
  • Entropy analysis: high-entropy strings that don't match any known pattern
  • Custom patterns: user-defined regex via policy YAML

Configuration

Environment variables (all prefixed CLAWGUARD_):

Variable Default Description
CLAWGUARD_HOST 0.0.0.0 Bind address
CLAWGUARD_PORT 8642 Port
CLAWGUARD_DATABASE_URL sqlite+aiosqlite:///~/.config/clawwall/clawwall.db Database path
CLAWGUARD_POLICY_PATH ~/.config/clawwall/policy.yaml Policy file
CLAWGUARD_LOG_LEVEL INFO Log verbosity

Policy

Default policy redacts all findings. Edit via the dashboard or ~/.config/clawwall/policy.yaml:

default_action: REDACT      # BLOCK | REDACT | ALLOW
redaction:
  strategy: mask             # mask | hash | remove
  mask_char: "*"
  mask_preserve_edges: 4
destination_allowlist: []    # bypass scanning for trusted destinations
destination_blocklist: []    # always reject these destinations
custom_patterns: []          # add your own regex patterns
disabled_patterns: []        # disable specific built-in patterns by name

Policy evaluation order: severity overrides > destination allowlist > destination blocklist > destination rules > agent rules > default action.

Agent Instructions

You are operating behind ClawWall. All outbound tool calls are scanned before leaving the machine using hard pattern matching — not an LLM.

Result Meaning
ALLOW No sensitive data detected — call went through
REDACT Sensitive portions were masked before sending
BLOCK Call rejected — nothing was sent

Best practices:

  • Never include raw API keys, tokens, or PII in outbound calls
  • Reference credentials by name ($OPENAI_API_KEY), not by value
  • If blocked, check findings to see what matched, remove the sensitive data, and retry
  • False positive? Tell the user to adjust the policy via the dashboard at http://localhost:8642/dashboard

Troubleshooting

Problem Solution
Service not starting Check ~/.config/clawwall/clawwall.log for errors
Port 8642 in use Another process is using the port — check with lsof -i :8642
Plugin not intercepting Verify plugin is registered in ~/.openclaw/openclaw.json
False positives Disable specific patterns via disabled_patterns in policy YAML
Hook not firing Rebuild hook: cd hooks/openclaw && npm run build
clawwall not found Ensure pip install directory is on PATH, or use python3 -m clawguard