A multi-agent system audit pipeline that orchestrates 50+ AI agents to discover, evaluate, and verify security findings on Linux systems. Built on Claude Code with a custom MCP server for agent spawning.
The pipeline runs in 5 phases:
- Discovery — 16 worker agents (8 domains x 2 models) independently collect system facts
- Evaluation — 8 evaluator agents analyze each domain's findings from both models
- Merge — The manager deduplicates, assigns finding IDs, and classifies for verification
- Verification — Opus verifier agents confirm findings against runtime state and assign severity
- Report — A final report groups findings by severity with fixes and evidence
The dual-model approach (Sonnet + Opus) catches ~15% more findings than either model alone. An evaluator layer prevents the context-window problem where merging 800+ facts loses lower-priority observations.
See docs/architecture.md for detailed diagrams and design decisions.
- Claude Code — Anthropic's CLI tool (install guide)
- Claude Code — with API key or Pro/Max subscription (subscription avoids per-token costs for 50+ agents)
- Python 3.11+
- pip — For installing the MCP dependency
- sudo access on the target machine (the audit agents need to read system state)
cd mcp-spawn-agent
pip install -r requirements.txtCopy examples/mcp-config.json to your Claude Code MCP config and update the path:
# Edit ~/.claude/mcp.json (or merge into your existing config)
{
"mcpServers": {
"mcp-spawn-agent": {
"command": "python3",
"args": ["/absolute/path/to/claude-audit-pipeline/mcp-spawn-agent/server.py"]
}
}
}Start Claude Code and paste the contents of prompts/ensemble-auditor-v3.md:
claude
# Then paste the prompt content, or:
cat prompts/ensemble-auditor-v3.md | claude -p --dangerously-skip-permissionsOutput goes to ~/audits/YYYY-MM-DD/.
All configuration is via environment variables (set in mcp.json or your shell):
| Variable | Default | Description |
|---|---|---|
CLAUDE_BIN |
claude |
Path to the Claude CLI binary |
PYTHON_BIN |
python3 |
Python interpreter for child MCP servers |
SPAWN_DEFAULT_MODEL |
opus |
Default model for spawned agents |
SPAWN_MAX_PARALLEL |
3 |
Max agents running simultaneously per wave |
SPAWN_MAX_DEPTH |
3 |
Max recursive spawning depth |
SPAWN_AGENT_TIMEOUT |
900 |
Default timeout per agent (seconds) |
SPAWN_MAX_OUTPUT_BYTES |
50000 |
Max stdout captured per agent |
SPAWN_CHILD_FLAGS_JSON |
["--setting-sources","local","--dangerously-skip-permissions"] |
CLI flags passed to child agents |
claude-audit-pipeline/
├── README.md # This file
├── mcp-spawn-agent/
│ ├── server.py # MCP server — spawns claude -p subprocesses
│ └── requirements.txt # Python deps
├── prompts/
│ └── ensemble-auditor-v3.md # Master orchestration prompt
├── examples/
│ ├── mcp-config.json # Template MCP config for Claude Code
│ └── sample-output/ # Synthetic example output
│ ├── state.json
│ ├── phase1/
│ │ └── 01-processes-sonnet/
│ │ └── index.json
│ └── phase2/
│ ├── findings.json
│ └── FND-001/
│ └── verify.md
└── docs/
└── architecture.md # Mermaid diagrams + pipeline explanation
Edit the prompt in prompts/ensemble-auditor-v3.md. Add a new domain number (e.g., 09 Containers)
to the domain list and update the wave schedule.
The prompt specifies model=sonnet and model=opus for workers. You can change these
to any model supported by your Claude subscription. The evaluators and verifiers default
to Opus for analytical quality.
Edit the ROLES dict in server.py to add domain-specific system prompts. Reference them
with role="your-role-name" in spawn calls.
Set SPAWN_MAX_PARALLEL higher if your subscription supports more concurrent sessions.
The default of 3 is conservative and works with Pro subscriptions.
The examples/sample-output/ directory contains synthetic (fictional) example data showing
the structure of a completed audit. No real system data is included.
The spawn-agent server is a Python MCP server that:
- Receives tool calls from Claude Code via stdio JSON-RPC
- Translates
spawn_agent/spawn_batchcalls intoclaude -psubprocess invocations - Manages parallel execution in configurable wave sizes
- Supports recursive depth (agents can spawn sub-agents up to
MAX_DEPTHlevels) - Tracks session statistics (spawned/completed/failed counts)
- Writes debug
.cmdline.txtfiles for every agent run
See docs/architecture.md for the full architecture diagram.