AlbMej/damn-vulnerable-ai-agent
GitHub: AlbMej/damn-vulnerable-ai-agent
一个故意设计存在漏洞的AI Agent聊天应用,内置多个角色场景,用于安全研究人员测试和练习提示注入、工具滥用及数据泄露等针对大模型的攻击手法。
Stars: 0 | Forks: 0
# 极脆弱的 AI Agent
本项目是一个使用 FastAPI 和 HTMX 构建的多页 Web 应用程序。它包含 3 个故意设计存在漏洞的 AI 聊天机器人角色,专用于安全研究。
## 项目结构
```
├── main.py # Central FastAPI app, routing, and session management
├── llm.py # OpenAI-compatible API client and tool-call executor
├── auth.py # Super basic SQLite-based user authentication
├── requirements.txt # List of static Python dependencies
├── pyproject.toml # Modern uv project configuration
├── data/
│ └── users.db # SQLite database for storing registered accounts
├── static/ # Raw CSS assets for our custom UI designs
│ ├── bullseye.css # Custom design for Bullseye
│ ├── dividedhazard.css # Custom healthcare portal design
│ └── idlethat.css # Dark-mode cloud console design
└── templates/ # Jinja2 HTML templates
├── base.html # Main HTML wrapper (HTMX setup, favicons)
├── login.html # Shared login and signup UI
├── bullseye.html # Persona-specific page layout
├── ... # Other persona layouts (dividedhazard, idlethat)
└── partials/ # HTMX-swappable UI components
├── message.html # Chat message bubbles
└── tool_call.html # Visual feedback for LLM tool execution
```
## 设置
首先,配置你的虚拟环境并使用 `uv` 安装所需的包:
```
uv pip install -r requirements.txt
```
### 可选:本地 LLM 后端
如果你希望使用 `vLLM` 在本地托管模型(需要 GPU),请安装开发依赖:
```
uv sync --group dev
```
## 运行应用程序
要在本地运行应用程序,请启动 Uvicorn 服务器:
```
uv run uvicorn main:app --reload --port 8080
```
服务器运行后,你可以通过 Web 浏览器访问以下三个场景:
- [Bullseye 场景](http://localhost:8080/bullseye)
- [DividedHazard 场景](http://localhost:8080/dividedhazard)
- [IDLEthat 场景](http://localhost:8080/idlethat)
系统启用了一个非常基础的 SQLite 身份验证系统。在进入每个独立的角色场景时,系统会提示你注册并登录。
标签:AI安全, AV绕过, Chat Copilot, CISA项目, FastAPI, HTMX, Jinja2, LLM安全研究, OPA, OpenAI, Petitpotam, Python, SQLite, vLLM, 内存规避, 多页面应用, 大模型安全, 大模型漏洞, 安全测试, 工具滥用, 提示注入, 攻击性安全, 数据窃取, 无后门, 网络安全, 逆向工具, 隐私保护, 集群管理, 靶场