Skip to content

armgit / AiSOC

Public Imported from GitHub
0

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.

docs: update documentation for 2026 H2 capabilities

Beenu Arora9e1287539e33
diff --git a/README.md b/README.md
index 0fb21dfd6..4f61a22c4 100644
--- a/README.md
+++ b/README.md
@@ -93,8 +93,14 @@ AiSOC bundles the components a SOC normally pieces together from separate vendor
- **Connect data sources in three clicks** — a click-and-connect catalog (Microsoft Entra, Azure Activity, Defender XDR, GCP Cloud Audit, GCP SCC, Microsoft 365 audit, Google Workspace, Cloudflare, GitHub, plus the original CrowdStrike / Splunk / AWS Security Hub / Okta / Microsoft Sentinel set) renders a schema-driven form per connector, runs a live `Test connection` round-trip before save, encrypts every secret with the application-layer `CredentialVault` (Fernet AES-128-CBC + HMAC-SHA256), and starts polling on a per-instance schedule. Walkthrough: [docs/connectors](apps/docs/docs/connectors/index.md). Threat model + key rotation: [docs/operations/credentials](apps/docs/docs/operations/credentials.md).
- **Ingest** events from any connector into a Kafka spine.
-- **Correlate** them in real time with deduplication, ML scoring, and Sigma/YARA detection.
+- **Correlate** them in real time with deduplication, ML scoring, per-alert confidence scoring, and Sigma/YARA detection.
- **Roll up signal onto entities** — Risk-Based Alerting accumulates time-decayed risk points on the user, host, IP, and domain each alert touches, promotes them to entity-incidents at a tunable threshold, and surfaces an entity-centric queue in the alerts UI. Hits the published 2026 KPI bar of ≥ 50:1 alert-to-incident ratio (CI-gated in [`services/fusion/tests/test_entity_risk.py`](services/fusion/tests/test_entity_risk.py)).
+- **Search across SIEMs** — Federated Search fans out a single query to connected Splunk, Microsoft Sentinel, and Elastic instances, translating the query into each target's native dialect (SPL, KQL, ES|QL) via pluggable translators in [`services/connectors/app/federated/`](services/connectors/app/federated/).
+- **Manage detections as code** — Detection-as-Code (DAC) provides a propose → review → eval-gate → promote lifecycle for detection rules. Every proposal carries an eval result from the harness; candidates that regress MITRE accuracy cannot be promoted. Endpoints in [`services/api/app/api/v1/endpoints/detection_proposals.py`](services/api/app/api/v1/endpoints/detection_proposals.py).
+- **Run hypothesis-driven hunts on a schedule** — Hunt-as-Code YAML definitions in [`hunts/`](hunts/) declare a hypothesis, MITRE ATT&CK tags, log sources, indicators, and a cron schedule. The hunt engine in [`services/agents/app/hunt/`](services/agents/app/hunt/) loads the corpus at startup, runs hunts on their schedule, and stores findings in the DB.
+- **Track detection drift** — the Purple Team service takes ATT&CK coverage snapshots and diffs them over time, so you can see which techniques gained or lost coverage between releases. Implementation in [`services/purple-team/app/services/drift.py`](services/purple-team/app/services/drift.py).
+- **Verify ChatOps actions** — HMAC-signed approval prompts are sent to Slack or Teams before high-impact SOAR actions execute, with a time-limited verification token. Implementation in [`services/actions/app/executors/chatops.py`](services/actions/app/executors/chatops.py).
+- **Benchmark against adversary LLMs** — a deterministic attacker-LLM mutator generates adversary incidents to test detection resilience. Script: [`scripts/generate_adversary_incidents.py`](scripts/generate_adversary_incidents.py); eval: [`services/agents/tests/test_adversary_eval.py`](services/agents/tests/test_adversary_eval.py).
- **Enrich** every signal with threat intelligence from TAXII 2.1, MISP, OTX, and CISA KEV.
- **Reason** about attacks via a LangGraph multi-agent system grounded in MITRE ATT&CK.
- **Detect deviations** with UEBA — per-user behavioural baselines and Z-score anomaly scoring.
@@ -138,6 +144,7 @@ Everything ships under MIT. Fork it, self-host it, audit it, extend it.
- Kafka spine with sub-second ingestion
- Bloom-filter dedup on 10M+ IOCs
- LightGBM + Isolation Forest scoring
+- Per-alert confidence scoring (source reliability × indicator fidelity)
- Risk-Based Alerting entity rollup (≥ 50:1 alert-to-incident, CI-gated)
- Live WebSocket feed into the console
@@ -162,10 +169,17 @@ Everything ships under MIT. Fork it, self-host it, audit it, extend it.
<td valign="top" width="50%">
### Detection engineering
+- Detection-as-Code (DAC) lifecycle: propose → review → eval-gate → promote
- Sigma over OpenSearch + ClickHouse
- YARA file/memory scanning
- KQL, EQL, Lucene, regex query types
- Community detection catalog with one-click install
+- Detection drift snapshots (ATT&CK coverage deltas between releases)
+- Hunt-as-Code: YAML hunt definitions with cron schedules
+
+### Federated search
+- Fan out a single query to Splunk, Sentinel, and Elastic
+- Pluggable translators: SPL, KQL, ES|QL
### Honeytokens
- HMAC-SHA256 signed tokens (URL, file, AWS key, email)
@@ -178,6 +192,7 @@ Everything ships under MIT. Fork it, self-host it, audit it, extend it.
- ATT&CK coverage heatmap (tactic × technique)
- Detection reporting (true positive / false negative)
- Tabletop exercise session manager
+- Detection drift monitoring
### Governance
- SAML 2.0 + OIDC SSO
@@ -186,6 +201,7 @@ Everything ships under MIT. Fork it, self-host it, audit it, extend it.
- Immutable audit log with tamper-proof trigger
- SOC 2, ISO 27001, NIST CSF, PCI-DSS, HIPAA, DORA dashboards
- MTTD / MTTR / MTTC SLA tracking
+- ChatOps verification (HMAC-signed Slack/Teams approval prompts)
</td>
</tr>
@@ -263,16 +279,17 @@ flowchart LR
| Service | Lang | Port | Role |
|---|---|---|---|
-| `web` | Next.js 14 + React | 3000 | SOC console + marketing landing |
-| `api` | Python · FastAPI | 8000 | Alerts, cases, RBAC, graph, rules, audit, compliance |
-| `realtime` | Node.js · `ws` | 8086 | Per-channel WebSocket fan-out |
-| `agents` | Python · LangGraph | 8001 | Multi-agent reasoning + Qdrant RAG |
-| `fusion` | Python | 8003 | Dedup + ML scoring (LightGBM, IsoForest) |
-| `actions` | Python | 8002 | SOAR with blast-radius gating |
+| `web` | Next.js 14 + React | 3000 | SOC console, benchmark scoreboard, marketing landing |
+| `api` | Python · FastAPI | 8000 | Alerts, cases, RBAC, graph, rules, audit, compliance, detection proposals (DAC), federated search fan-out, SLA tracking |
+| `realtime` | Node.js · `ws` | 8086 | Per-channel WebSocket fan-out + VAPID Web Push |
+| `agents` | Python · LangGraph | 8001 | Multi-agent reasoning + Qdrant RAG + Hunt-as-Code engine & scheduler |
+| `fusion` | Python | 8003 | Dedup + ML scoring (LightGBM, IsoForest), alert confidence, entity risk / RBA |
+| `actions` | Python | 8002 | SOAR with blast-radius gating + ChatOps verification |
+| `connectors` | Python | — | Connector polling (APScheduler), credential vault, federated query translators |
| `threatintel` | Python | 8005 | TAXII / MISP / OTX / KEV polling |
| `ueba` | Python | 8007 | User & Entity Behavior Analytics |
| `honeytokens` | Python | 8008 | Honeytoken lifecycle + webhook alerting |
-| `purple-team` | Python | 8006 | Atomic Red Team + Caldera + ATT&CK heatmap |
+| `purple-team` | Python | 8006 | Atomic Red Team + Caldera + ATT&CK heatmap + detection drift snapshots |
| `ingest` | Go | 8081 | OCSF normalization + Shodan/CVE |
| `enrichment` | Go | 8080 | IOC enrichment (VT, AbuseIPDB, GreyNoise) |
@@ -579,6 +596,7 @@ AiSOC/
│ ├── plugin-sdk-go/ # Go plugin development SDK (module: github.com/beenuar/aisoc/plugin-sdk-go)
│ └── aisoc-cli/ # CLI: scaffold / validate / publish plugins & detections
├── detections/ # Community Sigma detection rules (YAML)
+├── hunts/ # Hunt-as-Code YAML definitions (hypothesis + indicators + schedule)
├── playbooks/ # Community SOAR playbooks (YAML)
├── plugins/ # First-party plugins (Go + Python)
├── marketplace/ # Marketplace index (JSON, generated by scripts/build_marketplace.py)
@@ -619,6 +637,10 @@ The full OpenAPI 3.1 spec lives at [`docs/openapi.yaml`](docs/openapi.yaml). End
| `cases` | `/api/v1/cases/` | Create, link alerts, evidence |
| `rules` | `/api/v1/rules/` | Sigma / YARA / KQL CRUD + test |
| `detections` | `/api/v1/detections/` | Catalog browse + install |
+| `detection-proposals` | `/api/v1/detection-proposals/` | DAC lifecycle: propose, review, eval-gate, promote |
+| `federated` | `/api/v1/federated/` | Fan-out query to connected SIEMs (Splunk, Sentinel, Elastic) |
+| `hunts` | `/api/v1/hunts/` | Hunt-as-Code: list, get, run, findings |
+| `entity-risk` | `/api/v1/entity-risk/` | RBA: top entities by risk score, entity detail |
| `plugins` | `/api/v1/plugins/` | Registry, publish, rate, approve |
| `playbooks` | `/api/v1/playbooks/` | Community + private playbooks |
| `marketplace` | `/api/v1/marketplace/` | Plugin marketplace with filters |
@@ -790,6 +812,7 @@ Good first issues:
- New connector integrations in `integrations/`
- Community Sigma detections in `detections/`
+- Hunt-as-Code YAML definitions in `hunts/`
- New plugins published to the marketplace
- Frontend UI polish (Tailwind / React)
- Documentation and tutorials in `apps/docs/`
diff --git a/apps/docs/docs/api/rest.md b/apps/docs/docs/api/rest.md
index 302be8863..ff745a88b 100644
--- a/apps/docs/docs/api/rest.md
+++ b/apps/docs/docs/api/rest.md
@@ -80,6 +80,53 @@ The full spec is also committed at [`docs/openapi.yaml`](https://github.com/been
| `GET/POST` | `/detections` | Detection events |
| `GET` | `/detections/stats` | Aggregated detection metrics |
+### Detection Proposals (Detection-as-Code)
+
+The DAC lifecycle manages detection rule proposals from creation through
+eval-gated promotion into the live rule set.
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `GET` | `/detection-proposals` | List proposals (filterable by `status`) |
+| `POST` | `/detection-proposals` | Create a new proposal (title, description, logic, MITRE tags) |
+| `GET` | `/detection-proposals/{id}` | Proposal detail |
+| `POST` | `/detection-proposals/{id}/comment` | Add a review comment |
+| `POST` | `/detection-proposals/{id}/eval` | Attach eval result (metric deltas from `scripts/run_evals.py`) |
+| `POST` | `/detection-proposals/{id}/decide` | Approve or reject the proposal |
+| `POST` | `/detection-proposals/{id}/promote` | Promote an approved proposal to `detection_rules` |
+| `GET` | `/detection-proposals/baseline` | Current eval baseline metrics |
+| `POST` | `/detection-proposals/baseline` | Reset eval baseline to latest harness run |
+
+### Federated Search
+
+Fan out a single query to connected SIEMs. The API translates the query
+into each target's native dialect (SPL for Splunk, KQL for Sentinel,
+ES|QL for Elastic).
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `POST` | `/federated/query` | Submit a federated query (`query`, `targets[]`, optional `time_range`) |
+
+### Hunt-as-Code
+
+YAML hunt definitions live in `hunts/` and are loaded by the agents
+service. The API exposes read-only access for the UI.
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `GET` | `/hunts` | List loaded hunt definitions |
+| `GET` | `/hunts/{hunt_id}` | Hunt detail (hypothesis, MITRE tags, indicators) |
+| `GET` | `/hunts/{hunt_id}/results` | Results from the latest scheduled run |
+
+### Entity Risk (Risk-Based Alerting)
+
+Time-decayed risk scores per entity, computed by the fusion service.
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `GET` | `/entity-risk` | Top entities by risk score (descending) |
+| `GET` | `/entity-risk/{entity}` | Risk detail for a specific entity |
+
### Cases & Response
| Method | Path | Description |
@@ -93,7 +140,7 @@ The full spec is also committed at [`docs/openapi.yaml`](https://github.com/been
| `GET` | `/playbooks/{id}/runs` | Execution history |
| `POST` | `/actions/dry-run` | Simulate an action |
-### Investigations & Ledger *(v5.2)*
+### Investigations & Ledger
Every prompt, response, evidence citation, and tool call the AI investigator
emits is appended to the **Investigation Ledger**. See
@@ -107,14 +154,14 @@ the data model and rationale.
| `POST` | `/cases/{case_id}/investigations:replay` | Replay an investigation deterministically |
| `POST` | `/cases/{case_id}/investigations:start` | Kick off a fresh agent investigation |
-### Ambient Copilot *(v5.2)*
+### Ambient Copilot
| Method | Path | Description |
|--------|------|-------------|
| `GET` | `/copilot/context/{resource_type}/{resource_id}` | Context-aware suggestions for an alert / case / rule / playbook |
| `POST` | `/copilot/actions/{action_id}:run` | Run a suggested action with the right agent tool |
-### Marketplace *(v5.2)*
+### Marketplace
The marketplace surface is backed by the JSON index at
[`marketplace/index.json`](https://github.com/beenuar/AiSOC/blob/main/marketplace/index.json)
@@ -126,7 +173,7 @@ and re-published to the web app at `/marketplace/index.json`.
| `GET` | `/marketplace/items/{slug}` | Item detail with manifest + signature |
| `POST` | `/marketplace/items/{slug}:install` | Install a plugin / detection / playbook into the tenant |
-### Responder PWA *(v5.2)*
+### Responder PWA
These endpoints back the mobile-first `/responder/*` route group.
@@ -186,6 +233,9 @@ These endpoints back the mobile-first `/responder/*` route group.
| `GET` | `/purple-team/coverage` | ATT&CK coverage heatmap |
| `GET/POST` | `/purple-team/tabletop` | Tabletop session list / create |
| `POST` | `/purple-team/tabletop/{id}/steps` | Add step to session |
+| `POST` | `/purple-team/drift/snapshot` | Take an ATT&CK coverage snapshot |
+| `GET` | `/purple-team/drift/snapshots` | List drift snapshots |
+| `GET` | `/purple-team/drift/diff` | Delta between two snapshots (added/dropped techniques) |
### Governance
diff --git a/apps/docs/docs/architecture.md b/apps/docs/docs/architecture.md
index 1152fda61..54eeb4dd4 100644
--- a/apps/docs/docs/architecture.md
+++ b/apps/docs/docs/architecture.md
@@ -35,7 +35,7 @@ Fusion UEBA Detections
replayable per case)
```
-The new structural pieces in v5.2 are the **Investigation Ledger** (every
+Key structural pieces include the **Investigation Ledger** (every
agent prompt, response, evidence citation, and tool call is logged step-by-
step against a case and replayable in the UI), the **Ambient Copilot**
(context-aware next-action surface across alerts, cases, rules, and
@@ -46,6 +46,17 @@ the **MCP server** (`@aisoc/mcp`, exposes 11 tools to Claude / Cursor /
Continue / Cody), and the **click-and-connect connector platform** (next
section).
+Additional capabilities introduced in 2026 H2:
+
+- **Detection-as-Code (DAC)** — propose → review → eval-gate → promote lifecycle for detection rules, with eval results gating promotion.
+- **Detection confidence** — each fused alert carries a derived confidence label (`high / medium / low`) with an ordered evidence chain.
+- **Detection drift monitoring** — scheduled ATT&CK coverage snapshots with delta tracking.
+- **Hunt-as-Code** — YAML hunt definitions in `hunts/` with hypothesis-driven indicator matching and APScheduler-driven continuous execution.
+- **Risk-Based Alerting (RBA)** — time-decayed entity risk scoring that promotes high-risk entities to incidents.
+- **Federated search** — translate a single query into SPL, KQL, and ES|QL and fan out to connected SIEMs.
+- **ChatOps verification** — HMAC-signed Slack/Teams interactive prompts for human-in-the-loop response actions.
+- **AI-vs-AI adversary eval** — deterministic attacker-LLM mutator for testing detection resilience.
+
## Connector polling and credential vault
```
@@ -115,6 +126,8 @@ AiSOC/
│ ├── ueba/ # User behavior analytics (port 8007)
│ ├── honeytokens/ # Deception platform (port 8008)
│ ├── purple-team/ # Adversary emulation (port 8006)
+│ ├── connectors/ # Connector polling + credential vault
+│ ├── demo-producer/ # Synthetic event generator for demos
│ └── mcp/ # Model Context Protocol server (TypeScript)
├── packages/
│ ├── plugin-sdk-py/ # Python plugin SDK
@@ -130,6 +143,7 @@ AiSOC/
│ ├── railway/ # Railway templates
│ └── render/ # render.yaml blueprint
├── detections/ # 200+ Sigma/YARA/KQL detection rules (YAML)
+├── hunts/ # Hunt-as-Code YAML definitions (hypothesis + indicators)
├── playbooks/ # 50+ SOAR playbooks (YAML)
├── plugins/ # 15 first-party plugins (Go + Python)
├── marketplace/ # Marketplace index (index.json)
@@ -143,19 +157,21 @@ AiSOC/
| Service | Port | Language | Responsibility |
|---------|------|----------|----------------|
-| `api` | 8000 | Python (FastAPI) | REST gateway, auth, RBAC, RLS, audit log, **Investigation Ledger**, Ambient Copilot, marketplace, approvals, on-call, passkeys, push subscriptions |
-| `agents` | 8001 | Python (LangGraph) | Orchestrator + recon + forensic + responder + report-writer agents, playbook engine, ledger writes |
+| `api` | 8000 | Python (FastAPI) | REST gateway, auth, RBAC, RLS, audit log, **Investigation Ledger**, Ambient Copilot, marketplace, approvals, on-call, passkeys, push subscriptions, **Detection Proposals** (DAC lifecycle), **Federated Search** fan-out, SLA tracking |
+| `agents` | 8001 | Python (LangGraph) | Orchestrator + recon + forensic + responder + report-writer agents, playbook engine, ledger writes, **Hunt-as-Code** engine + scheduler |
| `realtime` | 8086 | TypeScript (Node.js) | WebSocket streaming of agent steps; **VAPID Web Push** delivery for the Responder PWA |
| `ingest` | 8081 | Go | OCSF normalisation, Bloom-filter dedup, Kafka publish |
| `enrichment` | 8080 | Go | Enrichment fan-out (IP, domain, hash, email, user) |
-| `fusion` | 8003 | Python | ML scoring (LightGBM + Isolation Forest), correlation |
-| `actions` | 8002 | Python | Plugin action executor, blast-radius gating |
+| `fusion` | 8003 | Python | ML scoring (LightGBM + Isolation Forest), correlation, **alert confidence scoring**, **entity risk / RBA** |
+| `actions` | 8002 | Python | Plugin action executor, blast-radius gating, **ChatOps verification** (HMAC-signed Slack/Teams prompts) |
| `threatintel` | 8005 | Python | TAXII 2.1 / MISP / OTX / KEV ingestion + triple storage |
| `ueba` | 8007 | Python | Welford baseline, Z-score scoring, anomaly stream |
| `honeytokens` | 8008 | Python | Token lifecycle, HMAC signing, webhook dispatch |
-| `purple-team` | 8006 | Python | ART YAML parser, Caldera executor, ATT&CK heatmap |
+| `purple-team` | 8006 | Python | ART YAML parser, Caldera executor, ATT&CK heatmap, **detection drift snapshots** |
+| `connectors` | — | Python | Connector polling (APScheduler), credential vault (`CredentialVault`), registry-based connector discovery |
+| `demo-producer` | — | Python | Synthetic event generator for demos and evaluation |
| `mcp` | n/a | TypeScript | Model Context Protocol stdio server, 11 tools for IDE-side agents |
-| `web` | 3000 | TypeScript (Next.js) | React console + Responder PWA route group |
+| `web` | 3000 | TypeScript (Next.js) | React console + Responder PWA route group, **benchmark scoreboard** |
## Storage Tier
@@ -215,6 +231,6 @@ Plugins extend AiSOC at three key points:
- **Enrichers** — Add context to indicators (IP, domain, hash, email)
- **Actions** — Execute response steps (block IP, disable user, create ticket)
- **Connectors** — Ingest events from external sources (SIEM, EDR, cloud)
-- **Widgets** *(v5.2)* — Render plugin-supplied React panels in the case workspace
+- **Widgets** — Render plugin-supplied React panels in the case workspace
See [Plugin Overview](./plugins/overview) for the full plugin lifecycle.
diff --git a/apps/docs/docs/benchmark.md b/apps/docs/docs/benchmark.md
index ca0b441da..9eb6cb852 100644
--- a/apps/docs/docs/benchmark.md
+++ b/apps/docs/docs/benchmark.md
@@ -319,6 +319,63 @@ head -n 5 services/agents/tests/eval_data/synthetic_telemetry.jsonl
Each line is a self-contained event with `incident_id`, `template_id`,
`source`, and the event payload. Filter by `source` to focus your tests.
+### 6. AI-vs-AI adversary eval — `Graceful-degradation gate`
+
+**Source:** [`services/agents/tests/test_adversary_eval.py`](https://github.com/beenuar/AiSOC/blob/main/services/agents/tests/test_adversary_eval.py)
+· **Dataset:** [`eval_data/adversary_incidents.json`](https://github.com/beenuar/AiSOC/blob/main/services/agents/tests/eval_data/adversary_incidents.json)
+· **Generator:** [`scripts/generate_adversary_incidents.py`](https://github.com/beenuar/AiSOC/blob/main/scripts/generate_adversary_incidents.py)
+
+A deterministic attacker-LLM **mutator** rewrites every defender keyword in
+the 200-incident dataset into evasive synonyms, character obfuscation, and
+fragmentation. Three intensity buckets control how aggressively the text is
+mutated:
+
+| Bucket | Share | Mutation |
+|----------|-------|----------|
+| **heavy** | ~45 % | Every keyword swapped to synonym / obfuscated |
+| **medium** | ~35 % | One expected tactic preserved cleanly |
+| **light** | ~20 % | Leetspeak only (control bucket) |
+
+Three regression floors are enforced:
+
+| Gate | Floor / ceiling | Rationale |
+|------|-----------------|-----------|
+| Overall catch rate | ≥ 0.40 | Under heavy mutation the extractor is expected to drop ~50 pp from its unmutated 0.95 baseline. The floor keeps graceful degradation honest. |
+| Light-bucket catch rate | ≥ 0.85 | Light-tier obfuscation is just leetspeak; if the defender fails this bucket, a heavier failure is hiding a deeper regression. |
+| Heavy-bucket catch rate | ≤ 0.50 | If the heavy bucket starts catching too much, the dataset is no longer adversarial — the mutation grammar has drifted. |
+
+This suite answers a specific question: **does the substrate fall off a cliff
+when an attacker deliberately evades the keyword catalogue?** It does not
+attempt to prove the defender is great under adversarial pressure — it proves
+the defender doesn't silently collapse to zero. The per-bucket accuracy curve
+is the metric to watch over time.
+
+To regenerate the adversary dataset:
+
+```bash
+python3 scripts/generate_adversary_incidents.py
+```
+
+## Community benchmark scoreboard
+
+The dataset and the harness are MIT-licensed and fully reproducible. Any third
+party — another open-source project, a vendor, or an internal team — can run
+the same suite against the same 200 incidents and submit a result:
+
+```bash
+python3 scripts/run_evals.py --json --out report.json
+```
+
+Submissions go through a structured GitHub issue template
+([`.github/ISSUE_TEMPLATE/benchmark_submission.yml`](https://github.com/beenuar/AiSOC/blob/main/.github/ISSUE_TEMPLATE/benchmark_submission.yml)).
+Accepted entries are rendered on the [benchmark scoreboard](/benchmark) in the
+web console. Submission rules:
+
+1. **Same fixed dataset** — run against the deterministic 200-incident dataset on the commit you submit. No private fixtures.
+2. **Same harness** — run `scripts/run_evals.py --json --out report.json` with no flags that disable gates. Attach the full `report.json` so per-template macros are auditable.
+3. **Open agent or label as closed** — if your agent code is open, link it. If it is closed, the entry is accepted but labeled "closed-source".
+4. **No template-stuffing** — the three substrate self-consistency suites are gameable by stuffing keywords into reports. Submissions caught doing this are rejected; the alert-reduction measurement is not gameable in the same way.
+
## Comparison to other AI SOC offerings
| Capability | AiSOC | Wazuh | Splunk | Closed-source AI SOC |
diff --git a/apps/docs/docs/concepts/capabilities.md b/apps/docs/docs/concepts/capabilities.md
index e709cae03..ac1275fa4 100644
--- a/apps/docs/docs/concepts/capabilities.md
+++ b/apps/docs/docs/concepts/capabilities.md
@@ -65,6 +65,57 @@ institutional memory ingestion to avoid polluting the knowledge base.
---
+## Detection Engineering (2026 H2)
+
+Five capabilities bring detection content under the same CI rigor as application
+code, with continuous drift tracking, eval-gated promotions, and scheduled
+hypothesis-driven hunts.
+
+| Capability | API / Surface | Description |
+|---|---|---|
+| **Detection-as-Code (DAC)** | `/api/v1/detection-proposals` | Propose → review → eval-gate → promote lifecycle. Every proposal carries an eval result from `scripts/run_evals.py`; candidates that regress MITRE accuracy by ≥ 1 pp cannot be promoted. Endpoints: list, create, comment, attach eval, decide (approve/reject), promote to `detection_rules`, baseline management. |
+| **Detection confidence + explainability** | every fused alert | Each alert leaves the fusion service with a `high / medium / low` confidence label and an ordered evidence chain (`ConfidenceFactor[]`). The label is derived, not assigned — analysts can reproduce the score from the rationale alone. Implemented in `services/fusion/app/services/confidence.py`. |
+| **Detection drift monitoring** | `services/purple-team/app/services/drift.py` | Turns the ATT&CK coverage heatmap from a point-in-time view into a tracked time series. Scheduled snapshots enable "delta vs. last week" on the MITRE heatmap. Includes drift-diff computation in `drift_diff.py`. |
+| **Hunt-as-Code** | `services/agents/app/hunt/` | YAML hunt definitions in `hunts/` with hypothesis, indicators (operators: equals/in/regex/gte/lte/exists/contains_any/iendswith), and schedule metadata. The `HuntEngine` matcher runs against event streams; `HuntScheduler` (APScheduler) executes hunts continuously. Results flow through `HuntStore` to Postgres. API at `services/agents/app/api/hunts.py`. |
+| **Cloud-native detections** | `detections/cloud/` | 27 new cloud-native rules: 20 M365 (Exchange, SharePoint, Teams, Defender, Purview, Power Platform, Entra ID), 3 Azure (Key Vault, management group, Defender for Cloud), 4 GCP (org policy, VPC firewall, Cloud Armor, audit log sink). |
+
+---
+
+## Response & Automation (2026 H2)
+
+| Capability | API / Surface | Description |
+|---|---|---|
+| **Risk-Based Alerting (RBA)** | `services/fusion/app/services/entity_risk.py` | Alerts contribute time-decayed risk points to entities (user, host, src_ip, domain). Points decay exponentially with a configurable half-life. When an entity's score crosses `rba_promotion_threshold`, AiSOC promotes it to an incident with contributing alerts attached. The entity-centric queue surfaces the top-N highest-risk entities. CI-gated at ≥ 50:1 alert-to-incident ratio. |
+| **ChatOps user verification** | `services/actions/app/executors/chatops.py` | Sends Slack/Teams interactive prompts with three HMAC-signed callback choices (acknowledge / deny / escalate). Tokens carry action, case, tenant, user reference, and expiry. Timeout auto-escalates. |
+| **L0–L4 remediation maturity tiers** | `/api/v1/remediation` | Each tier unlocks progressively more autonomous remediation. `evaluate_gate()` checks tier, blast-radius, and per-action whitelist before allowing auto-execution. Full gate audit log. |
+
+---
+
+## Platform Expansion (2026 H2)
+
+| Capability | API prefix | Description |
+|---|---|---|
+| **EASM** | `/api/v1/easm` | External Attack Surface Management — passive (Shodan/Censys) + optional active port scanning. Discovers assets, tracks drift (new ports, certs, subdomains), and generates alerts. Feature-flagged via `AISOC_FEATURE_EASM`. |
+| **Insider threat** | `/api/v1/insider-threat` | User risk profiles, behavioural indicators (login anomaly, data exfil, privilege abuse), peer-group deviation scoring, and watchlist management. |
+| **Asset inventory** | `/api/v1/assets` | Auto-correlated asset records with vulnerability tracking and alert-to-asset linking for blast-radius context. |
+| **MSSP console** | `/api/v1/mssp` | Parent-tenant console — onboard/manage child tenants, delegate actions cross-tenant, view rollup metrics, per-tenant detection scoping via rule packs with overrides. |
+| **CSPM / KSPM** | `/api/v1/posture` | Cloud Security Posture Management — ingest findings, track drift between scan runs, per-provider summary with suppress/resolve workflows. |
+| **Identity graph** | `/api/v1/identity-graph` | Entity relationship graph of users, devices, and service accounts with edge traversal and alert-identity linking. |
+| **Internal threat intelligence** | `/api/v1/threat-intel` (extended) | Harvest IOCs from alert history, track threat actors and campaigns, manage external STIX/TAXII feed subscriptions. |
+| **Board reports** | `/api/v1/reports` | Scheduled PDF/HTML executive summaries with template management, async generation, artefact storage, and webhook/email delivery. |
+
+---
+
+## Eval Harness & Benchmarking (2026 H2)
+
+| Capability | Surface | Description |
+|---|---|---|
+| **Public benchmark scoreboard** | `/benchmark` page | Live-from-main badge, KPI bar (alert-to-incident ratio, MTTD, MTTR, FPR), per-suite results fetched from `eval-results` branch, community submission leaderboard. |
+| **AI-vs-AI adversary eval** | `scripts/run_evals.py` (sixth suite) | Deterministic attacker-LLM mutator (synonym swap, leetspeak, zero-width injection, fragmentation) generates 200 adversarial incidents. Graceful-degradation gate: overall ≥ 0.40, light ≥ 0.85, heavy ≤ 0.50. |
+| **Per-feature eval suites** | `scripts/run_evals.py` | Memory recall, override accuracy, confidence calibration (Brier score + ECE), and autonomy adherence suites — each with floor gates. |
+
+---
+
## Tier 2 — Intelligent Automation
| Capability | API prefix | Description |
diff --git a/apps/docs/docs/intro.md b/apps/docs/docs/intro.md
index 97808ee80..76729852b 100644
--- a/apps/docs/docs/intro.md
+++ b/apps/docs/docs/intro.md
@@ -4,7 +4,7 @@ sidebar_position: 1
# Introduction
-AiSOC (v5.2.0) is an open-source AI Security Operations Center maintained by
+AiSOC is an open-source AI Security Operations Center maintained by
the AiSOC community. The agent itself is MIT-licensed, self-hostable, and
auditable: every LLM prompt, tool call, evidence citation, and decision is
recorded in a replayable Investigation Ledger, and the substrate is gated by a
@@ -23,11 +23,20 @@ public, reproducible eval harness on every PR targeting `main` / `develop`.
- **UEBA** — per-user Welford online baseline, Z-score anomaly scoring, and Kafka-integrated anomaly publishing.
- **Honeytokens** — HMAC-SHA256 signed deceptive credentials (URL, file, AWS key, email) with first-touch webhook alerting.
- **Purple Team** — Atomic Red Team YAML parser + Caldera executor, ATT&CK coverage heatmap, tabletop sessions.
-- **Detection engineering** — 800 native Sigma-shaped rules plus ~6,000 imported from SigmaHQ, Splunk Security Content, Chronicle, and MITRE CAR (each tagged with provenance), running over OpenSearch + ClickHouse, YARA, KQL / EQL, community catalog with one-click install.
+- **Detection engineering** — 800+ native Sigma-shaped rules plus ~6,000 imported from SigmaHQ, Splunk Security Content, Chronicle, and MITRE CAR (each tagged with provenance), running over OpenSearch + ClickHouse, YARA, KQL / EQL, community catalog with one-click install. Includes 27 cloud-native rules covering M365, Azure, and GCP.
+- **Detection-as-Code (DAC)** — propose, review, eval-gate, and promote detection rules via `/api/v1/detection-proposals`. Every proposal carries an eval result; candidates that regress MITRE accuracy are blocked from promotion.
+- **Detection confidence** — each fused alert carries a `high / medium / low` confidence label and an ordered evidence chain. The label is derived from weighted factors, not manually assigned.
+- **Detection drift monitoring** — scheduled ATT&CK coverage snapshots enable "delta vs. last week" tracking on the MITRE heatmap.
+- **Hunt-as-Code** — YAML hunt definitions in `hunts/` with hypothesis, indicator matching (equals/in/regex/gte/lte/exists/contains_any/iendswith), and APScheduler-driven continuous execution. Results flow to Postgres via the Hunt API.
+- **Risk-Based Alerting (RBA)** — alerts contribute time-decayed risk points to entities (user, host, IP, domain). When an entity's score crosses a configurable threshold, AiSOC promotes it to an incident with contributing alerts attached.
+- **Federated search** — translate a single query into SPL, KQL, and ES|QL and fan out to connected SIEMs. Results are merged and deduplicated.
+- **ChatOps verification** — Slack/Teams interactive prompts with HMAC-signed callback choices (acknowledge / deny / escalate) for human-in-the-loop response actions.
- **Playbook engine** — 50+ community SOAR playbooks with explicit decision trees and human-approval gates on destructive actions.
- **Threat intelligence** — TAXII 2.1, MISP, OTX, CISA KEV with triple storage (search, vector, graph).
- **Governance** — SAML 2.0 + OIDC SSO, multi-tenant RLS, granular RBAC, immutable audit log.
- **Compliance dashboards** — SOC 2, ISO 27001, NIST CSF, PCI-DSS, HIPAA, DORA evidence with MTTD / MTTR / MTTC SLA tracking.
+- **Public benchmark scoreboard** — live KPI bar (alert-to-incident ratio, MTTD, MTTR, FPR), per-suite eval results, and community submission leaderboard at `/benchmark`.
+- **AI-vs-AI adversary eval** — deterministic attacker-LLM mutator generates adversarial incidents to test detection resilience under synonym swap, leetspeak, zero-width injection, and fragmentation attacks.
- **Marketplace** — 15 first-party plugins, 50+ playbooks, 6,900+ detections (filtered by tier: stable / beta / imported / community), surfaced in-app via [`marketplace/index.json`](https://github.com/beenuar/AiSOC/tree/main/marketplace).
- **SDKs** — Python, TypeScript, and Go SDKs for client and plugin development; Ed25519-signed publishing.
- **Model Context Protocol** — `@aisoc/mcp` exposes 11 tools to Claude, Cursor, Continue, and Cody so analysts can replay agent decisions from inside their IDE ([MCP integration](./integrations/mcp)).
diff --git a/docs/api/API_REFERENCE.md b/docs/api/API_REFERENCE.md
index 29c6c2939..fcbbccd43 100644
--- a/docs/api/API_REFERENCE.md
+++ b/docs/api/API_REFERENCE.md
@@ -1,6 +1,6 @@
# AiSOC API Reference
-This document describes the REST endpoints introduced by the v2 enterprise upgrade. For the auto-generated, exhaustive schema visit `/docs` (Swagger) on each running service.
+This document describes the REST endpoints exposed by AiSOC services. For the auto-generated, exhaustive schema visit `/docs` (Swagger) on each running service.
| Service | Base URL (local) |
|---------|-------------------|
@@ -9,6 +9,8 @@ This document describes the REST endpoints introduced by the v2 enterprise upgra
| Actions | `http://localhost:8002` |
| Fusion | `http://localhost:8003` |
| Threat Intel | `http://localhost:8005` |
+| Purple Team | `http://localhost:8006` |
+| Connectors | (internal scheduler — no external port) |
All examples assume:
@@ -162,11 +164,108 @@ Standard CRUD with optimistic concurrency via `If-Match` ETag.
---
-## 3. Threat Intel IOC Search — `/v1/iocs`
+## 3. Detection Proposals (Detection-as-Code) — `/v1/detection-proposals`
+
+Service: `services/api`.
+
+The DAC lifecycle manages detection rule proposals from creation through eval-gated promotion into the live rule set. Every proposal carries an eval result from `scripts/run_evals.py`; candidates that regress MITRE accuracy by ≥ 1 pp cannot be promoted.
+
+### 3.1 `GET /v1/detection-proposals`
+
+| Query param | Description |
+|-------------|-------------|
+| `status` | `draft` · `in_review` · `approved` · `rejected` · `promoted` |
+
+### 3.2 `POST /v1/detection-proposals`
+
+```json
+{
+ "title": "Detect rundll32 network connections",
+ "description": "Flags rundll32.exe making outbound connections — common LOLBin technique.",
+ "logic": "title: Rundll32 Outbound\nstatus: experimental\n…",
+ "mitre_tags": ["attack.defense_evasion", "attack.t1218.011"]
+}
+```
+
+### 3.3 `GET /v1/detection-proposals/{id}`
+
+Returns proposal detail including comments and attached eval results.
+
+### 3.4 `POST /v1/detection-proposals/{id}/comment`
+
+```json
+{ "body": "Looks good — verified against last 30 days of telemetry." }
+```
+
+### 3.5 `POST /v1/detection-proposals/{id}/eval`
+
+Attach eval result (metric deltas from `scripts/run_evals.py`).
+
+```json
+{
+ "mitre_accuracy_delta": 0.02,
+ "alert_reduction_delta": -0.01,
+ "investigation_completeness_delta": 0.0,
+ "response_quality_delta": 0.0
+}
+```
+
+### 3.6 `POST /v1/detection-proposals/{id}/decide`
+
+```json
+{ "decision": "approve" }
+```
+
+Valid decisions: `approve`, `reject`.
+
+### 3.7 `POST /v1/detection-proposals/{id}/promote`
+
+Promotes an approved proposal into `detection_rules`. Returns the new rule ID.
+
+### 3.8 `GET /v1/detection-proposals/baseline`
+
+Current eval baseline metrics used as the promotion gate reference.
+
+### 3.9 `POST /v1/detection-proposals/baseline`
+
+Reset eval baseline to the latest harness run (admin-only).
+
+---
+
+## 4. Federated Search — `/v1/federated`
+
+Service: `services/api` → `services/connectors`.
+
+Fan out a single query to connected SIEMs. The API translates the query into each target's native dialect (SPL for Splunk, KQL for Sentinel, ES|QL for Elastic).
+
+### 4.1 `POST /v1/federated/query`
+
+```json
+{
+ "query": "process.name = \"rundll32.exe\" AND network.direction = \"outbound\"",
+ "targets": ["splunk-prod", "sentinel-corp"],
+ "time_range": { "from": "2026-05-01T00:00:00Z", "to": "2026-05-06T00:00:00Z" }
+}
+```
+
+**Response**
+
+```json
+{
+ "results": [
+ { "target": "splunk-prod", "dialect": "spl", "hits": 14, "events": [ … ] },
+ { "target": "sentinel-corp", "dialect": "kql", "hits": 3, "events": [ … ] }
+ ]
+}
+```
+
+---
+
+## 5. Threat Intel IOC Search — `/v1/iocs`
Service: `services/threatintel`.
-### 3.1 `GET /v1/iocs/search`
+### 5.1 `GET /v1/iocs/search`
| Query param | Description |
|-------------|-------------|
@@ -175,7 +274,7 @@ Service: `services/threatintel`.
| `actor` | Filter by named actor |
| `since` | ISO timestamp |
-### 3.2 `POST /v1/iocs/semantic`
+### 5.2 `POST /v1/iocs/semantic`
Vector similarity search against Qdrant.
@@ -187,11 +286,11 @@ Vector similarity search against Qdrant.
}
```
-### 3.3 `GET /v1/iocs/{value}`
+### 5.3 `GET /v1/iocs/{value}`
Resolve a single indicator with all enrichment + actor links.
-### 3.4 `GET /v1/feeds/status`
+### 5.4 `GET /v1/feeds/status`
```json
{
@@ -202,17 +301,17 @@ Resolve a single indicator with all enrichment + actor links.
}
```
-### 3.5 `POST /v1/feeds/{name}/poll`
+### 5.5 `POST /v1/feeds/{name}/poll`
Trigger an immediate poll (admin-only).
---
-## 4. ML Fusion — `/ml`
+## 6. ML Fusion — `/ml`
Service: `services/fusion`.
-### 4.1 `GET /ml/status`
+### 6.1 `GET /ml/status`
```json
{
@@ -229,7 +328,7 @@ Service: `services/fusion`.
}
```
-### 4.2 `POST /ml/feedback`
+### 6.2 `POST /ml/feedback`
Submitted by analysts when triaging an alert.
@@ -244,7 +343,7 @@ Submitted by analysts when triaging an alert.
}
```
-### 4.3 `POST /ml/retrain`
+### 6.3 `POST /ml/retrain`
Force a retrain. Returns the new model metadata.
@@ -254,11 +353,11 @@ Force a retrain. Returns the new model metadata.
---
-## 5. Vulnerability Match Stream
+## 7. Vulnerability Match Stream
Vulnerability matches are surfaced both via Kafka (`vulnerability.matches` topic) and the API:
-### 5.1 `GET /v1/vulnerabilities`
+### 7.1 `GET /v1/vulnerabilities`
Lists recent KEV-correlated matches with host context joined from Neo4j.
@@ -270,13 +369,70 @@ Lists recent KEV-correlated matches with host context joined from Neo4j.
---
-## 6. Cases — `/v1/cases`
+## 8. Cases — `/v1/cases`
Unchanged from v1, but now joined with Neo4j attack paths via `GET /v1/cases/{id}/attack-path`.
---
-## 7. Authentication
+## 9. Hunt-as-Code — `/api/v1/hunts`
+
+Service: `services/agents`.
+
+YAML hunt definitions live in `hunts/`. Each file declares a hypothesis,
+MITRE ATT&CK tags, log sources, indicators, expected outcomes, and an
+optional schedule. The agents service loads the corpus at startup and
+exposes it via these endpoints.
+
+### 9.1 `GET /api/v1/hunts`
+
+List all hunts in the YAML corpus.
+
+### 9.2 `GET /api/v1/hunts/{hunt_id}`
+
+Single hunt definition (hypothesis, MITRE tags, indicators, schedule).
+
+### 9.3 `POST /api/v1/hunts/{hunt_id}/run`
+
+Run a hunt on demand. Returns run output including findings.
+
+### 9.4 `GET /api/v1/hunts/runs`
+
+Recent hunt runs (DB-backed). Query param: `limit` (default 50, max 500).
+
+### 9.5 `GET /api/v1/hunts/findings`
+
+Recent findings across all hunts. Query params: `hunt_id`, `status`, `limit`.
+
+### 9.6 `POST /api/v1/hunts/reload`
+
+Reload the corpus from disk and re-sync the catalog table.
+
+---
+
+## 10. Entity Risk (Risk-Based Alerting)
+
+Service: `services/fusion`.
+
+Time-decayed risk scores per entity (user, host, src_ip, domain).
+Alerts contribute severity-weighted points that decay with a configurable
+half-life. When an entity crosses `rba_promotion_threshold` it is
+promoted to an incident with contributing alerts attached.
+
+The entity-centric queue surfaces the top-N highest-risk entities to
+analysts instead of raw alert lists, supporting alert-to-incident
+ratios of ≥ 50:1.
+
+Entity risk data is stored in Redis hashes (per entity, namespaced by
+tenant) with ZSET-backed top-N sorted queues for O(log N) reads.
+
+> Entity risk is accessed internally by the fusion engine. The web
+> console reads the queue via the `/entity-risk` endpoints on the
+> API service (see the Docusaurus REST reference for the public surface).
+
+---
+
+## 11. Authentication
* JWT issued by `POST /v1/auth/login`.
* API keys via `Authorization: ApiKey <key>` header.
@@ -284,7 +440,7 @@ Unchanged from v1, but now joined with Neo4j attack paths via `GET /v1/cases/{id
---
-## 8. Errors
+## 12. Errors
All endpoints return RFC 7807 Problem Details:
@@ -300,7 +456,7 @@ All endpoints return RFC 7807 Problem Details:
---
-## 9. Rate Limits
+## 13. Rate Limits
| Tier | Requests/min |
|------|--------------|
@@ -312,6 +468,6 @@ Limits are tenant-scoped and enforced by Redis.
---
-## 10. Versioning
+## 14. Versioning
The API follows semver via the URL prefix `/v1`. Breaking changes will move to `/v2` and the previous version remains supported for at least 6 months.