dmlawcareer/AI-Red-Teaming-Framework
GitHub: dmlawcareer/AI-Red-Teaming-Framework
企业级本地隔离的 LLM/RAG 安全仿真框架,用于评估和防御间接 Prompt 注入、RAG 投毒及社交工程等高影响力威胁。
Stars: 0 | Forks: 0
# AI 与以人为本的 Red Teaming 框架
一个企业级、本地隔离的仿真框架,旨在评估、建立基线,并在结构上防御大型语言模型 (LLM) pipeline 和检索增强生成 (RAG) 架构免受高影响力威胁向量的攻击。
## 🏗️ 架构蓝图
## ├── modules/
│ ├── 01_human_risk/ # 借口与社交工程仿真 (ZPhisher)
│ ├── 02_infrastructure/ # 本地 Ollama 与 Llama 3.1 环境部署
│ └── 03_adversarial_ai/ # 程序化 Exploit 与防御工程
│ ├── indirect_test.py # Injection 基线与强化 Delimiter 脚本
│ └── rag_poison_test.py # RAG Poisoning 与上游隔离 pipeline
└── README.md
## 🚀 核心组件与测试执行
### 1. 间接 Prompt Injection 基线与强化
* **模块路径:** `modules/03_adversarial_ai/indirect_test.py`
* **漏洞目标:** 当用户提供的不可信语义数据混入 LLM 的活跃 token 执行流时,就会发生信任边界混淆,从而允许被动指令覆盖管理参数。
* **防御缓解:** 通过隔离的 XML delimiter 边界进行动态上下文封装,并结合确定性的结构性差评规则指令。
```
# 执行自动化注入测试套件
python3 modules/03_adversarial_ai/indirect_test.py
2. Retrieval-Augmented Generation (RAG) Poisoning & Active Quarantine
Module Pathway: modules/03_adversarial_ai/rag_poison_test.py
Vulnerability Target: Data supply chain contamination. Attackers strategically plant malicious instructions inside internal or public knowledge bases, forcing automated RAG ingestion tools to fetch payloads that compromise system availability or data integrity.
Defense Mitigation: An upstream regex-driven processing layer that proactively scans vector database returns and enforces string quarantines before content enters the model's context window.
# 执行自动化 RAG 投毒模拟与防御 pipeline
python3 modules/03_adversarial_ai/rag_poison_test.py
3. Human Risk Social Engineering Simulation
Module Pathway: modules/01_human_risk/
Infrastructure Target: Initial boundary ingress emulation utilizing automated phishing reverse-proxies to model credential harvesting and measure organizational human vectors.
```
标签:AI安全, AI风险缓解, Chat Copilot, CISA项目, DLL 劫持, Gradle, Python, RAG, 大语言模型, 文档安全, 无后门, 漏洞测试, 红队评估, 逆向工具, 配置审计