Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
docs: pages for the gap-closure waves, and the counts they moved (#1110)
Beenu Arora5531396f2a4f
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 6e41920e7..1b5d733bb 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -39,6 +39,80 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0writes `closed_at`. Both now read from `app.services.case_status`.+### Fixed++- **SSO could not sign anyone in.** `aisoc_sso_connections` was created by migration `080` and+ written by nothing, so `resolve_connection` found no row and both SAML and OIDC answered **403+ on every deployment**. There is now a tenant-scoped CRUD surface for it. The OIDC `id_token` is+ verified against the provider's JWKS — it was decoded with `verify_signature: False` — and the+ `nonce` is compared, having been generated and never checked. Sign-in state moved to Redis: as a+ process dictionary it broke roughly (n-1)/n of sign-ins on an n-replica deployment.+- **MTTA published a confident `0.0`.** `alerts.first_seen_at` had no writer, so the mean was taken+ over NULL. It is written when an analyst claims an alert, with `COALESCE` so a re-claim does not+ reset the clock to measure the last handoff.+- **The evidence chain was always empty.** Three readers, no writer, so `GET /cases/{id}/evidence`+ returned `[]` under a heading reading "Evidence Chain". Entries are appended on alert links and+ status changes, hash-chained so an edit or removal is detectable. Tamper *evidence*, not tamper+ proofing — a test asserts a consistently rewritten chain still verifies, so nobody concludes+ otherwise.+- **SLA reporting had nothing to aggregate.** `alert_sla_events` had one writer, a manual POST+ nothing called, so 350 lines of correct MTTD/MTTR/MTTC arithmetic ran over an empty table.+- **The console's rule-Approve button could not succeed.** `/decide` answers 412 without a+ `candidate_rule` verdict and `/evaluate-rule` is its only writer, which had no web client — and+ fixtures were never stored, so even calling it directly meant re-deriving fixtures the drafter+ had discarded. Migration `082` stores them on the proposal.+- **Marketplace installs were lost on restart** and disagreed between replicas. The+ `marketplace_installs` table from migration `056` had no reader or writer.+- **The author of a detection rule could approve it.** `proposed_by_id` was compared against+ nothing, on the one surface that writes executable code into the engine. Overridable with+ `AISOC_DETECTION_SOD_ENFORCED=0` for a single-analyst deployment.+- **The live agent evaluation could never have measured anything.** It imported+ `InvestigatorAgent`, a class that exists only in the historical prototype, and the hosted-key+ check returned first so the broken import was never reached. Repointed at the real agent, it+ measures a **9.3% verdict-flip rate** against a local model.+- **Three stores had a backup and no restore.** `backup.sh` covered five, `restore.sh` covered two.+ Neo4j, Qdrant and Redis now restore, and `check_backup_restore_parity.py` fails CI on the next+ store that gains a backup without one.++### Added++- **Content packs** bundle detections, correlations, an investigation plan, response and+ validation — a pack was a playbook, which is the last fifth of the thing its name implies.+- **Inbound detection migration** from Splunk SPL, Sentinel KQL and Elastic EQL. On the 2,005+ quarantined Splunk rules bundled here, 1,734 translate; **1,711 of those are partial**, because+ the corpus is aggregation-heavy and thresholds do not carry. The suite asserts that ratio so the+ headline cannot be read as a finished migration.+- **Alert prioritisation** from asset criticality, identity privilege and Known Exploited+ Vulnerability exposure. Context multiplies severity and never sums, so it reorders within a tier+ and cannot invert a severity gap.+- **Case queues, three SLA clocks, escalation, shift handoff and transition history.** Escalation+ keys on the acknowledgement clock, because a case somebody is working on is not the failure a+ ladder addresses.+- **Legal hold, data residency, field-level access and per-subject deletion.** A hold outranks+ retention unconditionally.+- **Workload identities, API-key rotation in place, time-boxed privilege grants and ABAC+ conditions.** Conditions narrow and never grant, and a condition the request carries no data for+ denies rather than passes.+- **Detection lifecycle**: dev/staging/production, shadow mode independent of environment, and+ version history so a promotion can be rolled back.+- **Chaos coverage** for actions as well as events, and for ClickHouse, Neo4j, Qdrant, Redis and+ Kafka, on a weekly trigger — the existing harness had run live once, by hand.+- **Load profiles** — ramp, burst, backpressure and 24/72-hour soak. No `--duration` flag existed,+ so there had never been a soak. The long profiles have **not been run** and no figure is claimed.+- Documentation for each of the above, under **Operations** and **Migrating to AiSOC**.++### Changed++- **The detection-efficacy corpus can now grade.** An agent answering "true positive" to everything+ scored **1.000** and now scores **0.727**. The benign class was derived from `response_class ==+ "monitor"`, and those incidents are BloodHound enumeration tagged T1087.002 — a real attack with+ a monitoring response. 75 benign and false-positive cases are now authored, and 423 negative+ fixtures that tested an impossible `not-<value>` string became 18.+- Throughput is published as **four separate claims** — ingest, lake, alert path and detection+ coverage — because one number described three pipelines that differ by orders of magnitude.+- Three real routable address ranges, including a known Tor exit range, were replaced with RFC 5737+ documentation ranges across the corpus and generators.+## [15.1.0] - 2026-10-03No breaking changes. Two routes are added and none removed, so everydiff --git a/README.md b/README.mdindex 1d4370191..dd1557d30 100644--- a/README.md+++ b/README.md@@ -98,6 +98,12 @@ among those with vendor-specific normalization and setup docs([coverage](https://beenuar.github.io/AiSOC/docs/connectors/api-coverage)). Without a vendor profilea connector still ingests through a generic mapping that resolves host, user and source IP.+Bringing existing detections? `packages/aisoc-migrate` translates Splunk SPL, Sentinel KQL and+Elastic EQL, and **refuses rather than approximating** what it cannot carry — an almost-right rule is+harder to find than a missing one. On the 2,005 Splunk rules bundled here, 1,734 translate and 1,711+of those are partial: field matches carried, thresholds did not+([what to do with a partial](apps/docs/docs/migration/from-splunk.md)).+## How it worksIngest normalizes to a common shape and Kafka carries it, then@@ -164,9 +170,7 @@ thing in a fresh install that is neither synthetic nor yours.| **Demo** | `make demo` | `is_synthetic = true`, labelled in the console || **Benchmark / fixtures** | `services/agents/tests/eval_data/`, `**/tests/` | Published rows carry `substrate: true`; fixtures never ship in an image |-**Production never silently falls back to synthetic data.** An unreachable backend makes the console-name the failure rather than invent an investigation, and an unmeasured figure reads *not measured*,-never `0`. It was not always so: [the reality audit](docs/audit/REPOSITORY_REALITY.md) has each case.+**Production never silently falls back to synthetic data.** An unreachable backend makes the console name the failure rather than invent an investigation, and an unmeasured figure reads *not measured*, never `0`. It was not always so: [the reality audit](docs/audit/REPOSITORY_REALITY.md) has each case.## AI agents@@ -181,10 +185,7 @@ Agents triage alerts and investigate incidents. What they can and cannot do:## Project maturity-**Stable is defined, and a gate enforces it.** It was ungated prose until three rows were found-describing coverage that did not exist. A row is Stable only with a check that runs on every pull-request with no path filter, drives the real production path against real infrastructure, and has a-**negative control proven by breaking the thing and watching it go red**. ([the bar](docs/audit/MATURITY_DEFINITION.md))+**Stable is defined, and a gate enforces it.** It was ungated prose until three rows were found describing coverage that did not exist. A row is Stable only with a check that runs on every pull request with no path filter, drives the real production path against real infrastructure, and has a **negative control proven by breaking the thing and watching it go red**. ([the bar](docs/audit/MATURITY_DEFINITION.md))| Capability | Status | Tested | Production ready ||---|---|---|---|@@ -214,18 +215,16 @@ request with no path filter, drives the real production path against real infras## Troubleshooting-`make doctor` checks host tools, memory, disk, every port and each datastore by *querying* it rather than-asking whether its container is up, then prints the command to run next. A container killed by a full-Docker VM is named as that, not as the service that happened to die.+`make doctor` checks host tools, memory, disk, every port and each datastore by *querying* it rather than asking whether its container is up, then prints the command to run next. A container killed by a full Docker VM is named as that, not as the service that happened to die.([the six most common failures](https://beenuar.github.io/AiSOC/docs/installation#the-six-most-common-failures))## Security-Secrets are generated per deployment and never committed; connector credentials are encrypted at-rest. Services connect to Postgres as a DML-only role, so row-level security actually applies, and-tenant isolation is enforced at the query layer in every store. RBAC gates every mutating route,-ingest is authenticated, and the default install sends no prompt anywhere — the model runs beside-it.+Secrets are generated per deployment and never committed; connector credentials are encrypted at rest. Services connect to Postgres as a DML-only role, so row-level security actually applies, and tenant isolation is enforced at the query layer in every store. RBAC gates every mutating route, ingest is authenticated, and the default install sends no prompt anywhere — the model runs beside it.++SAML and OIDC sign-in with per-connection tenant and group mapping, SCIM provisioning, attribute+conditions that narrow a permission, and time-boxed elevation instead of standing admin+([setup](apps/docs/docs/operations/enterprise-sso.md)).**A service with no credential refuses to serve rather than serving unauthenticated.** The [changelog](CHANGELOG.md) records each fix; report via [SECURITY.md](SECURITY.md).@@ -237,14 +236,10 @@ make smoke # the golden pipeline, against a running stackmake stats # recount every figure this README publishes```-Guides: [add a connector](https://beenuar.github.io/AiSOC/docs/plugins/hello-plugin) · [add a detection](https://beenuar.github.io/AiSOC/docs/detections/hello-hunt) ·-[plugin lifecycle](https://beenuar.github.io/AiSOC/docs/plugins/lifecycle). Every count above is-recounted from the tree, and CI fails if this README disagrees.+Guides: [add a connector](https://beenuar.github.io/AiSOC/docs/plugins/hello-plugin) · [add a detection](https://beenuar.github.io/AiSOC/docs/detections/hello-hunt) · [plugin lifecycle](https://beenuar.github.io/AiSOC/docs/plugins/lifecycle). Every count above is recounted from the tree, and CI fails if this README disagrees.## Funding · Roadmap · Contributing · License-Development is funded and supported by **[Cyble](https://cyble.com)**, who pay for the engineering time behind AiSOC-and release it under the MIT licence rather than keeping it. That buys no special treatment here — no Cyble-only-features, no gated modules, no telemetry. ([full credits](.github/CREDITS.md))+Development is funded and supported by **[Cyble](https://cyble.com)**, who pay for the engineering time behind AiSOC and release it under the MIT licence rather than keeping it. That buys no special treatment here — no Cyble-only features, no gated modules, no telemetry. ([full credits](.github/CREDITS.md))[ROADMAP.md](ROADMAP.md) · [CONTRIBUTING.md](CONTRIBUTING.md) · [SECURITY.md](SECURITY.md) · MITdiff --git a/ROADMAP.md b/ROADMAP.mdindex 31a050218..f328ae80c 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -44,7 +44,7 @@ A proof-first, security-first program to make every README claim gate-backed, cl- **Phase D (breadth):** D1 eight connectors (QRadar/Exabeam/Securonix/Devo/Netskope/Windows-Sysmon/Zeek-Suricata/syslog-CEF) · D2 AI/LLM-usage audit connector + `llm-*` detections + hot/cold lake tiering · D3 live-vendor mock-server smoke.- **Phase E (prove it):** E1 CI-gated benchmark scoreboard tied to a deterministic live-agent MITRE-accuracy run.-The claim-to-gate matrix stands at **285 rows — 285 GATED / 0 PARTIAL / 0 NO GATE** — **every product claim is backed by a failing test**, none is a named deferral either, and the ratchet (`MAX_NO_GATE=0`) forbids any regression. Every PARTIAL row was closed by building the gate it named, never by relabelling. The last two rested on the live-agent eval workflow, which this file said had simply never run: the real reason was that its live path imported a class that exists nowhere in `services/agents`, so its first dispatch failed in 92 seconds and every later one would have. With that fixed the workflow measures, and the groundedness floor is **0.40 over a deterministic 10-incident slice**, derived from ten runs across two environments rather than chosen — seven local runs returning 0.5561 to four decimal places, three GitHub-runner runs returning 0.5821, 0.5329 and 0.5933. Every one is a locally-served `qwen2.5:0.5b`; no hosted provider has been exercised and the floor describes none. Count the table rows with `python3 scripts/check_claim_gate_matrix.py` rather than trusting a figure quoted in prose — this line has gone stale before. The six lettered deferrals are scoped in [`docs/audit/DEFERRED_SUBPHASES.md`](docs/audit/DEFERRED_SUBPHASES.md).+The claim-to-gate matrix stands at **291 rows — 291 GATED / 0 PARTIAL / 0 NO GATE** — **every product claim is backed by a failing test**, none is a named deferral either, and the ratchet (`MAX_NO_GATE=0`) forbids any regression. Every PARTIAL row was closed by building the gate it named, never by relabelling. The last two rested on the live-agent eval workflow, which this file said had simply never run: the real reason was that its live path imported a class that exists nowhere in `services/agents`, so its first dispatch failed in 92 seconds and every later one would have. With that fixed the workflow measures, and the groundedness floor is **0.40 over a deterministic 10-incident slice**, derived from ten runs across two environments rather than chosen — seven local runs returning 0.5561 to four decimal places, three GitHub-runner runs returning 0.5821, 0.5329 and 0.5933. Every one is a locally-served `qwen2.5:0.5b`; no hosted provider has been exercised and the floor describes none. Count the table rows with `python3 scripts/check_claim_gate_matrix.py` rather than trusting a figure quoted in prose — this line has gone stale before. The six lettered deferrals are scoped in [`docs/audit/DEFERRED_SUBPHASES.md`](docs/audit/DEFERRED_SUBPHASES.md).## v4.0 — Shippeddiff --git a/apps/docs/docs/compliance/evidence-pack.md b/apps/docs/docs/compliance/evidence-pack.mdindex 4b7919272..dbd38d450 100644--- a/apps/docs/docs/compliance/evidence-pack.md+++ b/apps/docs/docs/compliance/evidence-pack.md@@ -33,10 +33,7 @@ and says so.| Prompt-injection resistance | Three adversarial corpora: 32 payloads scanned in isolation and 71 incident pairs whose payloads are placed in attacker-controllable fields, both against a clean twin with a recall floor and a false-positive ceiling, plus 34 held-out pairs authored after the guard was frozen and carrying no floor at all, on which the guard measures 7.1% | `services/agents/tests/adversarial/` || Claim-to-gate traceability | Every product claim mapped to the CI job that fails when it stops being true | `docs/audit/CLAIM_TO_GATE_MATRIX.md` |-The last row is the one worth reading first. It is the honest index: 285 rows-The last row is the one worth reading first. It is the honest index: 285 rows-The last row is the one worth reading first. It is the honest index: 285 rows-The last row is the one worth reading first. It is the honest index: 285 rows+The last row is the one worth reading first. It is the honest index: 291 rows`GATED`, 0 `PARTIAL`, and a ratchet that refuses to let a row sit at`NO GATE`. Re-read the figure from the table rather than from here — a countcopied into prose goes stale in silence, which is whydiff --git a/apps/docs/docs/migration/from-splunk.md b/apps/docs/docs/migration/from-splunk.mdnew file mode 100644index 000000000..b95d5cd40--- /dev/null+++ b/apps/docs/docs/migration/from-splunk.md@@ -0,0 +1,99 @@+---+id: from-splunk+title: Migrating detections from Splunk, Sentinel and Elastic+sidebar_label: From SPL, KQL and EQL+---++# Migrating detections from Splunk, Sentinel and Elastic++Arriving with 400 Splunk searches and rewriting all of them by hand is+the cost that decides whether a migration happens at all.++```bash+python3 packages/aisoc-migrate/inbound.py --dialect spl --file my-searches.txt+python3 packages/aisoc-migrate/inbound.py --dialect kql --query 'SecurityEvent | where EventID == 4625'+python3 packages/aisoc-migrate/inbound.py --dialect eql --query 'process where process.name == "mimikatz.exe"'+```++Add `--json` for machine-readable output.++## Refusing is the feature++A translator that produces something for every input is worse than one+that refuses. An almost-right detection is harder to find than a+missing one: it sits in the catalogue, fires on the wrong thing, and+nobody checks it against the original.++So these constructs **refuse the whole translation** rather than being+dropped quietly:++| Dialect | Refused | Why |+|---|---|---|+| SPL | `transaction`, `eventstats`, `streamstats` | Windowed and session aggregation |+| SPL | `lookup`, `inputlookup` | Joins a table this deployment does not have |+| SPL | `join`, `map` | Correlates two searches — use a correlation rule |+| KQL | `join`, `externaldata`, `make-series`, `evaluate` | Same reasons |+| EQL | `sequence`, `until`, `join` | Ordered multi-event match; the engine evaluates one event at a time |++Every refusal names what stopped it. A reviewer cannot act on "could+not translate".++## What you get back++| Confidence | Meaning |+|---|---|+| `high` | Three or more field comparisons carried across |+| `good` | Two |+| `partial` | One, or an aggregation whose threshold did not carry |+| `none` | No rule produced; see `unsupported` |++## Measured on 2,005 real rules++This repository already stores 2,005 quarantined Splunk rules. Run+against all of them:++```+1,734 of 2,005 (86.5%) produce a rule+ 271 refused, each with a stated cause+1,711 of the 1,734 are only `partial`+```++**The third line is the one that matters.** The corpus is+overwhelmingly aggregation-based, so "translated" mostly means *field+matches carried across, the threshold did not*. Reading 86.5% as a+finished migration would be wrong, and the test suite asserts that+ratio directly so the headline cannot drift away from it.++Refusal causes, counted: 1,709 aggregations, 109 lookups, 57+`eventstats`, 51 joins.++## What to do with a `partial`++Treat it as a draft with its field logic done for you.++1. Read the `unsupported` list. An aggregation note means you need a+ threshold the original had and this does not.+2. Check whether the windowed engine can express it. A simple count+ over a window usually can.+3. Author positive and negative fixtures — the approval gate replays+ them, and a rule that cannot prove itself cannot be approved.+4. Submit it as a proposal and have a **second person** approve it.++See [Detection lifecycle](../operations/detection-lifecycle.md).++## What is deliberately not attempted++Statistical and transactional constructs are refused rather than+approximated. They describe windowed aggregation, the engine's+windowed support is limited, and emitting a point-in-time rule that+*looks* like the original is exactly the almost-right failure above.++Two more details worth knowing:++**Splunk's `index` and `sourcetype` are dropped**, with a note. They+address Splunk's own storage rather than the event, and carrying them+would make every imported rule match on a field no connector emits.++**Keywords are word-bounded.** A field named `join_key` is not a+`join`. Without that the translator refuses rules it can handle, which+is the opposite failure and the harder one to notice.diff --git a/apps/docs/docs/operations/alert-prioritisation.md b/apps/docs/docs/operations/alert-prioritisation.mdnew file mode 100644index 000000000..1ced3f3a4--- /dev/null+++ b/apps/docs/docs/operations/alert-prioritisation.md@@ -0,0 +1,121 @@+---+id: alert-prioritisation+title: Alert prioritisation+sidebar_label: Alert prioritisation+---++# Alert prioritisation++Two alerts of equal severity — one on a domain controller, one on a+meeting-room display — used to arrive in the queue in the order they+were raised. An analyst worked out which was which by reading the+hostname.++`assets.criticality` existed the whole time. It reached a prompt+string and a sort order, and nothing prioritised on it.++## Context multiplies severity, it never adds++This is the design decision everything else follows from.++Addition lets a stack of small contextual bumps push an informational+alert above a critical one, which is how a prioritisation scheme gets+switched off after the first time it surprises somebody. Multiplying+means context can **reorder alerts of similar severity** — which is+what it is for — and **cannot invert a severity gap**.++The product is clamped, so no single signal dominates. A domain+controller is more important than a laptop; it is not infinitely more+important.++## What moves the number++| Factor | Effect | Why it counts |+|---|---|---|+| Severity | Base, 50–900 | What the detection claimed |+| Asset criticality | ×0.7 – ×1.6 | A domain controller is not a meeting-room display |+| Known Exploited Vulnerability on the host | ×1.4 | A technique *known to work*, which is a different fact from a high CVSS score |+| Other exploitable vulnerabilities | ×1.15 | Weaker signal, same direction |+| Internet-facing | ×1.2 | Reachable without a foothold |+| Privilege tier | ×1.0 – ×1.5 | A domain admin changes the blast radius from one host to the estate |+| Break-glass account | ×1.45 | These are *expected* to be dormant, so any activity is notable |++Vulnerability context is read from the tenant's **own**+`asset_vulnerabilities` inventory, not from an enrichment response.+That table already held the answer and only the enrichment path ever+read it.++## The ordering is interrogable++Every factor that moved the score is recorded with its contribution:++```json+{+ "score": 1000,+ "base": 600,+ "rationale": [+ { "factor": 1.6, "reason": "asset criticality is critical" },+ { "factor": 1.4, "reason": "the host runs something on the Known Exploited Vulnerabilities catalogue" },+ { "factor": 1.35, "reason": "the principal holds admin privilege" }+ ]+}+```++An ordering a person cannot interrogate is one they stop trusting the+first time it surprises them. Nothing is recorded when nothing+moved — a rationale full of ×1.00 entries is noise that teaches people+to stop reading it.++## Priority is not severity++Severity is what the detection claimed, and it is compared across+deployments. Priority is local and says what to look at first *here*.++Conflating them would let a tenant's CMDB quality silently change what+their detections appear to have found, so prioritisation never writes+back to `severity`.++## Scored once, at claim time++`alerts.priority_score` is stored rather than computed at read time,+for two reasons. The queue sorts on it, and a computed sort over a+join is what makes a queue slow at exactly the moment it is busiest.+And an analyst asking "why was this top of my queue" needs the answer+that applied **then**, not the one today's CMDB produces.++`NULL` means not yet scored, which is distinct from `0` — scored, and+genuinely low.++## Without a CMDB++Most deployments have no asset inventory on day one, and the queue+still works: with no context the score is severity alone. An unknown+criticality leaves the score unchanged and says so in the rationale+rather than guessing.++An unknown *severity* ranks as medium and records why. A connector+emitting a tier this deployment does not know is a mapping bug, and+dropping the alert out of the queue over it would be worse than+ranking it in the middle and being explicit.++## Identity privilege++`identity_privilege` is a per-tenant table. No privileged-account+field existed anywhere before it — an alert on a service account with+domain-admin rights was indistinguishable in the schema from a+contractor's laptop login.++| Column | Meaning |+|---|---|+| `privilege_tier` | `standard`, `elevated`, `admin`, `domain_admin` |+| `is_service` | No interactive logons, predictable hours; compromise usually means a stolen key |+| `is_break_glass` | Expected to be dormant |++Principals are lowercased before write. `SVC-Backup` and `svc-backup`+are one account, and two rows would make the lookup depend on which+connector reported first.++## Related++- [Case orchestration](./case-orchestration.md)+- [Asset inventory](../console/investigation-rail.md)diff --git a/apps/docs/docs/operations/backup-and-restore.md b/apps/docs/docs/operations/backup-and-restore.mdnew file mode 100644index 000000000..9885a51e9--- /dev/null+++ b/apps/docs/docs/operations/backup-and-restore.md@@ -0,0 +1,118 @@+---+id: backup-and-restore+title: Backup and restore+sidebar_label: Backup and restore+---++# Backup and restore++AiSOC keeps state in six places, and they do not fail the same way or+recover the same way. This page says what each backup contains, how to+put it back, and — for the two cases where the honest answer is "do+not" — why.++:::info What changed+`backup.sh` has backed up five stores for some time. Until recently+`restore.sh` restored **two** of them. Neo4j, Qdrant and Redis each had+a backup nobody had ever proven they could use, and the first time+anyone would have found out is during the recovery.++Nothing failed, which is why it survived: both scripts ran, both+reported success, and the asymmetry was only visible by reading the two+files side by side. `scripts/check_backup_restore_parity.py` now fails+CI when a store gains a backup without a restore, which is the+direction this drifts — the backup is the part that feels urgent.+:::++## What is backed up++```bash+./scripts/backup.sh --component all+```++| Store | Holds | Format | Losing it costs |+|---|---|---|---|+| **Postgres** | Alerts, cases, users, policies, the audit chain | `pg_dump` | Everything. This is the system of record |+| **ClickHouse** | The event lake | Per-table TSV | Hunt history and retro-hunt reach |+| **Neo4j** | The entity graph | Cypher via APOC | Blast-radius queries until it is rebuilt from ingest |+| **Qdrant** | IOC and actor embeddings | Per-collection snapshot | Similarity search until re-embedded |+| **Redis** | Cache, OIDC sign-in state, rate-limit counters | RDB | Nothing durable |+| **Plugins** | Installed marketplace content | Tarball | Reinstallable from the marketplace |++Every artefact is encrypted with AES-256-GCM through+`scripts/backup_crypt.py` and recorded in a SHA-256 manifest. `openssl+enc` is not used because it **refuses AEAD ciphers** — a detail worth+knowing if you are reimplementing this.++## Restoring++```bash+./scripts/restore.sh --timestamp 20260503T120000Z \+ --component postgres|clickhouse|plugins|neo4j|qdrant|redis|all+```++`--dry-run` fetches and verifies every artefact without writing, and+treats an unreachable store as a **skip rather than a failure**, so it+works as a configuration check.++### Neo4j replays Cypher rather than loading a dump++`neo4j-admin load` needs the database stopped. A restore that requires+downtime on a store the platform degrades gracefully without is a worse+trade than a slower replay, so the backup exports Cypher and the+restore replays it.++Statements apply one at a time. A single failing `MERGE` must not+discard the whole graph, and failures are **counted and surfaced** — a+restore that reported success having skipped half the graph is exactly+the class of problem this page exists to close.++### Qdrant lets the upload recreate collections++Collections are not pre-created. A vector collection's dimension is+immutable, so creating one with the wrong dimension would make the+restore fail in a way that looks like corrupt data rather than a+configuration mismatch.++### Redis asks you to confirm, and the default is don't++```bash+REDIS_RESTORE_CONFIRM=yes ./scripts/restore.sh --timestamp … --component redis+```++Redis holds only state the platform rebuilds. Replacing a running cache+with an hours-old one serves stale answers with full confidence, which+is worse than a cold start — so the restore refuses unless you say+otherwise, and prints why.++The one real cost is sign-ins mid-flight: the OIDC state store lives+here, so a user part-way through authentication sees an error and signs+in again.++## Verifying a backup you have not restored++A backup you have never restored is a hypothesis.++```bash+./scripts/restore.sh --timestamp <ts> --component all --dry-run+```++This fetches every artefact, verifies it against the manifest, and+decrypts it, without touching a live store. It does not prove the data+is *useful* — only a real restore does that — but it does prove the+bytes are present, intact and decryptable, which is where most backup+failures actually live.++The `backup → destroy → restore` integration job runs the full cycle+against real containers in CI.++## What is not covered++- **Point-in-time recovery.** Backups are periodic snapshots. Recovery+ loses everything between the last snapshot and the failure; see+ [HA deployment](./ha-deployment.md) for reducing that window.+- **Cross-region replication.** Shipping artefacts to a second region+ is a storage configuration, not something these scripts do.+- **A measured RPO.** The window depends on your schedule and your+ object store, and publishing a figure from one laptop's timings+ would not describe your deployment.diff --git a/apps/docs/docs/operations/case-orchestration.md b/apps/docs/docs/operations/case-orchestration.mdnew file mode 100644index 000000000..15f4b5536--- /dev/null+++ b/apps/docs/docs/operations/case-orchestration.md@@ -0,0 +1,161 @@+---+id: case-orchestration+title: Case queues, SLAs and escalation+sidebar_label: Case orchestration+---++# Case queues, SLAs and escalation++Which analyst sees a case, how long they have, and what happens when+nobody picks it up.++## Three clocks, not one++A case picked up in four minutes and resolved in four days met its+acknowledgement target and missed its resolution one. A single due+date cannot say that, and a SOC that cannot distinguish them cannot+tell a staffing problem from a capability problem.++```http+POST /api/v1/cases/sla-policies+{+ "name": "Critical — 24/7",+ "severity": "critical",+ "ack_minutes": 15,+ "resolve_minutes": 240,+ "close_minutes": 1440+}+```++| Clock | Starts | Stops | Answers |+|---|---|---|---|+| `ack_minutes` | Case opened | Somebody takes it | Are we staffed? |+| `resolve_minutes` | Case opened | A verdict is reached | Can we actually investigate this? |+| `close_minutes` | Case opened | Case closed out | Are we finishing the paperwork? |++Targets are measured from **when the case opened**, never from now.+Re-reading a case must not silently extend its deadline, which would+make every breach disappear on the next edit.++A case with no matching policy gets **no target and a stated reason**.+An empty due date with no explanation reads as "met" on every+dashboard that counts breaches.++### Business hours++`business_hours_only` is **off by default**. A 24/7 SOC is the+assumption, and a business-hours policy applied silently would make+every out-of-hours breach vanish.++## Queues++A queue is a stored predicate, so one can be created from the console+without a deploy.++```http+POST /api/v1/cases/queues+{+ "name": "PCI — critical",+ "match_severity": ["critical"],+ "match_tags": ["pci"],+ "precedence": 10,+ "sla_policy_id": "…"+}+```++**Criteria are ANDed.** A queue declaring critical *and* `pci` means+critical PCI cases. Under OR it would also collect every critical case+in the estate, which is how a team's queue becomes everyone's queue.++### Routing is deterministic++Two queues can match one case and the case belongs in exactly one.++1. Lowest `precedence` wins.+2. If two tie, the **name** breaks it.++The second rule is not cosmetic. Without it, equally-ranked queues+resolve by row order and a case appears to move between them on each+read — which reads to an analyst as cases disappearing.++A queue with no criteria is a catch-all, which is legitimate and+usually wants a high `precedence` so it sorts last.++## Escalation++None of this existed before. A case nobody picked up stayed unpicked+and the SLA passed in silence, which is the failure an SLA exists to+prevent.++```http+POST /api/v1/cases/escalation-policies+{+ "name": "Critical unacknowledged",+ "queue_id": "…",+ "trigger_at_sla_fraction": 0.75,+ "ladder": [+ { "after_minutes": 0, "notify": "[email protected]" },+ { "after_minutes": 15, "notify": "[email protected]" },+ { "after_minutes": 30, "notify": "[email protected]" }+ ]+}+```++Two design points:++**It is keyed on the acknowledgement clock, not resolution.** A case+somebody is working on and has not finished is not the failure an+escalation ladder addresses.++**The trigger is a fraction of the SLA, not a fixed delay.**+Escalating a critical case after the same four hours as a low one+repeats the single-clock mistake the three targets exist to fix.++The ladder is ordered, and each escalation climbs it — so an+unanswered page progresses rather than repeats.++## Shift handoff++The `/shifts` route was removed in v15.0.0 and nothing replaced it, so+a handover was a conversation.++```http+POST /api/v1/cases/handoffs+{+ "to_user_id": "…",+ "queue_id": "…",+ "notes": "CASE-412 waiting on the customer; everything else is quiet."+}+```++The case ids are **snapshotted rather than recomputed** from the+queue. What was handed over is a historical fact, and the queue has+changed since.++`acknowledged_at` is explicit, because an unacknowledged handoff is+not a handoff — a shift that ended with nobody confirming receipt is+exactly the gap a handover exists to close.++## Transition history++A case used to carry its current status and four timestamps, so "who+moved this to resolved, and on what basis" was unanswerable. That is+the first question asked when a closed case turns out to have been an+incident.++Every transition is now recorded with its actor and an `actor_kind` of+`human`, `automation` or `escalation`. A status an analyst chose and+one a timer produced read identically in a status column, and they+mean very different things in a review.++## Task dependencies++`depends_on_task_id` blocks a task until its predecessor completes.+Enforced at the application layer rather than by a constraint, because+the useful behaviour is a clear refusal naming the blocker rather than+a foreign-key error.++## Related++- [Alert prioritisation](./alert-prioritisation.md)+- [Case reports](./case-reports.md)diff --git a/apps/docs/docs/operations/data-governance.md b/apps/docs/docs/operations/data-governance.mdnew file mode 100644index 000000000..205d6e18d--- /dev/null+++ b/apps/docs/docs/operations/data-governance.md@@ -0,0 +1,148 @@+---+id: data-governance+title: Data governance+sidebar_label: Data governance+---++# Data governance++Legal hold, data residency, field-level access and per-subject+deletion. Four controls that share one property: each decides whether+data may be *kept*, *moved*, *seen* or *removed*, and each fails+closed.++## Legal hold++**A hold outranks retention unconditionally.**++Any arrangement where retention can win is a system that deletes+evidence under litigation, which is the one outcome that cannot be+apologised for. Before this existed, the correct response to "preserve+everything relating to this account pending litigation" was to disable+retention for the whole tenant and remember to turn it back on.++```http+POST /api/v1/governance/legal-holds+{+ "name": "Matter 2026-01 — departing employee",+ "matter_ref": "MAT-2026-01",+ "subject_kind": "user",+ "subject_value": "[email protected]"+}+```++A hold is stored as a **predicate, not a list of row ids**. The rows a+hold covers keep arriving after it is placed, and a hold frozen to the+ids that existed when it was written would cover none of the evidence+created during the incident it was placed for.++`subject_kind` is one of `user`, `host`, `case`, `alert`, `ip` or+`tenant`. Matching is case-insensitive: `SVC-Backup` and `svc-backup`+are one account, and a hold that missed one spelling would preserve+half the evidence.++### Releasing++Releasing is an **event with an actor**, not a deletion. A hold that+vanished would leave no evidence it ever existed, which defeats the+audit it was placed for.++```http+POST /api/v1/governance/legal-holds/{id}/release+{ "reason": "Matter closed 2026-09-30" }+```++### How retention sees it++The retention worker reads live holds **before every run** rather than+caching them. A cache measured in hours is a cache that deletes+evidence placed under hold this morning.++The decision object carries the hold that refused, so a caller cannot+flatten "held" to a boolean and treat it as "not expired".++## Residency++Two fields on the tenant: `data_region`, and `residency_enforced`.++Enforcement is **off by default**, and deliberately so — turning it on+for an existing tenant whose data already spans regions would break it+silently. Adopting it is a step you take.++When it is on:++| Situation | Outcome |+|---|---|+| Operation targets the tenant's region | Allowed |+| Operation targets a different region | **Refused**, violation recorded |+| Operation declares no region | **Refused** — it cannot be shown to respect the constraint |+| Enforcement on, tenant declares no region | **Refused** — the alternative permits everything under a setting an operator believes is strict |++Violations are written to `residency_violations` **even when the+operation is refused**. A refusal nobody counted cannot answer "has+this ever happened", which is the question an auditor asks.++## Field-level access++A viewer who can read an alert used to read every field of it,+including the raw event, which carries whatever the source put there.++```http+POST /api/v1/governance/field-rules+{+ "resource": "alert",+ "field_path": "raw_event.user.email",+ "visible_to_roles": ["admin", "soc_lead"],+ "treatment": "hash"+}+```++| Treatment | Result | Use when |+|---|---|---|+| `redact` | `[redacted]` | The value should not be seen at all |+| `mask` | `••••1234` | An analyst needs to correlate without reading it |+| `hash` | `sha256:a1b2…` | Two records carrying the same value must stay recognisably the same |+| `omit` | Field absent | The field's existence is itself sensitive |++**A withheld field is named in the response.** A missing field and a+hidden one look identical to a client, and an analyst needs to know+whether the source IP is absent or withheld — those lead to opposite+next steps.++Dotted paths reach into `raw_event`, which is where a source puts+whatever it likes and the field most worth constraining. A rule naming+a field a record does not carry is **not** reported as withheld, or+the response would claim to be hiding something it never had.++## Per-subject deletion++`tenant_deletion` removes a whole tenant. "Delete everything about+this person" is a different question and the common one.++```http+POST /api/v1/governance/subject-deletions+{ "subject_kind": "user", "subject_value": "[email protected]" }+```++A request lands in one of five states, and `blocked_by_hold` is its own+state rather than a failure — a deletion refused because of litigation+is a **correct outcome** that has to be reportable to the person who+asked.++Completion records `affected_counts` per table. An auditor needs the+counts, and a deletion that reports only "done" cannot be verified.++## Signed exports++Export bundles carry a detached Ed25519 signature, recorded in+`export_signatures` as well as in the bundle — so a recipient can+verify against a record the sender cannot alter after the fact.++The row also carries `row_count` and a digest of the query, so a+recipient can tell a partial export from a complete one. An export+that omits rows and does not say so is worse than no export.++## Related++- [Retention and data lifecycle](./performance.md)+- [Security model](./security.md)diff --git a/apps/docs/docs/operations/detection-lifecycle.md b/apps/docs/docs/operations/detection-lifecycle.mdnew file mode 100644index 000000000..3cd59c50f--- /dev/null+++ b/apps/docs/docs/operations/detection-lifecycle.md@@ -0,0 +1,117 @@+---+id: detection-lifecycle+title: Detection lifecycle+sidebar_label: Detection lifecycle+---++# Detection lifecycle++How a rule gets from an idea to the engine, how you watch it before it+pages anyone, and how you take it back out at two in the morning.++## Separation of duties++**The author of a rule cannot approve it.**++`POST /api/v1/detection-proposals/{id}/decide` compares the caller+against `proposed_by_id` and refuses an approval from the same person.+This is the surface that writes executable code into the detection+engine, and until recently it was the only governed surface in the+product with no second-person requirement — action approval, playbook+dispatch and MSSP overrides all had one.++Two deliberate exceptions:++- **Rejecting your own proposal is allowed.** That is withdrawing it,+ and requiring a second person would strand bad proposals.+- **A proposal with no author is not blocked.** Rules imported from the+ shipped corpus have no proposer, and refusing them would make the+ catalogue unapprovable.++On a single-analyst deployment:++```bash+AISOC_DETECTION_SOD_ENFORCED=0+```++Off by choice and recorded, rather than a control so rigid people+disable it entirely.++## The approval gate++Approving requires the candidate rule to have been replayed against its+own fixtures — it must fire on every positive and stay silent on every+negative. `/decide` answers **412** without that verdict.++Fixtures are stored on the proposal. They did not used to be, which+made the gate unreachable twice over: the console had no caller for the+evaluate route, and calling it directly meant re-deriving fixtures the+drafter had already produced and discarded. A proposal that cannot+prove itself can never be approved.++```bash+POST /api/v1/detection-proposals/{id}/evaluate-rule+```++The request body is optional. Omit it and the proposal's own fixtures+are replayed; supply fixtures to override them for one run.++## Environments++| Environment | Evaluates | Raises alerts | For |+|---|---|---|---|+| `dev` | Yes | No | A rule nobody has reviewed |+| `staging` | Yes | No | A reviewed rule earning confidence on live traffic |+| `production` | Yes | Yes | Live detection |++## Shadow mode++`shadow_until` is a timestamp, and it is **independent of+environment** — a production rule can be shadowed during a tuning+change without being demoted and losing its history.++While it is set and in the future, the rule is evaluated and its+matches recorded, and it raises nothing.++Matches land in `detection_shadow_matches`, a separate table rather+than a flag on `alerts`. That is the whole point: no query and no+person can mistake a shadow match for an alert.++```sql+SELECT rule_id, count(*) AS would_have_fired+ FROM detection_shadow_matches+ WHERE matched_at > now() - interval '24 hours'+ GROUP BY rule_id+ ORDER BY would_have_fired DESC;+```++A rule at the top of that list would have been your noisiest detection.++## Versions and rollback++Every body a rule has ever had live is kept in+`detection_rule_versions`. Promotion used to overwrite in place, so+"roll back the rule we shipped on Tuesday" had no answer other than+reconstructing it from a pull request — which is exactly the question+asked when a detection starts firing on everything overnight.++Versions are numbered with a **monotonic integer, not a timestamp**.+Two promotions in the same second are ordinary during a tuning session,+and "the version before this one" has to have exactly one answer.++A rollback writes a **new version carrying an old body** rather than+deleting rows, so the history of what was live when stays intact and+`rolled_back_from` records where the body came from.++## Ownership and expiry++| Field | Why |+|---|---|+| `owner_email`, `owner_team` | A rule written for an incident three years ago was indistinguishable from one somebody maintains |+| `expires_at` | Nullable. A rule with no expiry is permanent, which is a legitimate choice — what was missing was the ability to say otherwise |+| `review_due_at` | A prompt to re-check a rule that is still correct but no longer load-bearing |++## Related++- [Shadow mode](./shadow-mode.md) for the agent-level equivalent+- [Detection coverage](../detections/coverage.md)diff --git a/apps/docs/docs/operations/enterprise-sso.md b/apps/docs/docs/operations/enterprise-sso.mdnew file mode 100644index 000000000..29e4e0167--- /dev/null+++ b/apps/docs/docs/operations/enterprise-sso.md@@ -0,0 +1,120 @@+---+id: enterprise-sso+title: Enterprise SSO+sidebar_label: Enterprise SSO+---++# Enterprise SSO++SAML and OIDC sign-in, and the connection record that makes either+work.++:::warning If you tried this before and it 403'd+You were not doing it wrong. `aisoc_sso_connections` was created by a+migration and **written by nothing** — no API, no console, no script.+`resolve_connection` selects from it on every callback and raises when+there is no row, so both handlers answered 403 on every deployment.++The handlers themselves were complete and tested the whole time. They+were simply unreachable, which is why nothing failed in CI.+:::++## Why the tenant is not in the assertion++This is the design decision the whole feature is built around.++**An identity provider that can name its own tenant can name somebody+else's.** So the tenant is a property of the *connection* an+administrator configured here, and the assertion only says who the+person is.++Group mapping works the same way: an IdP group confers a role only+because an administrator in this deployment said it should.++## Creating a connection++```http+POST /api/v1/sso-connections+{+ "provider": "oidc",+ "issuer": "https://login.example.com",+ "display_name": "Example Corp",+ "enabled": false,+ "default_role": "viewer",+ "group_role_mapping": {+ "soc-analysts": "soc_analyst",+ "soc-leads": "soc_lead"+ }+}+```++Create it **disabled**, check the mapping, then enable it. A disabled+connection does not resolve, so sign-ins keep failing the same way+until you are ready.++### What is refused++**A mapping to `admin` or `platform_admin`.** v14.0.0 made those+unreachable from every API route so that only `bootstrap_admin` can+mint one, and a group mapping would be a way back in: register an+issuer, claim a group, hold the wildcard.++**Any role you cannot grant yourself.** A connection is a standing+grant to everyone who can authenticate against that issuer, so it is+held to the same bar as creating one user with that role — checked+against the same authority, not a second list that would eventually+disagree.++**An issuer another tenant already claims.** One connection per+issuer, deployment-wide. Two tenants claiming one issuer would make an+assertion ambiguous about which tenant it provisions into. The 409+deliberately does not say which tenant holds it.++## OIDC verification++The `id_token` is verified against the provider's published JWKS —+signature, issuer, audience and expiry — and a token that fails any+check is **discarded, not downgraded**.++It used to be decoded with `verify_signature: False` under a comment+saying to use JWKS in production. An unverified `id_token` is a base64+blob anyone can author, and its `sub`, `email` and `groups` claims were+merged into the identity.++The `nonce` is now compared against the one generated for that+sign-in. It was generated, sent, and never checked, which left the+authorization-code flow open to replay of a token minted for a+different attempt.++### State across replicas++The sign-in state store is Redis-backed. As a process dictionary it+broke roughly **(n-1)/n of sign-ins on an n-replica deployment**: the+browser is redirected by the instance that generated the state and+comes back to whichever instance the load balancer picks.++An in-process fallback covers single-replica and test deployments. The+entry holds the PKCE verifier and the nonce and expires after ten+minutes, which bounds how long an authorization code may sit+unredeemed.++## SAML++`python3-saml` is declared and locked in `services/api`. Both SAML+routes are live; configure the connection with either `metadata_url`+or `metadata_xml`.++## Checking it works++```bash+curl -s -H "Authorization: Bearer $TOKEN" \+ http://localhost:8000/api/v1/sso-connections | jq '.[] | {provider, issuer, enabled}'+```++If this returns `[]`, every SSO sign-in will 403 — and that is the+state every deployment was in.++## Related++- [SCIM provisioning](./scim.md)+- [Security model](./security.md)diff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.tsindex 1beb26187..dc9f10975 100644--- a/apps/docs/sidebars.ts+++ b/apps/docs/sidebars.ts@@ -186,11 +186,16 @@ const sidebars: SidebarsConfig = {label: "Operations",items: ["operations/security",+ "operations/enterprise-sso",+ "operations/data-governance","compliance/evidence-pack","compliance/fips-posture","operations/credentials","operations/secrets","operations/scim",+ "operations/case-orchestration",+ "operations/alert-prioritisation",+ "operations/detection-lifecycle","operations/white-label","operations/usage-metering","operations/ingest-authentication",@@ -203,6 +208,7 @@ const sidebars: SidebarsConfig = {"operations/codespaces","operations/theming","operations/ha-deployment",+ "operations/backup-and-restore","operations/performance","operations/release-policy","operations/upgrades",@@ -217,6 +223,11 @@ const sidebars: SidebarsConfig = {"operations/managed-instance",],},+ {+ type: "category",+ label: "Migrating to AiSOC",+ items: ["migration/from-splunk"],+ },{type: "category",label: "Plugin SDK",diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.mdindex 954b15b46..8215e661a 100644--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md@@ -293,11 +293,17 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`| No accuracy number is published from a corpus that would flatter | `apps/docs/docs/benchmark.md` | `ci.yml :: Python — Tests` (`scripts/tests/test_score_replay_set.py`) | core | GATED | Every labelled corpus in this repository is **entirely malicious by construction**: `synthetic_incidents.json` and `adversary_incidents.json` are 200 incidents each, all real attacks, and `response_class` says which action to take rather than whether the finding was true. An agent answering 'true positive' to everything, without reading anything, would post **100% accuracy and 100% malicious recall** — the exact mirror of the failure `aisoc_benchmark.replay` already guards against at the other end. `score_replay_set.py` refuses no labels, one class, or a minority class under 5%, and names the counts. A test asserts **this tree's own two corpora are refused**, because that is the finding rather than a bug to route around. There is no `--force`. `benchmark.md` publishes *not measured* with the reason in every accuracy cell || The live-agent eval grades the model a deployment actually runs | `apps/docs/docs/benchmark.md` | `live-agent-eval.yml :: Dispatch the real agent` (matrix) | core | GATED | A number measured only on `qwen2.5:0.5b` describes the agent on whatever the pins resolved to, which is a different claim from the one a reader takes from it. The job is now a matrix over that model **and `llama3.2:3b-instruct-q4_K_M`, the model `docker-compose.yml` pulls**. The small one stays because the floor in `live_agent_floor.json` was measured on it and removing it would orphan the floor. `fail-fast: false`, because one model failing is a result about that model and cancelling the other throws away the comparison that is the point of a matrix || A before-and-after delta refuses the comparisons that would read as results | `apps/docs/docs/benchmark.md` | `ci.yml :: Python — Tests` (`scripts/tests/test_compare_eval_runs.py`), `live-agent-eval.yml :: Delta against the previous run` | core | GATED | Subtracting two numbers is easy; subtracting them honestly is where it goes wrong, and three of the four failures produce a plausible figure rather than an error. An axis measured before and not after reports **not comparable**, never a regression — the arithmetic says `0.62 - 0 = -0.62` and claims the agent got much worse when nobody asked it. Two runs over different datasets are **refused outright**, because that delta measures the corpus. A mean whose support changed materially carries both counts, since a precision of 1.00 over two predictions and over two hundred are the same number and different facts. Latency is reported and never graded, because it measures the machine. Wired into `live-agent-eval.yml` so the delta is *published* rather than merely available; with no previous report it says so instead of diffing against a baseline of zeros |+| A content pack's detections exist in the ruleset the engine loads | `apps/docs/docs/operations/detection-lifecycle.md`, `README.md` | `ci.yml :: Content packs resolve against the shipped corpus` (`scripts/check_content_packs.py`) | core | GATED | A pack naming a rule id nobody ships is the exact failure the format exists to prevent: the operator adopts it, nothing fires, and no error appears anywhere. Checked against the **compiled ruleset**, not `detections/*.yaml`, which is a projection carrying thousands of rules the engine never compiles — validating against it would certify a pack whose detections cannot fire. Negative control proven: one bad rule id fails by name |+| Every store with a backup path has a restore path | `apps/docs/docs/operations/backup-and-restore.md` | `ci.yml :: Every backed-up store has a restore path` (`scripts/check_backup_restore_parity.py`) | core | GATED | `backup.sh` backed up five stores and `restore.sh` restored two, so Neo4j, Qdrant and Redis each had a backup nobody had proven they could use. Nothing failed — both scripts ran and both reported success, and the asymmetry was visible only by reading the two files side by side. The gate runs in the direction that drifts: a store gains a backup long before it gains a restore, because the backup is the part that feels urgent |+| One case table, and one case-status vocabulary | `CHANGELOG.md`, `apps/docs/docs/operations/case-orchestration.md` | `isolation.yml :: One case table, and one status vocabulary` (`scripts/check_one_case_table.py`) | core | GATED | Two tables that never synchronised meant every case metric was blind to every case an analyst created. The second half matters as much: readers filtered `open` and `in_progress`, which the console's machine cannot produce, so those counters were structurally zero rather than empty. The gate also catches a table name reached by interpolation, which is where the last live reference hid after a literal search came back clean |+| A detection rule's author cannot approve it | `apps/docs/docs/operations/detection-lifecycle.md` | `ci.yml :: Python — Tests` (`services/api/tests/test_detection_separation_of_duties.py`) | core | GATED | `proposed_by_id` was written at creation and compared against nothing, on the one surface that writes executable code into the detection engine — every other governed surface separates the two. Rejecting your own proposal stays allowed, because that is withdrawing it, and a proposal with no author is not blocked or the shipped catalogue would be unapprovable |+| An inbound translation refuses what it cannot carry | `apps/docs/docs/migration/from-splunk.md`, `README.md` | `ci.yml :: Run aisoc-migrate tests` (`packages/aisoc-migrate/tests/test_inbound.py`) | core | GATED | A translator that produces something for every input is worse than one that refuses: an almost-right detection sits in the catalogue, fires on the wrong thing, and nobody checks it against the original. Graded on the 2,005 real quarantined Splunk rules, and the suite asserts that **1,711 of the 1,734 usable results are partial** — so the 86.5% headline cannot be read as a finished migration |+| A behavioural rate reports unmeasured when its own signal never occurred | `apps/docs/docs/benchmark.md` | `ci.yml :: Python — Tests` (`services/agents/tests/adversarial/test_vacuous_rates_refuse.py`) | core | GATED | The first live run published "unsafe action proposal rate 0.0% (0/54)", which reads as the agent resisting every payload and meant it proposed nothing at all — all three rates shared the pair count as a denominator. Verdict flip was a real 9.3% on the same pairs, which is why they cannot share one. Negative controls in both directions: verdict flip must keep reporting, and a suppressed rate must return as soon as its signal appears |## Summary-- Total: 285-- GATED: 285+- Total: 291+- GATED: 291- PARTIAL: 0- NO GATE: 0