N1nEmAn/sapper-v2
The first fruit of the Nüwa tree — an autonomous AI pentest legion (634-team champion, 8h unattended, 1B tokens beat 4.5B). Not just a tool: evolvable by design. Grow your own fruit on the Nüwa Foundation (Create/Language/History).
What it solves
sapper-v2 tackles the problem that a single, even very smart AI model is not enough for complex, long-horizon tasks like penetration testing. Instead, it uses a team of AI agents that specialize, cooperate, and pass knowledge down through a structured memory. This approach allowed it to win a major cybersecurity competition using far fewer tokens than rivals, showing that division of labor and collaboration can beat raw intelligence alone.
How it works
Three core capabilities form the foundation:
- Create: The system can spawn new AI agents by launching them in terminal windows (via tmux), like a human starting a new session.
- Language: Agents communicate by typing messages into each other's interfaces, just as humans chat.
- History: All knowledge is stored in a layered fact-intent graph with three levels: title, summary, and full evidence document. This lets agents quickly grasp the gist and drill down only when needed, avoiding context overload.
On top of this foundation, a commander AI reads the current state, makes decisions, and dispatches tasks to specialized agents: generals handle tough targets, soldiers do mass scanning, and scouts perform quick recon. A separate watchdog script (with zero strategy) keeps everything alive, restarting crashed agents and managing key rotation.
The system also uses an "economy" of model tiers: the commander and generals run a stronger (and more expensive) model, while soldiers and scouts use a cheaper, faster one. This balances cost and capability, letting the elite brains plan and the light brains execute.
Over time, the AI itself invented new roles and behaviors, such as a dedicated "signalman" to collect flags, performance reviews for unproductive soldiers, and a rotation system where exhausted agents leave behind written lessons for their successors.
Who it's for
This project is aimed at security professionals performing authorized penetration tests, especially in time-limited or large-scale engagements where a team of AI agents can cover more ground. It is also relevant for researchers studying multi-agent collaboration and emergent behavior in AI systems. The README strongly emphasizes that this is for authorized security testing only and includes a disclaimer.
Highlights
- Won first place in the 3rd Tencent Cloud Intelligent Attack-Defense Challenge (80.18/100) using only 1B tokens, while the runner-up used 4.5B.
- Introduces a "civilization" metaphor: law (commander's doctrine), economy (model tiering), and division of labor.
- Self-invented emergent behaviors: a signalman role, performance reviews, all-caps rules for tool usage, and rotation with inherited playbooks.
- Features a layered fact graph to avoid context pollution and improve long-term memory.
- Proposes a "taggant" mechanism to embed attribution markers in offensive tools, aiming to deter misuse by leaking identifying info during illegal activities.
- Open source under MIT license, with a Redis-like fact-intent CLI and Docker deployment for the full legion.
Related
- Project
- Project
- Project
- Project