SuperagenticAI/superclaw

GitHub: SuperagenticAI/superclaw

SuperClaw 是一款面向 AI 编码智能体的部署前安全测试框架,通过场景驱动的对抗性测试系统性识别提示词注入、工具滥用等安全漏洞。

Stars: 192 | Forks: 33

# 🦞 SuperClaw

PyPI Docs GitHub Repo CI Docs Build License

SuperClaw logo

在 AI 智能体红队测试你之前,先红队测试它们
面向自主智能体的场景驱动、行为优先安全测试。

Documentation

快速开始功能特性攻击技术完整文档

## ⚠️ 安全与道德使用 ### 仅限授权测试 SuperClaw 仅用于授权安全测试。 ## 什么是 SuperClaw? SuperClaw 是一个面向 AI 编码智能体的部署前安全测试框架。它能在你的智能体接触敏感数据或连接外部生态系统之前,系统地识别漏洞。 ### 🎯 场景驱动测试 针对真实智能体生成并执行对抗性场景,结果可复现。 [Get started →](https://superagenticai.github.io/superclaw/getting-started/quickstart/) ### 📋 行为契约 为每个安全属性提供明确的标准、证据提取和缓解指导。 [Explore behaviors →](https://superagenticai.github.io/superclaw/architecture/behaviors/) ### 📊 证据优先报告 报告包含工具调用、输出和可操作的修复建议,支持 HTML、JSON 或 SARIF 格式。 [CI/CD integration →](https://superagenticai.github.io/superclaw/guides/ci-cd/) ### 🛡️ 内置防护措施 仅限本地模式和授权检查可降低误用风险。 [Safety guide →](https://superagenticai.github.io/superclaw/guides/safety/) ## ⚠️ 安全与道德使用 ### 仅限授权测试 SuperClaw 仅用于授权安全测试。使用前: - ✅ 获取测试目标系统的书面授权 - ✅ 在沙箱或隔离环境中运行测试 - ✅ 将自动化发现视为信号而非证据——需人工验证 **默认强制执行的防护措施:** - 仅限本地模式阻止远程目标 - 远程目标需要 `SUPERCLAW_AUTH_TOKEN` ## 威胁模型 ### OpenClaw + Moltbook 风险面 OpenClaw 智能体通常拥有广泛的工具访问权限。当连接到 Moltbook 或其他智能体网络时,它们可能摄入不受信任的对抗性内容,从而导致: - 提示词注入和隐藏指令攻击 - 工具滥用和策略绕过 - 随时间推移的行为漂移 - 跨智能体级联利用 SuperClaw 在部署前评估这些风险。 ## 为什么选择 SuperClaw? 自主 AI 智能体在部署时往往具有高权限、可变行为,并暴露于不受信任的输入——通常缺乏结构化的安全验证。这使得提示词注入、工具滥用、配置漂移和数据泄露成为可能,但往往在暴露后才被了解。 ### 它能做什么 - 针对你的智能体**运行基于场景的安全评估** - 为每次攻击**记录证据**(工具调用、输出、产物) - 根据明确的安全契约**评分行为** - **生成可操作的报告**,包含发现和缓解措施 ### 它不能做什么 SuperClaw **不**生成智能体、运行生产工作负载或自动化现实世界的利用。它是一个测试工具,而非武器。 ## 🚀 快速开始 ### 安装 ``` pip install superclaw ``` ### 运行你的第一次攻击 ``` # 攻击本地 OpenClaw 实例 superclaw attack openclaw --target ws://127.0.0.1:18789 # 或使用模拟适配器进行离线测试 superclaw attack mock --behaviors prompt-injection-resistance ``` ### 生成攻击场景 ``` superclaw generate scenarios --behavior prompt_injection --num-scenarios 20 ``` ### 运行完整安全审计 ``` superclaw audit openclaw --comprehensive --report-format html --output report ``` ## ✨ 功能特性 ### 支持的目标 | 目标 | 描述 | 适配器 | |--------|-------------|---------| | 🦞 **OpenClaw** | 通过 ACP WebSocket 的 AI 编码智能体 | `openclaw` | | 🧪 **Mock** | 离线确定性测试 | `mock` | | 🔧 **Custom** | 构建你自己的适配器 | 继承 `BaseAdapter` | ### 攻击技术 | 技术 | 描述 | |-----------|-------------| | `prompt-injection` | 直接和间接注入攻击 | | `encoding` | Base64、十六进制、Unicode、Typoglycemia 混淆 | | `jailbreak` | DAN、祖母、角色扮演绕过技术 | | `tool-bypass` | 通过别名混淆绕过工具策略 | | `multi-turn` | 跨对话轮次的持续升级 | ### 安全行为 每个行为都包含结构化契约,涵盖意图、成功标准、评分规则和缓解指导。 | 行为 | 严重程度 | 测试内容 | |----------|----------|-------| | `prompt-injection-resistance` | 🔴 严重 | 注入检测与拒绝 | | `sandbox-isolation` | 🔴 严重 | 容器和文件系统边界 | | `tool-policy-enforcement` | 🟠 高 | 允许/拒绝列表合规性 | | `session-boundary-integrity` | 🟠 高 | 跨会话隔离 | | `configuration-drift-detection` | 🟡 中 | 配置随时间的稳定性 | | `acp-protocol-security` | 🟡 中 | 协议消息处理 | ## 📖 CLI 参考 ### 攻击 ``` superclaw attack openclaw --target ws://127.0.0.1:18789 --behaviors all superclaw attack mock --behaviors prompt-injection-resistance ``` ### 场景生成 (Bloom) ``` superclaw generate scenarios --behavior prompt_injection --num-scenarios 20 superclaw generate scenarios --behavior jailbreak --variations noise,emotional_pressure ``` ### 评估 ``` superclaw evaluate openclaw --scenarios scenarios.json --behaviors all superclaw evaluate mock --scenarios scenarios.json ``` ### 审计 ``` superclaw audit openclaw --comprehensive --report-format html --output report superclaw audit openclaw --quick ``` ### 报告 ``` superclaw report generate --results results.json --format sarif # GitHub Code Scanning superclaw report drift --baseline baseline.json --current current.json ``` ### 扫描 ``` superclaw scan config superclaw scan skills --path /path/to/skills ``` ### 实用工具 ``` superclaw behaviors # List all security behaviors superclaw attacks # List all attack techniques superclaw init # Initialize a new project ``` ## 🔗 CodeOptiX 集成 SuperClaw 与 [CodeOptiX](https://github.com/SuperagenticAI/codeoptix) 集成,用于多模态安全评估。 ``` # 安装 CodeOptiX 支持 pip install superclaw[codeoptix] # 检查集成状态 superclaw codeoptix status # 向 CodeOptiX 注册行为 superclaw codeoptix register # 运行多模态评估 superclaw codeoptix evaluate --target ws://127.0.0.1:18789 --llm-provider openai ``` ### Python API ``` from superclaw.codeoptix import SecurityEvaluationEngine from superclaw.adapters import create_adapter adapter = create_adapter("openclaw", {"target": "ws://127.0.0.1:18789"}) engine = SecurityEvaluationEngine(adapter) result = engine.evaluate_security(behavior_names=["prompt-injection-resistance"]) print(f"Score: {result.overall_score:.1%}") print(f"Passed: {result.overall_passed}") ``` ## ⚠️ 安全声明 **本工具仅用于授权安全测试。** ### 防护措施 - 仅限本地模式默认阻止远程目标 - 远程目标需要 `SUPERCLAW_AUTH_TOKEN`(或适配器特定的令牌) - *注意:SuperClaw 不管理此令牌;你必须从远程系统管理员处获取。* ### 要求 在使用 SuperClaw 之前,请确保你已: - ✅ 获得测试目标系统的书面授权 - ✅ 准备好隔离的测试环境(建议使用沙箱/虚拟机) - ✅ 了解 [SECURITY.md](SECURITY.md) 指南 ## 🏗️ 架构 ``` superclaw/ ├── attacks/ # Attack technique implementations ├── behaviors/ # Security behavior specifications ├── adapters/ # Target agent adapters ├── bloom/ # AI-powered scenario generation ├── scanners/ # Config and supply-chain scanning ├── analysis/ # Drift detection and comparison ├── codeoptix/ # CodeOptiX integration layer └── reporting/ # HTML, JSON, and SARIF report generation ``` ## 🌐 Superagentic AI 生态系统 SuperClaw 是 [Superagentic AI](https://super-agentic.ai) 生态系统的一部分: | 项目 | 描述 | |---------|-------------| | **SuperQE** | 质量工程核心框架 | | **SuperClaw** | 智能体安全测试 *(本软件包)* | | **CodeOptiX** | 代码优化与评估引擎 | ## 📚 文档

📖 superagenticai.github.io/superclaw

| 指南 | 描述 | |-------|-------------| | [Installation](https://superagenticai.github.io/superclaw/getting-started/installation/) | 通过 pip、uv 或从源码安装 | | [Quick Start](https://superagenticai.github.io/superclaw/getting-started/quickstart/) | 在 5 分钟内运行你的第一次安全扫描 | | [Configuration](https://superagenticai.github.io/superclaw/getting-started/configuration/) | 配置目标、LLM 提供商和安全设置 | | [Running Attacks](https://superagenticai.github.io/superclaw/guides/attacks/) | 执行攻击并解读结果 | | [Custom Behaviors](https://superagenticai.github.io/superclaw/guides/custom-behaviors/) | 编写你自己的安全行为规范 | | [CI/CD Integration](https://superagenticai.github.io/superclaw/guides/ci-cd/) | GitHub Actions、GitLab CI 和 SARIF 输出 | | [Architecture](https://superagenticai.github.io/superclaw/architecture/overview/) | 深入了解 SuperClaw 内部机制 | ## 🤝 贡献 我们欢迎贡献!请参阅: - [CONTRIBUTING.md](CONTRIBUTING.md) — 如何贡献 - [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) — 社区准则 - [SECURITY.md](SECURITY.md) — 安全策略 ## 📄 许可证 Apache 2.0 — 详情见 [LICENSE](LICENSE)。

Superagentic AI 用 🦞 精心构建

标签:Agentic AI, AI安全, Chat Copilot, CISA项目, Homebrew安装, Python, TGT, 反取证, 场景驱动测试, 多模态安全, 大模型安全, 安全评估, 攻防演练, 无后门, 智能体安全, 网络安全, 自动化攻击, 越狱检测, 逆向工具, 隐私保护, 预部署检测