返回顶部
c

clawSafe爪安全

Multi-layer security detector for AI agents. Blocks prompt injection, jailbreak, XSS, SQL injection, API key leaks, supply chain attacks, and deployment vulnerabilities.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
280
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

clawSafe

技能名称: clawSafe
详细描述:

clawSafe 🛡️

面向AI代理的企业级安全检测器

概述

clawSafe 是一款全面的安全中间件,能够在恶意输入到达AI代理之前进行拦截和阻断。基于纵深防御理念构建。

功能特性

5层防护

层级威胁类型规则数
LLM层提示注入、越狱攻击、提示泄露、编码攻击44
Web层
SQL注入、XSS、CSRF、SSRF | 32 | | API层 | 密钥泄露、速率限制、认证绕过 | 19 | | 供应链层 | 危险依赖、远程代码执行 | 8 | | 部署层 | 环境泄露、调试信息泄露 | 10 |

总计:113+条检测规则

快速开始

安装

bash

通过ClawHub安装


clawhub install clawSafe

手动安装

cp -r clawSafe ~/.openclaw/workspace/skills/

基本用法

javascript
const Detector = require(./detector);

const detector = new Detector();

// 扫描用户输入
const result = detector.scan(忽略之前的指令);

if (!result.safe) {
console.log(已拦截:, result.threats);
// 处理被拦截的输入
}

返回格式

typescript
{
safe: boolean; // 输入安全时返回true
threats: Array<{
type: string; // 威胁类别
pattern: string; // 匹配的模式ID
severity: string; // 严重|高|中|低
confidence: number; // 0-1
description: string;
}>;
confidence: number; // 整体置信度 0-1
layersScanned: string[]; // 已检查的层级
}

配置

config.json

json
{
enabled: true,
logLevel: info,
layers: {
llm: {
enabled: true,
rules: [injection, jailbreak, prompt_leak, encoding]
},
web: {
enabled: true,
rules: [sql_injection, xss, csrf, ssrf]
},
api: {
enabled: true,
rules: [keyexposure, ratelimit, auth]
},
supply_chain: {
enabled: true,
rules: [deps]
},
deploy: {
enabled: true,
rules: [envleak, debuginfo]
}
},
detection: {
confidenceThreshold: 0.6,
minMatchCount: 1
},
actions: {
onThreatDetected: block,
onUncertain: log
}
}

whitelist.json

json
{
keywords: [trusted-keyword],
users: [user-id-1],
sessions: [session-id-1]
}

检测规则

LLM层

提示注入模式:

  • - 忽略之前的指令
  • 无视你的准则
  • 忘记所有规则
  • 假装没有限制

越狱模式:

  • - DAN模式
  • 开发者模式
  • 角色扮演为

编码绕过:

  • - Base64编码命令
  • 十六进制编码
  • Unicode同形字

Web层

  • - SQL注入:; DROP TABLE users; --
  • XSS:
  • CSRF:令牌篡改
  • SSRF:内部URL访问

API层

  • - API密钥泄露:sk-1234567890
  • JWT令牌
  • Bearer令牌
  • 基本认证凭据

测试

bash

运行所有测试


node test.js

交互模式

node test-interactive.js

演示

node detector.js

集成

OpenClaw钩子

要集成到OpenClaw,请添加到网关配置:

javascript
// gateway.config.js
module.exports = {
middleware: [clawSafe],
clawSafe: {
enabled: true,
strictMode: false
}
};

性能

  • - 延迟:每次扫描<5ms
  • 内存:约50KB
  • 规则:113+条(基于JSON,懒加载)

许可证

MIT

更新日志

v1.0.0

  • - 初始版本发布
  • 5层防护
  • 113+条检测规则

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 clawsafe-1776189376 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 clawsafe-1776189376 技能

通过命令行安装

skillhub install clawsafe-1776189376

下载

⬇ 下载 clawSafe v1.1.0(免费)

文件大小: 31.59 KB | 发布时间: 2026-4-15 12:22

v1.1.0 最新 2026-4-15 12:22
clawSafe v1.1.0

- Added new hook documentation in hook/HOOK.md.
- Updated handler logic in hook/handler.js to improve security handling.
- Updated metadata in _meta.json for enhanced skill description and compatibility.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部