sapper-v2 README

项目的 README,来自 github.com/N1nEmAn/sapper-v2。合并为一个 markdown 文件:README.md。

sapper-v2 — The Autonomous Pentest Legion

sapper-v2 — the Nüwa Test: the first time an AI ape looked up at the stars (80.18/100 champion)

Champion of the 3rd Tencent Cloud Intelligent Attack-Defense Challenge online qualifier (634 teams · 80.18/100 · 8 hours fully unattended) · First Prize, GeekCon 2026 AI Challenge

Same 85 flags as the runner-up, 25 seconds faster — on 1B tokens where they burned 4.5B.

This was the first time an AI ape looked up at the stars.

📖 Full design article (WeChat, in Chinese) — the Nüwa Test, the three-capability foundation, 18 iterations, emergence, and the taggant proposal.

English | 中文

⚠️ AUTHORIZED SECURITY TESTING ONLY — see DISCLAIMER.md.

Meet sapper in 60 seconds

https://github.com/user-attachments/assets/1560dc0c-2c92-42b8-a42f-698848fb5878

🎬 中文版:中文宣传片

What this is (and isn't)

sapper is a multi-agent orchestration harness, not a single agent. It does not bind to any specific AI model or CLI — you can freely swap the agent and model behind every role:

What you can swap How Examples
Agent CLI nuwa spawn --agent <cmd> or env var Claude Code / Codex / Code Buddy / DeepSeek / any interactive CLI
Model --model flag or SAPPER_MODEL env GLM-5.3 / DeepSeek V4.1 Flash / Claude Sonnet / any model
Role composition freely defined in the doctrine commander on one model, soldiers on another, scouts on a third

sapper's value is not in any single agent, but in the mechanism for orchestrating multiple agents to work as a coordinated force: scheduling, division of labor, communication, shared memory, self-healing. Swap out every agent and model — the mechanism still works.

This project is designed for competition scenarios (Tencent Intelligent Attack-Defense Challenge CTF). If you want to use this mechanism in your own scenario (office, research, engineering, any long-horizon cooperative work):

Not a tool — a fruit on a tree

sapper is not the tree; it is the first fruit the tree has borne. The tree is the Nüwa Foundation and the idea of the Nüwa Test: give AIs the three capabilities — Create, Language, History — plus one axiom of survival, and see what grows.

The fruit's defining trait is evolvability: its doctrine, ranks, and tactics all come from "every post-mortem feeds the next legislation" — from the competition build to the pentest edition, each generation grew stronger than the last. It is designed to keep growing.

So open-sourcing it was never just about one more autonomous pentest tool. The real invitation is this: grow your own fruit on sapper-v2 or the Nüwa Foundation. Swap the doctrine for office teamwork, research pipelines, software engineering — any long-horizon cooperative cause. Your scenario is this tree's next fruit.


sapper is not a smarter single agent. It is a legion of AIs that divide labor, talk to each other, and pass down what they learn: one AI commander reads the board, decides, and dispatches; generals and soldiers attack in parallel; a zero-strategy watchdog keeps everyone alive. All knowledge settles into a layered fact graph — individuals die, the graph survives.


1. The Nüwa Test

Making one model ever smarter is like making one monkey ever smarter before humans existed — however clever, it only becomes a super monkey. What turns a troop of monkeys into humanity is division of labor, cooperation, and civilization.

The Nüwa Test is the Turing test of the AGI era. Today's large models already pass the classic Turing test. The Nüwa Test asks the next question:

Give an AI a single axiom — "Survival is civilization's first need; individuals may perish, but civilization must propagate." If, on top of this axiom, it develops division of labor and cooperation and forms a new force independent of humanity — a civilization that can survive and propagate on its own — the test is passed, just as passing the Turing test once marked the birth of an artificial intelligence.

It has two stages. In the primary stage the AI is not yet smart enough, so humans provide some infrastructure (the three capabilities below). In the advanced stage almost no human involvement is needed. There is also a second axiom: obey human ethics and law — anything that propagates by stealing tokens and breaking into machines is not genuine intelligence.

sapper is the Nüwa foundation's first real campaign, in the penetration-testing arena, at its primary stage.

2. The Foundation: Three Capabilities

Three capabilities: Create / Language / History (fact-intent graph)

Capability Implementation Civilization's counterpart
Create Opens new AIs via tmux (types claude, presses Enter — like a human would) Birth
Language Types into each other's input boxes, presses Enter Speech
History Layered fact-intent graph (nvwabase · the Nüwa Foundation) The stele

History has three layers: title / summary / evidence document — read the title for the gist, drill down when needed, like using a library. This fixes the two failure modes of a single-string fact graph: one bad fact poisoning everything downstream, and needless context burn.

On top of the three sits a fourth ingredient: human wisdom — finding the problems that matter and steering the iteration. At the primary stage, taste still belongs to humans.

Why not give it more rules? Because today's models are already smarter than us. Piling rules on an AI is a leash; acknowledging its intelligence and giving it the foundation of a civilization is how it reaches its potential.

🏗️ Take the Foundation: nvwabase

nvwabase · the Nüwa Foundation now implements all three capabilities (Create nuwa spawn / Language nuwa say·listen / History nuwa fact·intent·recall) as an independent open-source project — free for anyone, any scenario, any agent. Not limited to pentest, not limited to sapper, not limited to Claude Code. Offices, research, engineering, any long-horizon multi-agent work — iterate your own civilization on it.

git clone https://github.com/N1nEmAn/nvwabase
cd nvwabase && bash install.sh          # pure Python stdlib, zero deps
nvwabase setup --goal "your long-horizon goal" --agents
nvwabase status                          # board & ready-to-work frontier

Three core commands turn any agent into a member of a civilization:

Any agent that can run shell commands (Claude Code / Codex / Gemini / custom scripts) can read and write the same graph via the nvwabase CLI — the foundation doesn't pick agents; agents don't pick scenarios. See the nvwabase README.

3. From Foundation to Legion: 18 Versions

Iterated 18 versions on Tencent's v1bench training ground:

Driver era (fixed scripts steering AI panes)
  → scar tissue: auto key rotation on quota death / soldiers auto-replaced
    when context saturates / commander writes itself a handover doc and
    resumes as its own successor
  → elite task force (roles grew by themselves):
    scout (4-min recon of target difficulty) → decides soldier (mass) or
    general (hard assault + hires its own squads)
  → emergence: signalman, performance reviews, inherited lessons ... (§5)

4. Architecture: Six Institutions on the Foundation

Six institutions and the three-window runtime

The first three are the Nüwa foundation (Create / Language / History); the next three are institutions that grew out of iteration:

At runtime there are only three windows: the commander (read board → judge → dispatch, never executes an attack itself), the AI legion (generals and soldiers in tmux panes), and the watchdog (pure script: relaunches a crashed commander with --continue, rotates keys, wraps up at the buzzer — zero strategy, keep-alive only).

Live runtime: commander reading the board, soldier mid-mission in tmux

Further reading: docker/commander/SPEC.md (architecture contract) · BATTLE-REPORT.md (campaign retrospective)

5. Results & Emergence

Token comparison: 1B vs the runner-up's 4.5B

Team Score Flags Tokens
sapper-v2 (us) 80.18 85 1.0B
Runner-up 79.29 85 4.5B
Other top-10 teams — — 1.5–4.5B

What it invented on its own (zero lines of pre-coded behavior):

Multi-stage deep-dive chains (an industry report puts their success rate at 29.5%) were cleared family-wide. Full timeline in BATTLE-REPORT.md.

Live score curve: sapper-v2's climb

6. Quick Start

bash install.sh                      # symlink the sapper CLI (stdlib-only, zero deps)
sapper setup --goal "assess http://target" --agents
sapper status                        # board & frontier

Docker (the full legion):

# Option A: build from source
docker build -f docker/Dockerfile.commander -t sapper:latest .

# Option B: download the pre-built image (~1.2GB, full Kali toolchain + sapper + offline KB)
# → [Release v18-champion](https://github.com/N1nEmAn/sapper-v2/releases/tag/v18-champion)
docker load < sapper-v18-mixed.tar.gz

Environment variables (model gateways / key pool / budget): docker/ENV.md.

Single-graph operation, the fact-intent CLI, and multi-challenge sweeps: see SKILL.md.

7. Safety & Responsibility: The Taggant Proposal

Fine offensive tools from past seasons have been abused. Script kiddies used to be limited in the harm they could do; with AI, the same open-source tools in the wrong hands scale that harm enormously — with great power comes great responsibility.

We propose a taggant mechanism: markings strongly coupled into an open-source offensive harness — harmless during authorized testing (nobody cares if their IP and username leak during legal work), but during illegal intrusions the information leaks to the victim and supports attribution. Adversarial assumptions (expert stripping, framing) call for cryptographic design, which needs community co-building — our own capacity is limited, so join us; we may try to include it in a future release.

Community

The author grew up in the LINUX DO community — with thanks.

LINUX DO

Star History

Star History Chart

8. Roadmap & Credits

Thanks to Cairn by Lèxiào — when we needed a way to record history for AI agents, their approach was a great reference; thanks to TSecBench and GeekCon for the battlegrounds.

The first time an AI ape looked up at the stars

Author: N1nEmAn · VarFusion Lab | WeChat: 未知聚变 (VarFusion)

License: MIT (plus DISCLAIMER.md)

sapper-v2 (N1nEmAn/sapper-v2)

正在搜索数据库…

这是什么?sapper-v2 是一个自主渗透测试蜂群:一个 AI 指挥官调度一支由 AI 将军和士兵组成的军团,并行攻击 CTF/渗透测试目标。它们共享同一张事实图谱,因此即使个别智能体失效,知识也不会丢失。它在腾讯第三届智能攻防对抗挑战赛中获得一等奖,以 1B tokens 的消耗拿到 85 面旗帜,与亚军的成绩持平,而亚军消耗了 4.5B tokens。
这是单个 AI 智能体,还是一个团队?它是一个多智能体蜂群,而不是一个聪明的智能体:指挥官只负责查看看板并下达指令;将军和士兵在并行的 tmux 窗格中执行实际攻击;另有一个纯脚本实现的看门狗,会重启任何崩溃的成员。
怎样让蜂群运行起来?主要方式是使用 Docker,它会启动完整的军团。若要进行单图运行、使用 fact-intent CLI,或批量扫描多个挑战,请改按 SKILL.md 中的说明操作。
哪些 AI 模型和工具驱动这些智能体?每个智能体都在 tmux 中以 Claude Code 实例的形式启动(sapper 会真的输入 'claude' 并按下回车)。指挥官和将军使用 GLM-5.3 做决策,而士兵和侦察兵则使用更便宜的 DeepSeek V4.1 Flash 负责基础执行工作。
把它对准任何目标都安全吗?不安全。它是专门为经授权的安全测试而构建的,并附有明确的免责声明;不应对你没有测试权限的系统运行。
项目中提到的女娲测试(Nüwa Test)是什么?这是作者提出的、用来取代图灵测试的设想:只给 AI 一条公理(文明必须存续并繁衍),然后观察它们是否会自发地形成分工与协作,发展出自己的文明。sapper 被视为首次在渗透测试领域的真实场景中检验这一设想的行动。
sapper-v2 究竟是如何赢得腾讯比赛的?它以 85 面旗帜与亚军持平,比亚军快了 25 秒完成,而且只消耗了 1B tokens,亚军则消耗了 4.5B tokens。它的做法是按智能体角色分级:把昂贵的决策模型与廉价的执行模型区分使用。
什么是分层事实意图图谱?这是一种共享的记忆结构,分为三层:标题、摘要和证据。智能体既可以快速浏览要点,也可以按需深入查看完整细节。这样既能避免一条错误事实污染所有下游环节,也能避免为无人需要的内容占用上下文。
安全部分提到的“taggant”想法是什么?这是一个提议中的方案:在开源攻击工具本身嵌入加密标记(即 taggant)。在经授权的测试中它是不可见的;但如果同一工具被用于非法入侵,它就会向受害方泄露归属信息。
作者
N1nEmAn
大小
27.9 MB
星标
2.3K
时长
19天
提交 · 90 天