Not recorded yet. The lesson below is complete and runnable today — the video is added later without touching this page.
recordings/C2.19.mp4A reference implementation is adopted as a product, and its outputs are trusted without an eval.
Map Mantis's stages onto the pipeline you built, then score it with your own held-out key before trusting it.
Map Mantis onto the 15 stages, parse its two output shapes, and score a sample against a held-out key.
Somebody has already built this pipeline and published what happened. Reading it is worth an afternoon; adopting it without scoring it against a held-out key is how a reference implementation becomes a dependency you cannot evaluate.
appsec/__init__.py and see which of yours it does not have — then score it with the key in LABELS.md, which it has never seen. A reference implementation adopted without an eval is a product you did not buy and cannot return.A reference implementation read as a reference rather than bought as a product: mapping its stages onto the ones you built, finding what it does not have, and scoring it against a key it has never seen before trusting its output.
A reference implementation gets adopted as a product and its outputs trusted without an evaluation.
Map its stages onto the pipeline you built, then score it against your own held-out key.
Its accuracy on your key, not its accuracy on its own — which is the only comparison that transfers.
Measure this
| what to measure | denominator or target |
|---|---|
| a harness's accuracy on your key | rate — not its accuracy on its own key, which does not transfer |
published pipeline your pipeline
+------------------+ +------------------+
| stages 1..15 | map -> | stages 1..15 |
+------------------+ +------------------+
|
score it against a HELD-OUT key
|
+--------v---------+
| adopt / adapt / |
| leave it alone |
+------------------+
a reference implementation is a starting point you evaluateBonus. You have now built all fifteen stages. This lesson looks at a real implementation of the same pipeline — Google Mantis — and does the one thing that matters before adopting any of them: maps its stages onto yours, then scores it with your own held-out key.
Two things are worth understanding about Mantis specifically.
It is model-agnostic. Mantis ships security-review skills for coding agents rather than a bundled model. That is the same architecture as this track: the pipeline is the product, the model is a component. It means you can run it on open weights — GLM-4.6, Kimi K2 — which is what makes it usable without a frontier account.
It has two output shapes, and they serve different stages:
learning_entry — appended to a historical learnings file, feeding stage 1 (historical parsing) on the next run;finding object — a vulnerability report, feeding stages 8–10.That first shape is the interesting one. It closes the loop from Phase 5 back to Phase 1, which is the property that turns a pipeline into something that improves.
The bonus framing is deliberate: a reference implementation is a starting point you evaluate, not a product you trust. C2.1 gave you the harness; this is where you point them at someone else's pipeline.
Where you are in the pipeline. `` [Ingestion & Mapping] ──> [Threat Modelling] ──> [Discovery] └─ stages 1-4 └─ stages 5-6 └─ stages 7-10 ──> [Dynamic Validation] ──> [Reporting] └─ stages 11-14 └─ stage 15 ``Adoption starts with the coverage question: which stages does it do, which does it assume you already have, and which are still yours?
Before scoring anything you have to ingest it. Both shapes are JSON; the history field on a learning entry is required and is the one most commonly missing in a first integration.
This is the whole point of the bonus. Conformance is structural — with structured output it goes to 1.00 and says nothing about quality. The number that decides adoption is expert accuracy against a key the tool never saw, matched on parent directory plus filename.
Google's Mantis is a set of claims: these stages, this output shape, this accuracy. The skill checks all three — maps it onto the stage model, conformance-checks its published samples, and scores its findings against a held-out key.
The skill — skills/appsec/reference-pipeline-scoring/SKILL.md
name: reference-pipeline-scoring
description: >-
Map a published or vendor pipeline onto the stage model, check its output
against the schema it claims, and score its findings against a held-out key.
Use when evaluating a reference implementation, a security product's agent, or
any pipeline you are asked to adopt.
allowed-tools: Read, Grep, GlobSomebody else's pipeline is a set of claims: these stages, this output shape, this accuracy. All three are checkable, and checking them is cheaper than adopting and discovering. The interesting result is usually not the score — it is the phase the pipeline does not cover at all.
Before adopting a published pipeline, when comparing two, and when a vendor claims a number you are expected to plan around.
1 — Map it onto the stage model. For each stage, does the pipeline cover it strongly, weakly, or not at all? Coverage claims are usually accurate about the stages the pipeline is proud of and silent about a whole phase.
2 — Take its output and check conformance to its own schema. Required fields present, enumerated values in range, nothing that is prose where an object was promised. Conformance failures in a published sample are the cheapest finding available.
3 — Score against a held-out key. Not the examples the pipeline ships. Match findings to truth by location and defect class, then compute precision and recall, and report both — a pipeline can look excellent on either alone.
4 — Separate the model's errors from the harness's. A null CWE is a schema problem; a finding at the wrong location is an analysis problem. They have different fixes and different owners.
5 — Report the uncovered phase as the headline. A pipeline that scores well on the stages it implements is still a partial answer, and the gap is what you would have to build.
Input — the fixture committed at the top of scripts/reference_pipeline_scoring.py. Edit it and re-run: the buckets, counts and verdicts below are derived from it, not hard-coded.
Output — the opening lines of a real run:
stage name mantis note
------------------------------------------------------------------------------------------------
1 historical parsing yes historical_learnings.jsonl is read on subsequent runs
2 structural indexing partial operates over the agent's code-reading tools
3 component summarisation partial context assembled per review target
4 architecture synthesis no assumes you supply the architecture context
5 threat modelling partial review skills encode threat patterns rather than deriving them
6 strategic planning no you decide what to point it at
The run continues past this. test_skills.py executes the script on every build, with no model configured — so what CI proves is that it runs and refuses legibly, not that it prints these lines. The output above is a recorded run against a real model, and nothing re-diffs it: a model's answer is not reproducible, and this repository does not claim otherwise anywhere it can be checked.
{
"stages": [{"stage": 0, "coverage": "strong|weak|none"}],
"uncovered_phases": ["str"],
"conformance": {"samples": 0, "conforming": 0, "failures": [{"sample": 0, "reason": "str"}]},
"score": {"matched": 0, "precision": 0.0, "recall": 0.0, "key": "held-out"},
"errors": {"schema": 0, "analysis": 0}
}
Three ways to do this lesson. Pick one. They run the same procedure against the same code — what changes is who drives it, and how much you see.
The agent reads the lesson, explains the idea, fetches the code, runs the check and answers your questions as you go. This is the one to take if you are here to learn.
Install it, once. From the folder you cloned. --all does every agent it finds on your machine:
python3 scripts/install_skills.py --all --lessons C2.19Then restart your agent and open it in that folder. On Windows, if python3 says Python was not found, use python instead.
Then pick c2-19-bonus:
| agent | install just for this agent | start it |
|---|---|---|
| Claude Code | python3 scripts/install_skills.py --tool claude --lessons C2.19 | type /c2-19-bonus |
| GitHub Copilot (VS Code) | python3 scripts/install_skills.py --tool copilot --lessons C2.19 | type /c2-19-bonus in Chat |
| Cursor | python3 scripts/install_skills.py --tool cursor --lessons C2.19 | type / in Agent chat and search for it |
| Codex | python3 scripts/install_skills.py --tool agents --lessons C2.19 | type $c2-19-bonus, or run /skills |
No agent, no conversation. The same lesson executes and prints the same readback. Take this one if you have no assistant, if you are reviewing rather than learning, or if you want the result without the teaching around it.
python3 scripts/lesson.py C2.19Neither of the above, and no model needed. The first command writes CyberTravels exactly as it stood at the end of this lesson; the second prints the diff — the lines this lesson added or changed, and nothing from any later one.
python3 scripts/checkpoint.py --at C2.19 --out work/cybertravels
python3 scripts/checkpoint.py --at C2.19 --diffOn Windows, type python wherever these say python3 — and use \ instead of / in the paths. Everything else is identical. A0.0 step 2 explains why.
Ways 1 and 2 need a model; way 3 does not. A signed-in Claude Code CLI needs no API key, and any OpenAI-compatible endpoint works too. With neither, the audit exits 2 and says so rather than inventing an answer. A0.0 sets this up.
Ways 1 and 2 both end with the same readback: What I did, What changed, The number and Read this next. A step that was skipped or refused is reported as exactly that, never as a pass.
If you did the last lesson’s challenge, expect this to stop. Most challenges ask you to edit the code, and ways 1 and 2 will not overwrite your edits: you get stopped, not a failure, with two options — --out for a fresh folder that keeps your work, or --force to discard it and start this lesson clean.
The stage map shows Mantis covering stage 7 strongly with a stage-1 learning loop, and not covering Phase 4 at all. Three of five sample outputs conform — one learning entry is missing the required history field, one finding has a null CWE, and one is prose. Scored against the held-out key, expert accuracy is below 1.0: one correct, one half credit for the null class, and one missed finding Mantis never reported. The learning entry then feeds the next run's risk zones.
Run the real thing: clone google/mantis, point it at a repository you have ground truth for, and score its output with a scoring harness. The gap between its conformance and its expert accuracy on your code is the only number that should decide whether you adopt it.
What you can do now. A harness you can name the eight parts of, evaluate on a corpus with known answers rather than on how confident it sounds, price per confirmed finding across a run nobody watched, and salt with bait that has no false positives.
What you still cannot do. Everything you have built so far is defensive and cooperative: it runs against systems that are not trying to defeat it. You have no evidence about how any of it behaves against someone who is — including the evaluation you have been trusting.
Function D attacks it, starting with the loop pointed the other way round. Next → D1.0, what red teaming and research with AI means.
Tools used
Skill source: skills/appsec/reference-pipeline-scoring