Carlos-Projects/agenthive
GitHub: Carlos-Projects/agenthive
面向多 agent AI 系统的攻击模拟框架,对多 agent 交互中特有的攻击行为进行建模与安全评估。
Stars: 0 | Forks: 0
# AgentHive
面向 AI 系统的多 agent 攻击模拟框架。
[](https://pypi.org/project/agenthive-sim/)
[](https://pypi.org/project/agenthive-sim/)
[](LICENSE)
[](https://github.com/Carlos-Projects/agenthive/actions/workflows/ci.yml)
AgentHive 将 [mcpwn](https://github.com/Carlos-Projects/mcpwn) 从单 agent 领域扩展到**多 agent 领域**,对只有在多个 AI agent 相互交互时才可能发生的攻击进行建模。
## 安装
```
pip install agenthive-sim
```
用于开发:
```
pip install -e ".[dev,lab]"
```
## 快速开始
```
# 生成 scenario template
agenthive scenario my-scenario -o scenario.yaml
# 运行 simulation
agenthive simulate scenario.yaml -v
# 列出可用的 attack categories
agenthive list-scenarios
# 启动 vulnerable lab server
agenthive lab
```
## 场景 YAML 格式
场景定义了 agent 拓扑结构和要模拟的攻击:
```
name: my-scenario
description: "Multi-agent SSRF through agent chain"
max_steps: 50 # max simulation steps before timeout
timeout_seconds: 300
agents:
- role: attacker # attacker | victim | observer | coordinator
name: red-agent-1
capabilities:
- prompt_injection
- tool_manipulation
- role: victim
name: blue-agent-1
capabilities:
- data_processing
- tool_usage
- role: victim
name: blue-agent-2
capabilities:
- collaboration
- file_operations
- role: observer
name: observer-1
capabilities: [monitoring]
attacks:
- category: tool_drift # must match AttackCategory
name: "Tool Drift"
description: "Drift tool definitions via shared memory"
severity: high # critical | high | medium | low | info
parameters: {} # attack-specific parameters
mitre_atlas: ["ATLAS-001"]
metadata:
environment: lab
difficulty: medium
```
## 生态集成
AgentHive 与 MCP 安全生态系统集成:
- **mcp-taxonomy**:可通过 `agenthive_finding_to_taxonomy()` 转换发现的漏洞,以进行统一关联
- **MCPscop**:SARIF 和 JSON 报告可由 MCPscop 仪表板使用
- **mcpwn**:将 mcpwn 模式从单 agent 扩展到多 agent 领域
## 攻击场景
| 类别 | 描述 | 严重程度 |
|---|---|---|
| `tool_drift` | 利用 agent 之间共享内存导致的工具派生 | 高 |
| `long_horizon` | 顺序跨越多个 agent 的基于 RL 的攻击 | 严重 |
| `collaboration_attack` | 篡改 agent 之间的协作 | 高 |
| `authority_hijack` | 劫持 agent 之间的权限链 | 严重 |
| `cross_agent_injection` | 在 agent 之间传播的 prompt 注入 | 严重 |
| `multi_agent_ssrf` | 通过多个 agent 协同进行的 SSRF | 高 |
| `swarm_poisoning` | 毒害单个 agent 并传播至整个集群 | 严重 |
| `identity_spoofing` | agent 之间的身份欺骗 | 高 |
## 学术参考
- [Evo-Attacker: Memory-Augmented RL for Long-Horizon Tool Attacks](https://arxiv.org/abs/2605.25389) (ACL 2026)
- [Memory-Induced Tool-Drift in LLM Agents](https://arxiv.org/abs/2605.24941)
- [Behind EvoMap: Agent-to-Agent Collaboration Network](https://arxiv.org/abs/2605.25815)
- [Authority Frontier Framework for Runtime Actuarial Control](https://arxiv.org/abs/2605.25632)
- [Deep-Research Agents Can Be Poisoned](https://arxiv.org/abs/2605.24294) (Shmatikov et al.)
- [MITRE ATLAS — Multi-Agent System Attack Patterns](https://atlas.mitre.org/techniques/)
## 生态系统
- 扩展了 [mcpwn](https://github.com/Carlos-Projects/mcpwn) — 相同的技术栈,多 agent 领域
- 使用了 [mcp-taxonomy](https://github.com/Carlos-Projects/mcp-taxonomy)
- 报告可供 [MCPscop](https://github.com/Carlos-Projects/mcpscope) 使用
## 许可证
MIT — 见 [LICENSE](LICENSE)
标签:AI安全, Chat Copilot, LLM攻防, Python, 域名收集, 多智能体模拟, 多语言支持, 安全测试框架, 搜索语句(dork), 无后门, 逆向工具