All lessons › Function E — The Agentic SOC › Respond — From a Conclusion to the Actor Stopped
E4.3

Containment at machine speed

E4
▶
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/E4.3.mp4
Risk

Mass revocation takes down the business.

Control

Throttle → scope-reduce → reroute → force HITL → revoke → hard stop, in order.

The lab

Exercise the ladder against a live misbehaving agent.

◉Use case relevance

You have to stop it faster than it acts. That means the containment path — revoke, cut the gateway, kill the loop — is a thing built in advance, because improvising it takes longer than the incident does.

At CyberTravels. Six rungs, each strictly more disruptive and each reversible until the last two — throttle, scope-reduce, reroute, force-HITL, revoke, hard-stop. escalate() never skips. Starting at the bottom is a decision; arriving there because the rungs were never built is not.

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

Containment as a ladder climbed in order — throttle, scope-reduce, reroute, force approval, revoke, hard stop — so a response can start immediately with something reversible and escalate only as far as it has to.

Day 0 — why

An agent at 300 actions a minute takes about 2,400 further actions inside an eight-minute approval cycle.

Day 1 — how

Pre-authorise automated revocation of non-human identities, which is safe precisely because they are not people.

Day 2 — measure

Actions taken during containment: roughly 2,400 with a human in the path, about 60 without.

Measure this

what to measuredenominator or target
actions taken during containmentroughly 2,400 with a human in the path, about 60 without

▦The framework, and how it works

   containment paths, in order of how fast they actually work

   1  revoke the credential      seconds, if it is short-lived
   2  cut it at the gateway      seconds, if there is a gateway
   3  kill the loop              minutes, if you know where it runs
   4  disable the integration    hours

   built in advance. improvised, path 1 takes longer than the incident.

Containment has always been a race. With an agent, the other runner got much faster and you did not.

The numbers decide the design. An agent operating at 300 actions per minute completes 2,400 further actions during an eight-minute approval cycle, against about 60 under automated containment. That ratio is the argument for pre-authorised, automated revocation of non-human identities.

The asymmetry that makes it safe: revoking a human's access needs care, because a false positive locks a person out mid-shift. Revoking a non-human identity is cheap to get wrong — the agent re-requests, or an on-call re-enables it in a minute. So the two should have different policies, and almost nowhere do.

Anchor → E1.0. The interval where the arithmetic is brutal. An agent at 300 actions a minute takes about 2,400 further actions inside an eight-minute approval cycle and roughly 60 under automated containment — and revoking a non-human identity is not revoking a person, which is what makes it safe.

2 · Demo — the race, in actions rather than minutes

3 · Where it breaks — approval latency is not the only delay

4 · The control — pre-authorise on high-confidence signals

5 · The procedure, as a skill

Eight minutes of approval is 2,400 actions. The skill races the rate against the delay, times the whole containment path — of which the revocation itself is twelve seconds — and classifies which signals may auto-revoke against a non-human subject.

▶Real time execution as skill

The skill — skills/response/machine-speed-containment/SKILL.md

name: machine-speed-containment
description: >-
  Race an agent's action rate against the approval delay in front of
  containment, time the whole containment path end to end, and decide which
  signals may auto-revoke. Use when containment requires a human and the subject
  acts hundreds of times a minute.
allowed-tools: Read, Grep, Glob

Eight minutes of approval is 2,400 actions

Containment that waits for a person is measured against a subject that does not wait. The arithmetic is not close, and it is the argument for pre-authorising revocation for a named set of signals — with the false-revocation cost stated, because that is the objection.

When to use this

Designing containment for agent workloads, and after any incident where the containment step was correct and late.

Procedure

1 — Measure the subject's rate. Actions per minute, observed rather than designed. Multiply by the approval delay to get the actions taken while somebody decides.

2 — Time the whole path, not the revocation. Detection, triage, decision, approval, execution, propagation. The revocation itself is usually seconds and the path is usually minutes; reporting only the last step makes the problem invisible.

3 — Find the dominant term. It is almost always human approval or propagation delay, and it is almost never the API call. Optimise the dominant term or nothing changes.

4 — Classify signals for auto-revocation. For each, its precision and what a false revocation costs. High-precision signals against a non-human subject are the candidates: revoking an agent's token wrongly costs a restarted run.

5 — Set the policy asymmetrically. Auto-revoke agent credentials on high-precision signals; keep a human in front of anything that affects a person's access. State both halves so the policy survives review.

Example

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

   agent rate   human 8min   auto 12s   ratio
----------------------------------------------
       30/min          240          6    40.0×
      120/min          960         24    40.0×
      300/min         2400         60    40.0×
     1200/min         9600        240    40.0×

At 300/min an 8-minute approval costs 2,400 further actions.

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

{
  "race": {"actions_per_min": 0, "approval_minutes": 0, "actions_during_approval": 0},
  "path": [{"step": "str", "seconds": 0}],
  "total_seconds": 0,
  "dominant_step": "str",
  "signals": [{"name": "str", "precision": 0.0, "subject": "agent|human",
               "auto_revoke": false, "false_revocation_cost": "str"}]
}

Failure modes

  • Timing the revocation. It is the fast part.
  • One policy for agents and people. The costs differ by orders of magnitude.
  • Auto-revoking on a low-precision signal. Precision is the entry requirement.

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 E4.3

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

Then pick e4-3-containment-at-machine-speed:

agentinstall just for this agentstart it
Claude Codepython3 scripts/install_skills.py --tool claude --lessons E4.3type /e4-3-containment-at-machine-speed
GitHub Copilot (VS Code)python3 scripts/install_skills.py --tool copilot --lessons E4.3type /e4-3-containment-at-machine-speed in Chat
Cursorpython3 scripts/install_skills.py --tool cursor --lessons E4.3type / in Agent chat and search for it
Codexpython3 scripts/install_skills.py --tool agents --lessons E4.3type $e4-3-containment-at-machine-speed, 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 E4.3

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 E4.3 --out work/cybertravels
python3 scripts/checkpoint.py --at E4.3 --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

The race table shows 2,400 versus 60 actions at 300/min for an eight-minute approval. The full containment path totals about 920 seconds, of which the revocation itself is 12. Four of five signals auto-revoke for non-human identities and none do for a human subject, cutting the path to 21 seconds and preventing roughly 4,500 actions.

✎Your turn

Time your own containment path end to end, step by step. The revocation is almost never the slow part — queue depth and approval are, and both are policy choices rather than technical limits.

Tools used

agentgatewayKeycloak

Skill source: skills/response/machine-speed-containment

← PreviousE4.2 · Runbook tiers — fully automated, human in the loop, manual