rmagent-so — The Security Observatory
The witness-question half of the RMAgent security observatory: ask a small
set of allowlisted named questions, track the identities that matter, and
never copy the log home.
This is the Security Observatory engine, split out of rmagent-windows so the
question half can be reasoned about (and loaded) on its own. rmagent-windows
remains the complete, runnable skill; rmagent-fr is the Flight Recorder
(tracing) half. The three skills share one constitution.
Needle tier 0 — offline extraction and drift
Alongside the Laya matrices, every skill in this family can call
needle — a 121M on-device model (Cactus Compute Needle, ~35 MB, no
network, no keys, ~100 MB RAM) installed once on the jump host, never on
the witnesses. It is the free tier of the judgment stack: needle extracts
and compares offline, Laya judges, the LLM reasons.
Two scripts ship in scripts/:
needle_extract.py — typed field extraction from a witness fragment
(count, source_ip, …). Rigid tokens (numbers, IPs) are reliable;
semantic fields are not, so the wrapper validates what it can (:ip,
:int) and blanks anything it cannot trust — never a guess.echo "<attest answer>" | scripts/needle_extract.py user count:int source_ip:ip --json
needle_drift.py — baseline-drift detection via needle's 3072-dim
embeddings: record what an answer normally looks like, score today's
answer against it (similar / drifted / changed, thresholds calibrated
empirically). Separates shape and topic, not field values — value drift
stays the job of the field rules and correlate joins.echo "<routine answer>" | scripts/needle_drift.py record <host>-<question>
echo "<today's answer>" | scripts/needle_drift.py score <host>-<question>
The engine runs in-process on the jump host (the wrapper finds a Python
with cactus-needle — set NEEDLE_PYTHON if it lives elsewhere). No port
is opened, nothing is installed on any witness, and the baselines are
kilobyte holes under ~/.rmagent/needle-drift/, not a lake. On an
air-gapped estate this tier keeps working — and the judgment tier with it: Laya is offline too (pre-seed its HF-cache checkpoint on air-gapped hosts), so no matrix judgment waits for a connected session.
Non-negotiables
- Watch only. No
actuate. No systemctl stop, no usermod, no firewall edits.
- Allowlisted questions only — never an arbitrary shell.
- Capped answers (32 KB) — oversized pulls become holes, never a lake.
- Your estate only. No box you do not administer.
- No tight retry on a silent host.
- Credentials never in the inventory file — env or
~/.rmagent/creds.json.
- Never trust a "no findings" result until you have confirmed the witness can see.
The questions
| Question |
Returns |
Must NOT return |
attest |
alive, last boot, admin failed/ok logons, local admin count, SYSTEM conns, raw_4624_24h + blind_check + blind_count + oldest_security_event |
a full Security log dump |
sketch |
admin failed in window, new local admins 24h, running priv services, new services/tasks |
raw event lists |
edges |
tracked logons (src IP, LogonId, auth pkg) + explicit-cred uses (4648) + special-priv grants (4672) + outbound conns, capped |
the whole connection table |
explain |
identity/svc/task changes + 4648/4672 + WMI subs + audit-cleared (1102) + LOLBin spawns w/ cmdline, capped |
the whole ring/tenant export |
netedges |
Sysmon EID3 outbound conns + EID22 DNS for tracked principals |
the full netflow; not LSASS / injection / file creates / registry sets (those are a false claim — see regedges) |
pslogs |
PowerShell script blocks (4104) — the ACTUAL CODE being executed, decompiled |
the whole PowerShell log |
kernring |
10-second burst capture of process events from the Sysmon ring |
a persistent agent |
attackmap |
~16 registry persistence locations (Run/RunOnce, IFEO, SilentProcessExit, cmd AutoRun, …), ATT&CK-tagged, FP-allowlisted |
the whole hive / filesystem |
regedges |
path-allowlisted Sysmon 13 (Registry value set) on those same latches, tracked principals, + sysmon_reg blind_check |
a hive dump, unbounded EID13, or any registry write |
krb |
DC only. 4768 TGT (AS-REP roast), 4769 TGS (Kerberoasting — RC4 etype 0x17), 4771 pre-auth spray, 4776 NTLM validation — collapsed per principal/SPN |
the whole Kerberos log, a domain dump |
dcsync |
DC only. 4662 carrying DRS replication-rights GUIDs (DCSync), 5136 directory changes (DCShadow), with the replicating principal + 4624 type-3 context |
the whole directory log |
dirchange |
DC only. 4720/4726 accounts, 4728/4732/4756 privileged-group adds, 4740 lockouts, 1102 audit cleared — restricted to the privileged groups that matter |
a directory dump |
flowstats |
per-adapter byte totals + top destinations (the T1041 volume baseline) |
the full packet capture |
deepwindow |
a short-lived ETW kernel trace, captured at full fidelity, stopped, read back |
a persistent agent |
canary |
any auth attempt against a decoy identity (4624/4625/4740) + the source IPs |
anything about real accounts |
canary — the patient-zero tripwire (Rev 15)
A canary is a decoy identity that exists only to be touched. Any
authentication attempt against it is critical by definition — there is no
legitimate reason to log on as honeyadmin. This turns patient-zero
detection from a graph walk into a tripwire: near-zero false positive, no
correlation needed.
- Declare canaries in the inventory:
canaries: [honeyadmin, svcbackup2]
- With none declared, the payload falls back to decoy-name heuristics
(
canary, honey, decoy, tripwire, …) so an estate that planted
decoys without updating the inventory still gets coverage
- A hit surfaces as a critical
canary_tripped finding in both drift
and correlate, carrying the source IPs — the shortlist for
actuate.py block_ip
The doors (Rev 21)
ask() dispatches per witness:
| door |
For |
Payloads |
Budget |
winrm (default) |
Windows |
questions/windows/*.ps1 |
~8191 cmdline (base64) |
psrp |
Windows |
questions/windows/*.ps1 |
none (script in the message body) |
ssh |
Linux / AIX / Unix |
questions/linux/*.sh (stdin) |
none |
Row os: linux implies the ssh door. pywinrm is only required for the
winrm/psrp doors — a jump host without pywinrm can still ask Linux witnesses.
Deploying a whole kit? See HUNT-KIT.md — so+fr are two halves; the hunt
driver, the drill, and the response live in rmagent-windows, rmagent-redteam,
rmagent-actuate, and rmagent-core.
The scripts
| Script |
Role |
scripts/stc.py |
Security Trace Context — the W3C traceparent analog. Context propagates across hosts; event data never does |
scripts/lib.py |
The engine — allowlisted ask(), signal-aware cap, holes, pywinrm transport, scrt credential fallback, attackmap FP allowlist. Rev 17: unparseable answers are holes (not clean), credentials never touch os.environ, and the silent-host cooldown (mark_silent/cooldown_left) enforces "no tight retry on a silent host" in code |
scripts/hunt.py |
The walk — edges → explain → pslogs where smoke; smoke → Telegram. Runs correlate at the end. Rev 17: skips witnesses in cooldown and records the skip as a hole |
scripts/correlate.py |
Cross-witness join — cross-host-account, lateral-hop (critical), explicit-cred-to-peer, shared-logonid (critical), canary_tripped. Adds triage ranking + recommended actuate actions. Rev 17: the shared-logonid join is the (LogonId, user) PAIR within 10 minutes (per-boot coincidences downgrade to info) and the peer match is an exact token, not a substring |
scripts/patient_zero.py |
The backward graph walk with honest termination — origin vs retention-boundary vs blind-witness vs no-signal vs cycle |
scripts/drift.py |
Baseline + diff — new_admins (critical), sysmon_change (critical), witness_blind (critical), new_persistence, canary_tripped (critical) |
scripts/case.py |
Open / list / close a one-page case. --ticket PAY-4419 threads a business id through everything. Rev 17: prune --days N sheds old cases' raw answers (the story is kept) — a lake by accretion is still a lake |
scripts/notify.py |
Telegram helper (token+chat from secrets store). |
scripts/test_enterprise.py |
Pure-logic test suite for all of the above (57 assertions). |
scripts/test_budget.py |
Enforces the WinRM ~8191-char budget on every payload. |
scripts/questions/windows/*.ps1 |
The payloads above. Compact — preamble+payload must encode under WinRM's ~8191-char budget (×2.7 for UTF-16LE base64). Rev 17: every event query carries -MaxEvents so the DEVICE sheds first (a flood cannot balloon the scan past the timeout), and tracked-name matching is exact on the bare name |
The signal-aware cap (Rev 15)
The flat 32 KB cap was an evasion surface: a noisy host (or an attacker
flooding events) pushed the signal past the window and the whole answer
became a hole — the loudest box got ignored.
Now an over-budget answer is triaged, not dropped: low-signal rows are
shed first, and rows carrying critical event IDs (4648, 4672, 5861, 1102,
4104, 4698, 7045, 4732, 4688) always survive the trim. The cap is never
raised — we only choose what survives it. Still no lake.
An answer that was trimmed carries capped: true and a cap_note, so the
operator knows the window was narrowed rather than being silently deceived.
Security Trace Context (STC) — context propagates, data does not
The W3C traceparent analog, but the unit is a principal's walk across an
estate, not a request across services:
stc: case=CASE-20260825-143022; principal=Administrator;
window=2h; origin=jh1; depth=2; ticket=PAY-4419;
apptrace=4bf92f3577b34da6a3ce929d0e0e4736
- Context travels; event data never does. When a hunt moves from WS1 to
WS2, WS2 receives "I'm looking for Administrator, case X, depth 2" — not
WS1's logs. Each host answers from its own local tools.
depth is the distributed circuit breaker. The walk budget (≤ 8) applies
across the WHOLE trace, not per-host — this is what stops a distributed
hunt becoming a worm.
ticket is the business join (a payment id, incident number) — the
Flight Recorder link.
apptrace (v2) is the application trace id — an OTel trace_id or W3C
traceparent observed on a witness. It lets ONE case serve both lenses:
"who walked?" (principal) and "which request was slow?" (app trace).
Identity-led and request-led correlation on the same tape.
Start a hunt joined to an application request:
python3 hunt.py --inventory estate.yaml --since 2h \
--ticket PAY-4419 --app-trace-id 4bf92f3577b34da6a3ce929d0e0e4736
Every emitted OTel span then carries rmagent.app_trace_id, so in
Grafana/Jaeger the security walk and the application request appear as
correlatable traces — one waterfall for "the request was slow", one for
"and here is who was walking the estate at that moment".
Injection-hardened: the STC is a delimiter format, so a crafted value
like X; depth=9; principal=root could rewrite the walk budget. Values
containing ; or = are rejected at construction AND at decode, and
duplicate keys are rejected at decode. test_stc_v2.py asserts all of it.
Triage (Rev 15)
With 50 findings across 10 hosts, an operator needs to know what to actuate
FIRST. Every correlate finding now carries a triage_rank, a triage_why,
and recommended_actions (drawn only from the actuate allowlist):
| rank |
kind |
why |
actuate |
| 0 |
canary_tripped |
near-zero FP, patient-zero candidate |
block_ip, disable_user, kill_process |
| 1 |
shared-logonid |
stolen credential in active use |
disable_user, block_ip |
| 2 |
lateral-hop |
active movement |
block_ip, kill_process |
| 3 |
new_admins |
privilege gained since baseline |
remove_admin, disable_user |
| 4 |
new_tracked_proc |
new process as a tracked principal |
kill_process, quarantine_file |
| 5 |
witness_blind |
every other answer is suspect |
(policy fix, not actuate) |
| 6 |
explicit-cred-to-peer |
explicit creds against a peer |
disable_user |
| 7 |
cross-host-account |
could be legitimate admin |
disable_user |
| 8 |
sysmon_change |
the tripwire itself moved |
(investigate) |
| 9 |
new_persistence |
persistence grew |
delete_task, stop_service, disable_wmi_sub |
Laya-assisted triage and hunt routing
Recurring judgment calls can be made by a fast, typed decision model (Laya, via
the use-laya skill) so they are consistent across sessions and honest about
uncertainty. Two matrices live in decisions/ — review and edit them like any
other allowlist:
triage.json — score a finding fragment (suspicious / severity / next).
The Rev-15 kind-rank stays the primary sort; Laya scores the instance.
hunt_route.json — pick the next witness question from the ten allowlisted
questions (or hand the hunt to the LLM when unsure). It can never introduce
a question outside the allowlist, and it changes nothing about watch-only.
echo "<finding fragment>" | scripts/laya_decide.py triage
scripts/laya_decide.py hunt_route --state-file hunt.json
Policy (in each matrix): confidence below 0.5 is flagged ESCALATE — route those
to the LLM or the operator instead of acting on them. Verdicts are advisory;
the standing rules (blind check, capped pulls, watch-only) are unchanged.
The blind check (standing rule)
Found live on WS2: the Logon audit policy was Failure-only, so edges returned
zero logons while an Administrator session was connected. Every "clean"
report from that box was a silent false negative.
Every attest now carries raw_4624_24h (unfiltered 4624 count), blind_check
(per-subcategory ok/BLIND/unknown for the sources the questions depend on), and
blind_count (must be 0). drift treats a growing blind_count as critical.
Rev 17 hardens the check itself:
- Locale-invariant.
auditpol is parsed by SUBCATEGORY GUID (the {0CCE...}
column in the CSV), not display name — a non-English Windows no longer reports
every entry as unknown, which used to make blind_count=0 and the box look
sighted.
- Two new sources the questions depend on:
Process CmdLine (4688 command-line
inclusion — without it lolbin_spawns.c is null and the LOLBin detection is
decorative) and ScriptBlock Logging (4104 — without it pslogs is ALWAYS
empty). These are the two an attacker is most likely to switch off.
Standing rule: never trust a "no findings" result until you have confirmed
the witness can see. An empty answer is not a clean answer — and (Rev 17)
neither is an unparseable one: a payload that fails to emit JSON is a hole,
not ok with a raw blob.
Relationship to the other skills
| Skill |
Half |
rmagent-windows |
The complete skill — both halves, fully runnable |
rmagent-fr |
The Flight Recorder (tracing) half |
rmagent-so |
This skill — the witness-question (Security Observatory) half |
rmagent-redteam |
The drill — stages artifacts, scores detection |
rmagent-actuate |
Phase 1 response — named, journaled, reversible |
rmagent-linux |
The Linux/macOS sibling of this skill |
1---2name: rmagent-so3description: >4 The Security Observatory — the witness-question half of the RMAgent security5 observatory. Pull-based, allowlisted named questions over WinRM :59856 tracking Administrator and SYSTEM: attest (with blind_check — can this7 witness actually see?), sketch, edges, explain, netedges, pslogs, kernring,8 attackmap, flowstats, deepwindow. Cross-witness correlation joins the answers9 (cross-host-account, lateral-hop, shared-logonid); baseline drift flags new10 admins and witness blindness as critical. Use for identity-led compromise,11 lateral movement, living-off-the-land, silent hosts, and honest root-cause on12 Windows boxes you administer. Watch-only, capped at 32 KB, holes instead of13 dumps — no lake, no agent install.14metadata:15 source: https://skillmd.com/skills/drolu/rmagent-so16---1718# rmagent-so — The Security Observatory1920The witness-question half of the RMAgent security observatory: **ask a small21set of allowlisted named questions, track the identities that matter, and22never copy the log home.**2324This is the Security Observatory engine, split out of `rmagent-windows` so the25question half can be reasoned about (and loaded) on its own. `rmagent-windows`26remains the complete, runnable skill; `rmagent-fr` is the Flight Recorder27(tracing) half. The three skills share one constitution.2829## Needle tier 0 — offline extraction and drift3031Alongside the Laya matrices, every skill in this family can call32**needle** — a 121M on-device model (Cactus Compute Needle, ~35 MB, no33network, no keys, ~100 MB RAM) installed once on the jump host, never on34the witnesses. It is the free tier of the judgment stack: needle extracts35and compares offline, Laya judges, the LLM reasons.3637Two scripts ship in `scripts/`:3839- `needle_extract.py` — typed field extraction from a witness fragment40 (`count`, `source_ip`, …). Rigid tokens (numbers, IPs) are reliable;41 semantic fields are not, so the wrapper validates what it can (`:ip`,42 `:int`) and blanks anything it cannot trust — never a guess.43 ```bash44 echo "<attest answer>" | scripts/needle_extract.py user count:int source_ip:ip --json45 ```46- `needle_drift.py` — baseline-drift detection via needle's 3072-dim47 embeddings: record what an answer normally looks like, score today's48 answer against it (similar / drifted / changed, thresholds calibrated49 empirically). Separates shape and topic, not field values — value drift50 stays the job of the field rules and correlate joins.51 ```bash52 echo "<routine answer>" | scripts/needle_drift.py record <host>-<question>53 echo "<today's answer>" | scripts/needle_drift.py score <host>-<question>54 ```5556The engine runs in-process on the jump host (the wrapper finds a Python57with `cactus-needle` — set `NEEDLE_PYTHON` if it lives elsewhere). No port58is opened, nothing is installed on any witness, and the baselines are59kilobyte holes under `~/.rmagent/needle-drift/`, not a lake. On an60air-gapped estate this tier keeps working — and the judgment tier with it: Laya is offline too (pre-seed its HF-cache checkpoint on air-gapped hosts), so no matrix judgment waits for a connected session.6162## Non-negotiables6364- **Watch only.** No `actuate`. No `systemctl stop`, no `usermod`, no firewall edits.65- **Allowlisted questions only** — never an arbitrary shell.66- **Capped answers** (32 KB) — oversized pulls become holes, never a lake.67- **Your estate only.** No box you do not administer.68- **No tight retry** on a silent host.69- **Credentials never in the inventory file** — env or `~/.rmagent/creds.json`.70- **Never trust a "no findings" result until you have confirmed the witness can see.**7172## The questions7374| Question | Returns | Must NOT return |75|---|---|---|76| `attest` | alive, last boot, admin failed/ok logons, local admin count, SYSTEM conns, **raw_4624_24h + blind_check + blind_count + oldest_security_event** | a full Security log dump |77| `sketch` | admin failed in window, new local admins 24h, running priv services, new services/tasks | raw event lists |78| `edges` | tracked logons (src IP, LogonId, auth pkg) + explicit-cred uses (4648) + special-priv grants (4672) + outbound conns, capped | the whole connection table |79| `explain` | identity/svc/task changes + 4648/4672 + WMI subs + audit-cleared (1102) + LOLBin spawns w/ cmdline, capped | the whole ring/tenant export |80| `netedges` | Sysmon **EID3** outbound conns + **EID22** DNS for tracked principals | the full netflow; **not** LSASS / injection / file creates / registry sets (those are a false claim — see `regedges`) |81| `pslogs` | PowerShell script blocks (4104) — the ACTUAL CODE being executed, decompiled | the whole PowerShell log |82| `kernring` | 10-second burst capture of process events from the Sysmon ring | a persistent agent |83| `attackmap` | ~16 registry persistence *locations* (Run/RunOnce, IFEO, SilentProcessExit, cmd AutoRun, …), ATT&CK-tagged, FP-allowlisted | the whole hive / filesystem |84| `regedges` | path-allowlisted Sysmon **13** (Registry value set) on those same latches, tracked principals, + `sysmon_reg` blind_check | a hive dump, unbounded EID13, **or any registry write** |85| `krb` | **DC only.** 4768 TGT (AS-REP roast), 4769 TGS (**Kerberoasting — RC4 etype 0x17**), 4771 pre-auth spray, 4776 NTLM validation — collapsed per principal/SPN | the whole Kerberos log, a domain dump |86| `dcsync` | **DC only.** 4662 carrying **DRS replication-rights GUIDs** (DCSync), 5136 directory changes (DCShadow), with the replicating principal + 4624 type-3 context | the whole directory log |87| `dirchange` | **DC only.** 4720/4726 accounts, 4728/4732/4756 privileged-group adds, 4740 lockouts, **1102 audit cleared** — restricted to the privileged groups that matter | a directory dump |88| `flowstats` | per-adapter byte totals + top destinations (the T1041 volume baseline) | the full packet capture |89| `deepwindow` | a short-lived ETW kernel trace, captured at full fidelity, stopped, read back | a persistent agent |90| `canary` | any auth attempt against a decoy identity (4624/4625/4740) + the source IPs | anything about real accounts |9192### `canary` — the patient-zero tripwire (Rev 15)9394A canary is a decoy identity that exists **only to be touched**. Any95authentication attempt against it is critical by definition — there is no96legitimate reason to log on as `honeyadmin`. This turns patient-zero97detection from a graph walk into a tripwire: near-zero false positive, no98correlation needed.99100- Declare canaries in the inventory: `canaries: [honeyadmin, svcbackup2]`101- With none declared, the payload falls back to decoy-name heuristics102 (`canary`, `honey`, `decoy`, `tripwire`, …) so an estate that planted103 decoys without updating the inventory still gets coverage104- A hit surfaces as a **critical** `canary_tripped` finding in both `drift`105 and `correlate`, carrying the source IPs — the shortlist for106 `actuate.py block_ip`107108## The doors (Rev 21)109110`ask()` dispatches per witness:111112| door | For | Payloads | Budget |113|---|---|---|---|114| `winrm` (default) | Windows | `questions/windows/*.ps1` | ~8191 cmdline (base64) |115| `psrp` | Windows | `questions/windows/*.ps1` | none (script in the message body) |116| `ssh` | Linux / AIX / Unix | `questions/linux/*.sh` (stdin) | none |117118Row `os: linux` implies the ssh door. pywinrm is only required for the119winrm/psrp doors — a jump host without pywinrm can still ask Linux witnesses.120121**Deploying a whole kit?** See **HUNT-KIT.md** — so+fr are two halves; the hunt122driver, the drill, and the response live in `rmagent-windows`, `rmagent-redteam`,123`rmagent-actuate`, and `rmagent-core`.124125## The scripts126127| Script | Role |128|---|---|129| `scripts/stc.py` | Security Trace Context — the W3C `traceparent` analog. Context propagates across hosts; event data never does |130| `scripts/lib.py` | The engine — allowlisted `ask()`, **signal-aware cap**, holes, pywinrm transport, scrt credential fallback, attackmap FP allowlist. Rev 17: unparseable answers are holes (not clean), credentials never touch `os.environ`, and the **silent-host cooldown** (`mark_silent`/`cooldown_left`) enforces "no tight retry on a silent host" in code |131| `scripts/hunt.py` | The walk — edges → explain → pslogs where smoke; smoke → Telegram. Runs correlate at the end. Rev 17: skips witnesses in cooldown and records the skip as a hole |132| `scripts/correlate.py` | Cross-witness join — cross-host-account, lateral-hop (critical), explicit-cred-to-peer, shared-logonid (critical), canary_tripped. **Adds triage ranking + recommended actuate actions.** Rev 17: the shared-logonid join is the (LogonId, user) PAIR within 10 minutes (per-boot coincidences downgrade to info) and the peer match is an exact token, not a substring |133| `scripts/patient_zero.py` | The backward graph walk with **honest termination** — origin vs retention-boundary vs blind-witness vs no-signal vs cycle |134| `scripts/drift.py` | Baseline + diff — new_admins (critical), sysmon_change (critical), witness_blind (critical), new_persistence, **canary_tripped (critical)** |135| `scripts/case.py` | Open / list / close a one-page case. `--ticket PAY-4419` threads a business id through everything. Rev 17: `prune --days N` sheds old cases' raw answers (the story is kept) — a lake by accretion is still a lake |136| `scripts/notify.py` | Telegram helper (token+chat from secrets store). |137| `scripts/test_enterprise.py` | Pure-logic test suite for all of the above (57 assertions). |138| `scripts/test_budget.py` | Enforces the WinRM ~8191-char budget on every payload. |139| `scripts/questions/windows/*.ps1` | The payloads above. Compact — preamble+payload must encode under WinRM's ~8191-char budget (×2.7 for UTF-16LE base64). Rev 17: every event query carries `-MaxEvents` so the DEVICE sheds first (a flood cannot balloon the scan past the timeout), and tracked-name matching is exact on the bare name |140141### The signal-aware cap (Rev 15)142143The flat 32 KB cap was an **evasion surface**: a noisy host (or an attacker144flooding events) pushed the signal past the window and the whole answer145became a hole — the loudest box got ignored.146147Now an over-budget answer is **triaged, not dropped**: low-signal rows are148shed first, and rows carrying critical event IDs (4648, 4672, 5861, 1102,1494104, 4698, 7045, 4732, 4688) always survive the trim. The cap is never150raised — we only choose *what* survives it. Still no lake.151152An answer that was trimmed carries `capped: true` and a `cap_note`, so the153operator knows the window was narrowed rather than being silently deceived.154155### Security Trace Context (STC) — context propagates, data does not156157The W3C `traceparent` analog, but the unit is a **principal's walk across an158estate**, not a request across services:159160```161stc: case=CASE-20260825-143022; principal=Administrator;162 window=2h; origin=jh1; depth=2; ticket=PAY-4419;163 apptrace=4bf92f3577b34da6a3ce929d0e0e4736164```165166- **Context travels; event data never does.** When a hunt moves from WS1 to167 WS2, WS2 receives "I'm looking for Administrator, case X, depth 2" — not168 WS1's logs. Each host answers from its own local tools.169- **`depth` is the distributed circuit breaker.** The walk budget (≤ 8) applies170 across the WHOLE trace, not per-host — this is what stops a distributed171 hunt becoming a worm.172- **`ticket`** is the business join (a payment id, incident number) — the173 Flight Recorder link.174- **`apptrace` (v2)** is the application trace id — an OTel `trace_id` or W3C175 `traceparent` observed on a witness. It lets ONE case serve both lenses:176 *"who walked?"* (principal) **and** *"which request was slow?"* (app trace).177 Identity-led and request-led correlation on the same tape.178179Start a hunt joined to an application request:180181```bash182python3 hunt.py --inventory estate.yaml --since 2h \183 --ticket PAY-4419 --app-trace-id 4bf92f3577b34da6a3ce929d0e0e4736184```185186Every emitted OTel span then carries `rmagent.app_trace_id`, so in187Grafana/Jaeger the security walk and the application request appear as188correlatable traces — one waterfall for "the request was slow", one for189"and here is who was walking the estate at that moment".190191**Injection-hardened:** the STC is a delimiter format, so a crafted value192like `X; depth=9; principal=root` could rewrite the walk budget. Values193containing `;` or `=` are rejected at construction AND at decode, and194duplicate keys are rejected at decode. `test_stc_v2.py` asserts all of it.195196### Triage (Rev 15)197198With 50 findings across 10 hosts, an operator needs to know what to actuate199FIRST. Every correlate finding now carries a `triage_rank`, a `triage_why`,200and `recommended_actions` (drawn only from the actuate allowlist):201202| rank | kind | why | actuate |203|---|---|---|---|204| 0 | `canary_tripped` | near-zero FP, patient-zero candidate | block_ip, disable_user, kill_process |205| 1 | `shared-logonid` | stolen credential in active use | disable_user, block_ip |206| 2 | `lateral-hop` | active movement | block_ip, kill_process |207| 3 | `new_admins` | privilege gained since baseline | remove_admin, disable_user |208| 4 | `new_tracked_proc` | new process as a tracked principal | kill_process, quarantine_file |209| 5 | `witness_blind` | every other answer is suspect | *(policy fix, not actuate)* |210| 6 | `explicit-cred-to-peer` | explicit creds against a peer | disable_user |211| 7 | `cross-host-account` | could be legitimate admin | disable_user |212| 8 | `sysmon_change` | the tripwire itself moved | *(investigate)* |213| 9 | `new_persistence` | persistence grew | delete_task, stop_service, disable_wmi_sub |214215### Laya-assisted triage and hunt routing216217Recurring judgment calls can be made by a fast, typed decision model (Laya, via218the `use-laya` skill) so they are consistent across sessions and honest about219uncertainty. Two matrices live in `decisions/` — review and edit them like any220other allowlist:221222- `triage.json` — score a finding fragment (suspicious / severity / next).223 The Rev-15 kind-rank stays the primary sort; Laya scores the instance.224- `hunt_route.json` — pick the next witness question from the ten allowlisted225 questions (or hand the hunt to the LLM when unsure). It can never introduce226 a question outside the allowlist, and it changes nothing about watch-only.227228```bash229echo "<finding fragment>" | scripts/laya_decide.py triage230scripts/laya_decide.py hunt_route --state-file hunt.json231```232233Policy (in each matrix): confidence below 0.5 is flagged ESCALATE — route those234to the LLM or the operator instead of acting on them. Verdicts are advisory;235the standing rules (blind check, capped pulls, watch-only) are unchanged.236237## The blind check (standing rule)238239Found live on WS2: the Logon audit policy was Failure-only, so `edges` returned240**zero logons while an Administrator session was connected**. Every "clean"241report from that box was a silent false negative.242243Every `attest` now carries `raw_4624_24h` (unfiltered 4624 count), `blind_check`244(per-subcategory ok/BLIND/unknown for the sources the questions depend on), and245`blind_count` (must be 0). `drift` treats a growing `blind_count` as **critical**.246247Rev 17 hardens the check itself:248- **Locale-invariant.** `auditpol` is parsed by SUBCATEGORY GUID (the `{0CCE...}`249 column in the CSV), not display name — a non-English Windows no longer reports250 every entry as `unknown`, which used to make `blind_count=0` and the box look251 sighted.252- **Two new sources the questions depend on:** `Process CmdLine` (4688 command-line253 inclusion — without it `lolbin_spawns.c` is null and the LOLBin detection is254 decorative) and `ScriptBlock Logging` (4104 — without it `pslogs` is ALWAYS255 empty). These are the two an attacker is most likely to switch off.256257**Standing rule: never trust a "no findings" result until you have confirmed258the witness can see.** An empty answer is not a clean answer — and (Rev 17)259neither is an unparseable one: a payload that fails to emit JSON is a hole,260not `ok` with a raw blob.261262## Relationship to the other skills263264| Skill | Half |265|---|---|266| `rmagent-windows` | The complete skill — both halves, fully runnable |267| `rmagent-fr` | The Flight Recorder (tracing) half |268| `rmagent-so` | This skill — the witness-question (Security Observatory) half |269| `rmagent-redteam` | The drill — stages artifacts, scores detection |270| `rmagent-actuate` | Phase 1 response — named, journaled, reversible |271| `rmagent-linux` | The Linux/macOS sibling of this skill |