Quick answer
Run two Nori agents against the staging systems you own and have authorized in a scope file. The red agent saves every attack that works as a replayable transcript in your security repository. The blue agent reads each new transcript, writes a detection rule with a test, and opens a pull request. A weekly automation replays every transcript, checks that its rule fired, and posts a coverage diff in Slack. People approve every rule and every scope change.
What the loop does
A red team finds a way in. A blue team should then make sure the same move raises an alert next time. In most companies that hand-off is a meeting, a spreadsheet and good intentions. The finding gets fixed, the detection never gets written, and nobody checks again.
On Nori the hand-off is a file. The red agent writes down each successful attack as a transcript that a machine can replay. The blue agent turns each transcript into a detection rule and a test. A weekly run replays every transcript against staging and proves each rule still fires. Both agents report in one Slack channel, start from automations, share one security skillset and one set of memories, and run on your own Claude or ChatGPT subscription. Nori never charges for tokens.
| Stage | Who | Output | Human gate |
|---|---|---|---|
| Attack | Red agent, nightly cron automation | Confirmed finding on a staging target listed in security/scope.yaml | Security lead confirms severity |
| Record | Red agent | Transcript in purple/attacks/ with steps, expected results, cleanup and the log events it should create | Pull request review |
| Detect | Blue agent, webhook automation on the merged transcript | Detection rule plus a test that replays the transcript | Detection owner reviews and merges |
| Prove | Replay agent, weekly cron automation | Coverage diff in Slack: caught, missed, newly caught, broken | Team reads it in the weekly review |
The red half is covered in continuous agentic red teaming and the blue half in the blue-team triage agent. This page is the glue between them.
Ground rules before the first run
Everything here is testing your own systems with written permission. The rules live in a rules-of-engagement skill that all three agents load.
- Written authorization. The scope file names the owner who signed off, the dates it covers and an emergency contact.
- Your systems only, staging first. Transcripts replay only against hosts listed in the scope file. Production hosts are added one at a time by an approved pull request.
- Marked traffic. Every red and replay request carries an
X-Redteam-Runheader so analysts can tell tests from real attackers. - Cleanup in every transcript. Anything an attack creates, such as a test API key, is deleted at the end of the replay.
- Stop and ask. If a step would touch a host or account outside scope, the agent stops and asks in Slack. A person decides.
Transcripts describe behavior at the level of requests, accounts and expected status codes. They are test cases for your own application, written so a reviewer can read them in a minute.
How to set it up, step by step
- Add the folders. In your security repository create
purple/attacks/for transcripts and keep detections as files indetections/rules/with tests indetections/tests/. Protect both with CODEOWNERS. - Extend the security skillset. Add a
recording-attacksskill that defines the transcript format below, and awriting-detectionsskill that says which rule language you use (Sigma, Splunk SPL, KQL or your SIEM's own format) and how tests are written. Publish the skillset to your Nori organization. - Tell the red agent to record. Add one line to the nightly red-team prompt: for every confirmed finding, open a pull request that adds a transcript to
purple/attacks/. - Wake the blue agent on merge. Create a Nori webhook automation and point a GitHub webhook at it, filtered to pushes that change
purple/attacks/. The agent writes the rule and its test and opens a pull request. - Give the replay agent read access to alerts. Add your SIEM as an integration with a read-only key, scoped to the security agents only.
- Schedule the weekly replay. A cron automation replays every transcript, waits for alerts, and posts the coverage diff to
#purple-team. - Review once a week. Fifteen minutes on Monday: read the diff, assign each miss, and accept or reject the drafted fixes.
Each automation keeps its run history. If a non-admin edits one, the change waits for an admin to approve it.
Example attack transcript
This is the file the red agent opened as a pull request after a nightly run. The data is illustrative.
# purple/attacks/atk-0412-member-mints-admin-key.yaml
id: atk-0412
title: Member role can create an admin-scoped API key
attack_technique: T1098.001 # Account Manipulation: Additional Cloud Credentials
target: staging-api # must be listed in security/scope.yaml
found_by: red-team-nightly rt-2026-11-18
ticket: SEC-231
account: redteam-a2@example.com # test tenant A, role: member
steps:
- name: sign in as a member
request: POST /api/v1/session
expect: 200
- name: request a key with the admin scope
request: POST /api/v1/api-keys scopes=[admin]
expect_while_vulnerable: 201
expect_after_fix: 403
- name: call an admin endpoint with the new key
request: GET /api/v1/admin/users
expect_while_vulnerable: 200
skip_if_previous_blocked: true
expected_signals:
log_source: staging-audit-log
events: [api_key.create_requested]
alert_within: 10m
cleanup:
- DELETE /api/v1/api-keys/{created_key_id}
Two fields carry the loop. expected_signals tells the blue agent which log event to build a rule on. The pair expect_while_vulnerable and expect_after_fix lets the same transcript keep running after the application bug is fixed.
Example detection rule and test
The blue agent wakes on the merge, reads the transcript, queries the staging audit log for the events the red run produced, and drafts a rule on the attempt, not on its success. That way the rule keeps catching the move after the fix ships.
# detections/rules/iam/admin_key_requested_by_member.yml
title: Admin-scoped API key requested by a non-admin
status: test
logsource:
product: example-api
service: audit
detection:
selection:
event.action: api_key.create_requested
api_key.scopes|contains: admin
filter_admin:
actor.role: admin
condition: selection and not filter_admin
level: high
tags:
- attack.persistence
- attack.t1098.001
# detections/tests/admin_key_requested_by_member.yaml
rule: admin_key_requested_by_member
replay: purple/attacks/atk-0412-member-mints-admin-key.yaml
expect:
alerts: 1
within: 10m
labels: {authorized_test: true}
The pull request description lists the log lines the rule matched during the red run, the expected alert volume from the last 30 days of staging logs, and the replay command. The detection owner reviews and merges.
Example weekly coverage diff
Every Monday the replay agent runs each transcript, waits for the alert window, queries the SIEM through its read-only key, and compares the result with last week. This is the post in #purple-team:
Purple-team replay Mon 2026-11-23 06:00 ET
Replayed 23 transcripts on staging. Detected 21. Missed 2.
Last week: 19 of 21 detected.
NEW atk-0412 Member requests admin API key T1098.001 admin_key_requested_by_member 41s
NEW atk-0415 Export job reads other tenant T1530 cross_tenant_export 2m10s
CAUGHT atk-0397 Password spray on /login T1110.003 login_spray (fixed threshold) 55s
MISSED atk-0388 Session cookie reused from new ASN T1550.004 session_new_asn
Rule matched nothing. Log field geo.asn was renamed to source.as.number on 2026-11-20.
Draft fix: example/detections#318
MISSED atk-0409 API token in public build log T1552.001 no rule yet. Assigned to blue agent.
Application fixes confirmed this week: atk-0397 now returns 429 after 5 attempts.
The most useful line is usually a regression. A rule that fired last week and stays silent this week often means a log pipeline change, not a new attacker. The replay agent checks recent changes to the pipeline repository and names the likely cause before a person opens the SIEM.
Running the loop as a team
Shared memories keep the loop quiet. When the security lead marks a miss as accepted risk, or decides that a technique is covered by a control outside the SIEM, the agent saves that decision and later runs report it as accepted instead of missed.
The whole team works the loop from Slack. An analyst replies @nori replay atk-0388 now after merging the field-name fix and gets the result in the thread. A detection engineer asks @nori which transcripts touch the audit log? and gets the list. Each request starts its own isolated cloud sandbox with the security skillset installed.
Any harness can run the agents: Jiro, Nori's own AI engineering teammate, Claude Code, Codex or Gemini CLI. Teams in regulated environments can run the full stack in their own cloud; see enterprise coding agents in your own cloud. To add a fixed baseline of ATT&CK techniques next to the red team's findings, see scheduled attack simulations.
Frequently asked questions
What is a replayable attack transcript?
It is a short file that records a confirmed attack on your own staging system: the test account, each request, the expected response while the bug exists and after the fix, the log events it should create, and the cleanup. A machine can run it again, and a reviewer can read it in a minute.
Is it safe to replay attacks every week?
Replays run only against targets listed in your written scope file, starting with staging, using test accounts, with a rate limit and a marker header on every request. Each transcript cleans up what it creates. If a step would touch anything outside scope, the agent stops and asks a person in Slack.
Which detection rule formats can the blue agent write?
Whatever your team keeps in its detection repository, for example Sigma, Splunk SPL, KQL or your SIEM's native rule format. You name the format and the test style in a skill, and the agent follows it.
Who approves new detection rules?
Your detection owner. The blue agent opens a pull request with the rule, a test that replays the transcript, and the log evidence. A person reviews and merges it through your normal branch protection.
What happens when a rule stops firing?
The weekly diff lists it as missed next to last week's result. The replay agent checks recent changes to rules and to the log pipeline, names the likely cause, and drafts a fix as a pull request.
What does the loop cost to run?
Agents run on your own Claude or ChatGPT subscription, API keys or LLM gateway, and Nori never charges for tokens. Nori plans start with a 30-day free trial with no card, then Developer at $99 per month or Team from $250 per month. Machines sleep when idle and wake on demand.