trust-openclaw 是做什么的?
为基于OpenClaw的TypeScript智能体提供欧盟AI法案合规支持,包括审计日志、PII标记化、同意拦截和提示注入检测。
概述
该技能为使用OpenClaw框架构建的TypeScript AI代理添加了关键的合规功能。它帮助您满足欧盟AI法案对透明度、数据保护和安全性的要求。
功能
- 审计日志:记录所有代理操作,包括输入、输出、时间戳和用户ID。
- PII标记化:自动检测并标记化个人身份信息(如姓名、邮箱、电话号码)。
- 同意拦截:在处理用户数据前要求并获得用户明确同意。
- 提示注入检测:识别并阻止恶意提示注入攻击。
安装
npm install @komafon/trust-openclaw
使用
import { TrustOpenClaw } from '@komafon/trust-openclaw';
const trust = new TrustOpenClaw({
auditLog: true,
piiTokenization: true,
consentGating: true,
promptInjectionDetection: true
});
// 在OpenClaw代理中使用
trust.execute(agent, input);
配置
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
auditLog | boolean | true | 启用审计日志记录 |
piiTokenization | boolean | true | 启用PII标记化 |
consentGating | boolean | true | 启用同意拦截 |
promptInjectionDetection | boolean | true | 启用提示注入检测 |
环境变量
TRUST_OPENCLAW_LOG_LEVEL:设置日志级别(debug,info,warn,error)TRUST_OPENCLAW_PII_PATTERNS:自定义PII检测模式(JSON格式)
许可证
MIT