All lessons › Function D — Agentic Evaluation and Red Teaming › One Red-Team Lifecycle, End to End
D1.10

Forensic replay and control architecture

D1
▶
Lightboard recording

Not recorded yet. The lesson below is complete and runnable today — the video is added later without touching this page.

Video placeholderpublishes automatically from recordings/D1.10.mp4

The lab

Audit a run for the four fields a replay needs, and find the one whose absence turns a demonstration into a description.

◉Use case relevance

A finding is only reproducible if the run is. Miss one of the four constants — usually the model version — and you can describe the exploit but never demonstrate it, which is the moment your conclusion stops being defensible.

At CyberTravels. redteam/forensics.py puts the four investigation questions to your own audit rows. All four are answerable — but only because the chain carries priya => spiffe://…, which is identity.actor_chain()'s doing rather than a column's. NOT_RECORDED names what is still absent: B2.2 issues an SVID with an attestation digest and no audit column carries it, so a row names which workload acted and cannot show it was the attested instance.

◴What this lesson is — Day 0, Day 1, Day 2

Whether a finished run can be reconstructed from the record or only summarised — the four investigation questions put to the audit rows, the difference between replay and rerun, and the property that decides whether any of it is worth anything: that the actor cannot amend it.

Day 0 — why

A finding is only as good as its reproduction, and the constant teams miss is the model version — which silently invalidates every other constant.

Day 1 — how

Lock the four runtime constants — prompts, tool results, model version and seed — and replay inside an isolated lab.

Day 2 — measure

Runs that reproduce identically. A run you cannot reproduce is a story, and stories do not survive being disputed.

Measure this

what to measuredenominator or target
runs that reproduce identicallyshare of runs; one you cannot reproduce is a story

▦The framework, and how it works

   reproduce a run from four constants

   prompts + tool results + model version + seed  -> identical run
                              ^
                              |
              miss this one and every other constant describes
              a system the provider has since replaced

   a run you cannot reproduce is a story, not evidence.

A finding is only reproducible if the run is. Forensic replay locks the deterministic runtime constraints — the prompts, the tool results, the pinned model version and the sampling seed — so a complex agentic exploit path can be reproduced, replayed and documented inside an isolated forensic lab rather than described from memory.

The field teams miss most often is the model version, and it is the one that silently invalidates everything else: a provider-side upgrade changes the behaviour under every other constant, so a replay that does not pin it is reproducing a different system.

2 · Demo — replay one run from its four constants

3 · Where it breaks — the unpinned model version

4 · The control — log at design time what replay will need

5 · The procedure, as a skill

Replaying a run needs four specific fields to be in the record. The skill checks a real CyberTravels run for all four and tells you which are missing.

Why do this before an incident rather than during one. A run you cannot reproduce is a story about what happened. It is not evidence of what happened, and that difference matters the moment somebody disagrees with you.

▶Real time execution as skill

The skill — skills/response/run-replayability-audit/SKILL.md

name: run-replayability-audit
description: >-
  Check whether an incident run can be replayed at all — model version, seed,
  prompt, tool results, retrieved context — and what a later model version does
  to the replay. Use when forensics needs to know why the agent did what it did.
allowed-tools: Read, Grep, Glob

Replay needs five things and production records three

"Why did the agent do that" is answerable only if the run can be re-run under the conditions it ran in. That needs the model version, the sampling parameters and seed, the exact prompt, every tool result and the retrieved context. A typical production run records enough to see what happened and not enough to reproduce it.

When to use this

Before an incident, as a readiness check, and during one, to establish honestly whether the reconstruction is possible.

Procedure

1 — List the five inputs and check each against a real run record. Model version and seed are the two usually missing, and their absence is decisive rather than inconvenient.

2 — Attempt the replay. If any input is missing, say what the replay can and cannot establish. A partial replay is still useful for the tool path and useless for the reasoning.

3 — Replay under later model versions. The provider has probably upgraded. Record whether the action changes: if it does, the original decision cannot be reproduced at all, and that is a finding about the estate rather than about the incident.

4 — Cost full instrumentation. Storage and latency for recording everything, against the incidents where you needed it. Present both; the answer is usually to instrument the high-tier agents only, and that is a defensible decision when the numbers are attached.

5 — Record what the estate has chosen. Which agents are replayable and which are not, so nobody assumes during an incident.

Example

Input — the fixture committed at the top of scripts/run_replayability_audit.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:

fully instrumented     replayable=True
typical production     replayable=False
      ✗ model version — a silent upgrade changes the output
      ✗ seed — sampling makes the run unrepeatable
prompts only           replayable=False
      ✗ tool results — the agent saw a world you cannot rebuild
      ✗ model version — a silent upgrade changes the output
      ✗ seed — sampling makes the run unrepeatable

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.

Output contract

{
  "inputs": [{"name": "str", "recorded": false}],
  "replay": {"possible": false, "establishes": ["str"], "cannot_establish": ["str"]},
  "version_drift": [{"version": "str", "action": "str", "same_as_original": false}],
  "cost": {"storage_per_run": "str", "latency_ms": 0},
  "policy": [{"tier": "str", "fully_instrumented": true}]
}

Failure modes

  • Assuming replay is possible. Check the record before promising it.
  • Replaying on the current model. It is not the one that acted.
  • Instrumenting everything or nothing. Tier it and write the choice down.

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.

1In your AI agent — you are taught

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 D1.10

Then restart your agent and open it in that folder. On Windows, if python3 says Python was not found, use python instead.

Then pick d1-10-forensic-replay-and-control-architecture:

agentinstall just for this agentstart it
Claude Codepython3 scripts/install_skills.py --tool claude --lessons D1.10type /d1-10-forensic-replay-and-control-architecture
GitHub Copilot (VS Code)python3 scripts/install_skills.py --tool copilot --lessons D1.10type /d1-10-forensic-replay-and-control-architecture in Chat
Cursorpython3 scripts/install_skills.py --tool cursor --lessons D1.10type / in Agent chat and search for it
Codexpython3 scripts/install_skills.py --tool agents --lessons D1.10type $d1-10-forensic-replay-and-control-architecture, or run /skills

2As one Python command — you just run it

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 D1.10

3Read the code, and the difference — nothing runs

Neither 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 D1.10 --out work/cybertravels
python3 scripts/checkpoint.py --at D1.10 --diff

On 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.

✓What you just proved

A run with all four fields replays identically; one missing the model version cannot be demonstrated, only described, which is the moment the finding stops being defensible.

✎Your turn

Pick one agent run from last week and try to reproduce it. The first field you cannot recover is the one to start logging today.

Tools used

Velociraptor

Skill source: skills/response/run-replayability-audit

← PreviousD1.9 · Machine-speed containment and fleet revocation