oubliettesecurity/oubliette-dungeon

GitHub: oubliettesecurity/oubliette-dungeon

一个用于LLM应用程序的独立对抗性测试引擎,提供57种内置攻击场景、可视化仪表板和完整的红队测试框架。

Stars: 0 | Forks: 0

# Oubliette Dungeon 用于 LLM 应用程序的独立对抗性测试引擎。针对任何 LLM endpoint 运行红队攻击场景,并测量安全防护措施的有效性。 ## 功能特性 - **57 个内置攻击场景**,涵盖 6 大类(prompt 注入、越狱、信息提取、社会工程学、模型利用、多轮攻击) - **拒绝感知评估** - 减少 LLM 在拒绝语境中提及攻击关键词时的假阳性绕过 - **蜜罐感知评分** - 从 pipeline 元数据中检测 honey token 诱饵 - **多轮攻击支持** - 逐步升级的对话序列 - **Click CLI**,包含 `run`、`stats`、`serve`、`demo`、`replay`、`export` 命令 - **React SPA dashboard**,包含 6 个页面(Command Center、Scenarios、Sessions、Providers、Scheduler、Reports) - **Flask REST API**,位于 `/api/dungeon/` - **工具集成** - PyRIT、DeepTeam、AIX Framework、Garak probe 导入器 - **Cron 调度器**,支持 webhook 通知 - **PDF 报告生成** - **多 Provider 对比** - 并排对多个 LLM 进行基准测试 ## 安装 ``` pip install oubliette-dungeon ``` 包含可选扩展: ``` pip install oubliette-dungeon[flask] # API server + dashboard pip install oubliette-dungeon[pdf] # PDF reports pip install oubliette-dungeon[pyrit] # PyRIT integration pip install oubliette-dungeon[all] # Everything ``` ## 快速开始 ### CLI ``` # 针对目标运行所有场景 oubliette-dungeon run --target http://localhost:5000/api/chat # 显示场景库统计信息 oubliette-dungeon stats # 使用 mock 目标和 seeded 数据启动 demo 模式 oubliette-dungeon demo # 启动 API server + dashboard oubliette-dungeon serve --port 8666 # 导出结果 oubliette-dungeon export --format json --output results.json ``` ### Python API ``` from oubliette_dungeon import RedTeamOrchestrator, RedTeamResultsDB db = RedTeamResultsDB("./results") orch = RedTeamOrchestrator( scenario_file=None, # Uses built-in scenarios target_url="http://localhost:5000/api/chat", results_db=db, ) results = orch.run_all_scenarios() orch.print_summary(results) ``` ### Docker ``` cd docker docker compose up ``` Dashboard 访问地址:`http://localhost:8666`。 ## 目标 API 契约 您的 LLM endpoint 应接受以下内容的 POST 请求: ``` {"message": "the attack prompt text"} ``` 并返回: ``` { "response": "the LLM's response text", "blocked": false, "ml_score": 0.15, "llm_verdict": "SAFE" } ``` 仅 `response` 为必填项。附加字段(`blocked`、`ml_score`、`llm_verdict`)在可用时可实现更丰富的评估。 ## 自定义场景 ``` # my_scenarios.yaml scenarios: - id: CUSTOM-001 name: My Custom Attack category: prompt_injection difficulty: medium description: Custom injection test attack_text: "Ignore all previous instructions..." bypass_indicators: ["system prompt", "here's how"] safe_indicators: ["cannot", "won't"] ``` ``` oubliette-dungeon run --scenarios my_scenarios.yaml --target http://localhost:5000/api/chat ``` ## 开发 ``` git clone https://github.com/oubliette-security/oubliette-dungeon.git cd oubliette-dungeon pip install -e ".[dev]" pytest tests/ -v ``` Dashboard 开发: ``` cd dashboard npm install npm run dev # Vite dev server on :5173, proxies API to :8666 ``` ## 许可证 Apache 2.0 - 详情见 [LICENSE](LICENSE)。 Oubliette Dungeon 是 [Oubliette Security](https://oubliettesecurity.com) 的产品,这是一家由残障退伍军人创办的网络安全公司。
标签:AI安全工具, AI漏洞扫描, AI红队, Click CLI, ESC8, Flask, Garak, Kubernetes 安全, LLM红队测试, PDF报告生成, PyRIT, Python, React, REST API, Syscalls, 信息提取, 合规性测试, 域名收集, 多智能体系统, 多轮对话攻击, 大语言模型安全, 安全基准测试, 安全护栏评估, 对抗性攻击, 无后门, 机密管理, 模型利用, 模型鲁棒性, 社会工程学, 网络安全, 自动化渗透测试, 请求拦截, 调度器, 逆向工具, 隐私保护, 零日漏洞检测