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: round out user-facing documentation

Beenu Arora02e9ba391d55
diff --git a/apps/docs/docs/concepts/playbooks.md b/apps/docs/docs/concepts/playbooks.md
index 97e135aaf..681638ac6 100644
--- a/apps/docs/docs/concepts/playbooks.md
+++ b/apps/docs/docs/concepts/playbooks.md
@@ -4,59 +4,219 @@ sidebar_position: 2
# Playbooks
-Playbooks are visual, reusable automation workflows that orchestrate investigation
-and response steps.
+Playbooks are reusable, declarative workflows that orchestrate investigation and
+response. They run inside the `services/agents` service via the
+[`PlaybookEngine`](https://github.com/beenuar/AiSOC/tree/main/services/agents/app/playbook/engine.py),
+emit realtime events, and can be authored as JSON or via the visual React Flow
+editor in the web app.
-## Anatomy of a Playbook
+## Anatomy of a playbook
+
+A playbook is a Pydantic model with metadata, a trigger, and an ordered list of
+steps. The wire format is JSON; the runtime model is in
+[`services/agents/app/playbook/models.py`](https://github.com/beenuar/AiSOC/tree/main/services/agents/app/playbook/models.py).
```json
{
- "id": "ransomware-response",
+ "id": "ransomware-response-v1",
"name": "Ransomware Response",
+ "description": "Immediate containment and investigation for ransomware detections.",
"version": "1.0.0",
- "trigger": { "type": "manual" },
+ "tags": ["ransomware", "malware", "critical"],
+ "trigger": {
+ "on": "alert",
+ "severity": ["critical"],
+ "tags": ["ransomware"]
+ },
+ "author": "AiSOC",
+ "enabled": true,
"steps": [
{
- "id": "isolate-host",
- "type": "action",
- "action": "endpoint.isolate",
- "params": { "host": "{{ trigger.hostname }}" }
- },
- {
- "id": "enrich-iocs",
- "type": "enrichment",
- "indicators": "{{ trigger.iocs }}"
+ "id": "isolate",
+ "name": "Isolate affected host",
+ "type": "isolate_host",
+ "params": { "host_field": "alert.host" },
+ "on_failure": "abort",
+ "timeout_seconds": 30
}
]
}
```
-## Starter Templates
+| Field | Type | Description |
+|-------|------|-------------|
+| `id` | string | Stable identifier. Generated if omitted. |
+| `name` | string | Human-readable name shown in the UI. |
+| `version` | semver | Bumped on every breaking change to the playbook. |
+| `tags` | string[] | Free-form labels for filtering and marketplace search. |
+| `trigger` | object | When the playbook fires. See [Trigger types](#trigger-types). |
+| `steps` | object[] | Ordered list of steps. See [Steps](#steps). |
+| `enabled` | bool | Disabled playbooks are skipped by the dispatcher. |
+
+## Trigger types
+
+A trigger declares when the playbook should run. The dispatcher evaluates
+triggers against incoming alerts, cases, and schedules.
+
+```json
+{
+ "trigger": {
+ "on": "alert",
+ "severity": ["high", "critical"],
+ "tags": ["ransomware"],
+ "rule_ids": ["AIS-EDR-0001"]
+ }
+}
+```
+
+| `on` | Fires when | Common filters |
+|------|-----------|----------------|
+| `alert` | A new alert arrives in the fusion service | `severity`, `tags`, `rule_ids`, `source` |
+| `case` | A case is opened or transitions state | `severity`, `case_status` |
+| `manual` | An operator clicks **Run playbook** in the UI | n/a |
+| `schedule` | A cron expression matches | `cron` (e.g. `"0 */6 * * *"`) |
+| `webhook` | An external system POSTs to `/v1/playbooks/{id}/trigger` | optional `secret` |
+
+Severity values follow the four-tier ladder used everywhere in AiSOC:
+`info | low | medium | high`. Vendor-native ladders (Azure, SCC, GitHub) are
+collapsed into this set in each connector's `normalize()`.
+
+## Steps
+
+Each step has a `type` that maps to a handler in
+[`engine.py`](https://github.com/beenuar/AiSOC/tree/main/services/agents/app/playbook/engine.py).
+
+| `type` | What it does |
+|--------|--------------|
+| `enrich` | Calls the enrichment service for IOC reputation, geo, ASN, GreyNoise, VT, OTX. |
+| `investigate` | Triggers the AI investigator agent with focus areas (`forensics`, `lateral_movement`, etc.). |
+| `notify` | Sends a webhook, Slack, PagerDuty, or email notification. |
+| `block_ip` | Calls a firewall/EDR connector to block an IP (currently simulated for safety in OSS builds). |
+| `isolate_host` | Calls EDR to isolate a host (simulated by default). |
+| `create_ticket` | Opens a ticket in Jira / ServiceNow / Linear via connector. |
+| `close_case` | Marks the AiSOC case as closed via the API service. |
+| `http` | Generic outbound HTTP request — `method`, `url`, `body`, `headers`. |
+| `condition` | Pure branching node. Evaluates `condition` and routes to `next_true` / `next_false`. |
+
+Common step fields:
+
+| Field | Default | Description |
+|-------|---------|-------------|
+| `id` | auto | Used as the target for `next_true` / `next_false`. |
+| `name` | required | Human-readable label. |
+| `params` | `{}` | Step-specific parameters. Supports `{{field}}` substitution from run context. |
+| `condition` | `null` | Optional gate. If false, step is `SKIPPED`. |
+| `on_failure` | `abort` | One of `abort`, `continue`, `retry`. |
+| `retry_max` | `0` | Retry attempts before applying `on_failure`. Backoff is `min(2^attempt, 30)` seconds. |
+| `timeout_seconds` | `30` | Per-step timeout. |
+| `next_true` / `next_false` | `null` | Step IDs to jump to for branching. |
+
+## Conditions
+
+A `StepCondition` is evaluated against the run context (which starts as the
+trigger payload and accumulates each step's result):
+
+```json
+{
+ "condition": {
+ "field": "alert.severity",
+ "operator": "eq",
+ "value": "critical"
+ }
+}
+```
+
+Supported operators: `eq`, `ne`, `gt`, `lt`, `contains`, `exists`. The `field`
+uses dot-path resolution (`alert.host.name`) and `null` is returned for missing
+keys, so `exists` is the safe way to check optional data before branching on it.
+
+## Error handling
+
+The engine treats steps as discrete units of work with structured error
+handling.
+
+- `on_failure: "abort"` (default) — failed step stops the run, marks it
+ `FAILED`, and emits `run.done` with the error.
+- `on_failure: "continue"` — log the failure but proceed to the next step.
+ Useful for best-effort enrichment that shouldn't block containment.
+- `on_failure: "retry"` — combined with `retry_max`, retries with exponential
+ backoff before falling back to whatever you set as the next-failure mode.
+- Cycle detection — if the engine revisits the same `step.id`, it aborts with
+ `error: "cycle at step <id>"` rather than looping forever.
+- Unknown step type — the step is recorded as `SKIPPED` with
+ `reason: "no handler for <type>"` so unknown actions never silently succeed.
+
+Each step result includes `_elapsed_ms` so you can see per-step latency in the
+UI and in run history.
+
+## Approvals and dry-runs
+
+Two patterns are supported today for human-in-the-loop steps:
+
+1. **`dry_run` flag** — pass `dry_run: true` when calling
+ `PlaybookEngine.run(...)` (or set `dry_run` in step params for individual
+ destructive actions). Handlers short-circuit with
+ `{"dry_run": true, "step": <name>}` and emit the same realtime events, so
+ you can preview an entire run without touching production.
+2. **Manual approval gate** — model the gate as a `condition` step backed by a
+ field that an operator sets via the API (`POST /v1/playbook-runs/{id}/approve`).
+ The engine pauses on the condition until the field flips, then resumes.
+
+`block_ip`, `isolate_host`, and `create_ticket` are simulated by default in OSS
+builds (they return `{"simulated": true, ...}`). Wire them to real connectors
+by editing the corresponding handler in `engine.py` or by replacing the step
+with an `http` step that calls your connector's enforcement endpoint.
+
+## Realtime events
+
+Every run emits events to the realtime service so the UI can stream progress:
+
+| Event | When |
+|-------|------|
+| `run.started` | The engine begins executing. |
+| `step.started` | Before each non-condition step. |
+| `step.done` | After each step, with `status` and `result_keys`. |
+| `run.done` | Final state, including the full `PlaybookRun` object. |
+
+Channel format: `playbook:<run_id>`. Subscribe via WebSocket
+(`/realtime/ws?channel=playbook:<run_id>`) or the SDK
+(`AiSOC.subscribe("playbook", run_id)`).
+
+## Starter templates
+
+AiSOC ships with starter playbooks under
+[`services/agents/data/playbooks/`](https://github.com/beenuar/AiSOC/tree/main/services/agents/data/playbooks):
-AiSOC ships with 12 starter templates:
+| Template | Trigger | Description |
+|----------|---------|-------------|
+| `ransomware-response` | `severity: critical, tags: ransomware` | Isolate, enrich IOCs, AI forensic investigation, P1 ticket, page on-call. |
+| `phishing-triage` | `severity: medium+, tags: phishing` | Sandbox attachments, enrich URLs, quarantine, notify user. |
+| `credential-stuffing` | `tags: auth-anomaly` | Velocity check, geo-impossible-travel, force-reauth, ticket. |
+| `data-exfiltration` | `tags: dlp` | Block egress, snapshot session, enrich destination, page DPO. |
+| `malware-analysis` | manual | Sandbox detonation + AI summary of behaviour. |
+| `insider-threat` | `tags: ueba` | Pull 30-day behaviour, peer comparison, escalate to HR-sec. |
+| `lateral-movement` | `tags: lateral` | Trace process tree, identity-graph hunt, contain pivot host. |
+| `privilege-escalation` | `tags: privesc` | Revoke session tokens, audit recent role changes. |
+| `c2-beacon` | `tags: c2` | Block destination, isolate beaconing host, enrich infra. |
+| `supply-chain-alert` | `tags: supply-chain` | Pin dep, scan repo, open security advisory. |
+| `cloud-misconfiguration` | `source: cspm` | Auto-remediate via IaC PR, notify owner. |
+| `vulnerability-critical` | `cvss>=9.0` | Patch advisory, asset graph blast-radius, ticket. |
-| Template | Description |
-|----------|-------------|
-| `ransomware-response` | Full ransomware triage and containment |
-| `phishing-triage` | Email phishing investigation |
-| `credential-stuffing` | Account takeover detection |
-| `data-exfiltration` | DLP alert response |
-| `malware-analysis` | Dynamic malware sandbox workflow |
-| `insider-threat` | Anomalous user behaviour |
-| `lateral-movement` | East-west threat hunting |
-| `privilege-escalation` | PrivEsc detection and response |
-| `c2-beacon` | C2 traffic containment |
-| `supply-chain-alert` | Dependency compromise triage |
-| `cloud-misconfiguration` | Cloud posture alert |
-| `vulnerability-critical` | Critical CVE response |
+## Playbook editor
-## Playbook Editor
+The visual editor lives at **Playbooks → Editor** in the web app. It is built
+on React Flow and lets you:
-The visual React Flow editor lets you:
+- Drag-and-drop nodes (trigger, enrichment, decision, action, notification).
+- Connect nodes to define `next_true` / `next_false` flow.
+- Configure `params`, `condition`, and `on_failure` inline per node.
+- Export to JSON, save to the API, or **Run now** with a sample payload.
+- Replay a past run with the same trigger context for debugging.
-- Drag-and-drop nodes (trigger, enrichment, decision, action, notification)
-- Connect nodes to define flow
-- Configure step parameters inline
-- Export to JSON or run immediately
+## See also
-Navigate to **Playbooks → Editor** in the UI to get started.
+- [Plugin overview](../plugins/overview) — discover and install community playbooks from the marketplace.
+- [Connectors](../connectors) — the integrations your playbook steps call.
+- [Operations → Security](../operations/security) — RBAC for who can edit and
+ run playbooks.
+- [Glossary](../glossary) — terminology used in playbook authoring.
diff --git a/apps/docs/docs/contributing/guidelines.md b/apps/docs/docs/contributing/guidelines.md
index 9f8b6d3d2..c462f3f0f 100644
--- a/apps/docs/docs/contributing/guidelines.md
+++ b/apps/docs/docs/contributing/guidelines.md
@@ -4,54 +4,247 @@ sidebar_position: 2
# Contribution Guidelines
-Thank you for contributing to AiSOC! Please read these guidelines before opening a PR.
+Thank you for contributing to AiSOC! This guide covers everything you need to
+know to land a clean pull request: branching, testing, commit format, the PR
+template, plan files for larger work, and the eval-harness gate that protects
+agent quality.
+
+For end-to-end project standards (code style, connector contributions,
+community marketplace), see also the root-level
+[`CONTRIBUTING.md`](https://github.com/beenuar/AiSOC/blob/main/CONTRIBUTING.md).
## Code of Conduct
-All contributors must follow our [Code of Conduct](https://github.com/beenuar/AiSOC/blob/main/CODE_OF_CONDUCT.md).
+All contributors must follow our
+[Code of Conduct](https://github.com/beenuar/AiSOC/blob/main/CODE_OF_CONDUCT.md).
+Be respectful, constructive, and assume good faith.
## Branching Strategy
-- `main` — the long-lived branch most contributors target. Tags cut here.
-- `develop` — optional integration branch; CI watches both `main` and
- `develop`, so coordinated multi-PR work can land here first.
-- `feature/<name>` — new features
-- `fix/<name>` — bug fixes
+- `main` — long-lived branch most contributors target. Tags are cut here.
+- `develop` — optional integration branch for coordinated multi-PR work. CI
+ watches both `main` and `develop`.
+- `feature/<name>` — new features.
+- `fix/<name>` — bug fixes.
+- `docs/<name>` — documentation-only changes.
+- `chore/<name>` — tooling, deps, refactors with no behavior change.
+
+Most contributors should branch from `main`. Use `develop` only when
+explicitly coordinating a stack of dependent PRs with a maintainer.
+
+## Pull Request Workflow
+
+1. Fork the repo and create a branch from `main`.
+2. Make focused commits — one logical change per commit, smallest reviewable
+ unit per PR.
+3. Write or update tests for any new or changed behavior (see [Testing](#testing)).
+4. Run linters and the relevant test suite locally before pushing.
+5. Update documentation if behavior, commands, env vars, or APIs changed.
+6. If your change touches the agent, orchestrator graph, prompts, tools, RAG
+ corpus, or detection content, **re-run the eval harness** and include
+ before/after deltas in the PR body (see [Eval harness gate](#eval-harness-gate)).
+7. Push to your fork and open a PR against `main`.
+8. Fill out the [PR template](#pr-template) completely. Empty checkboxes block
+ review.
+
+### PR Template
+
+Every pull request uses the
+[default PR template](https://github.com/beenuar/AiSOC/blob/main/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md).
+The required sections are:
+
+- **Summary** — 2–3 sentences describing what changed and why.
+- **Type of change** — bug fix, feature, breaking change, docs, refactor, or
+ CI/infra. Tick exactly one.
+- **Related issues** — `Closes #N` for any linked issue.
+- **Changes** — bullet list of the key files or areas touched, with a brief
+ rationale.
+- **Testing** — how you verified the change. Tick the boxes that apply (unit
+ tests, integration tests, manual). Include exact manual steps in the
+ collapsible block when applicable.
+- **Screenshots** — required for any user-facing UI change. Before/after side
+ by side, or a short screen recording.
+- **Checklist** — code-style compliance, self-review, tests, docs updated, no
+ new linter warnings, no sensitive data in the diff.
+
+For new detection rules, use the dedicated
+[detection rule template](https://github.com/beenuar/AiSOC/blob/main/.github/PULL_REQUEST_TEMPLATE/detection_rule.md)
+which prompts for MITRE ATT&CK technique IDs, fixture coverage, and false-positive
+notes.
+
+## Testing
+
+AiSOC has three layers of automated checks. **PRs that fail any layer cannot
+land.**
+
+### 1. Linting and type checks
+
+Run before every commit:
+
+```bash
+pnpm lint # ESLint + Prettier across the workspace
+pnpm --filter @aisoc/web typecheck # TypeScript on the web app
+ruff check services/ # Python linting
+mypy services/<name> # type-check the service you touched
+( cd services/<name> && go vet ./... && gofmt -l . )
+```
+
+CI runs the same commands; passing locally is the cheapest way to avoid
+back-and-forth on review.
+
+### 2. Unit and integration tests
+
+Run the suite for whichever surface you touched:
+
+```bash
+# Web app
+pnpm --filter @aisoc/web test
+
+# Python services
+pytest services/api/tests/
+pytest services/agents/tests/
+pytest services/connectors/tests/
+# ...etc.
+
+# Go services
+( cd services/ingest && go test ./... )
+```
+
+New code requires new tests. New connectors require schema-contract,
+`normalize()`, and mocked `test_connection` + `fetch_alerts` tests at minimum.
+See [`CONTRIBUTING.md` → Adding New Connectors](https://github.com/beenuar/AiSOC/blob/main/CONTRIBUTING.md#adding-new-connectors)
+for the exact shape.
+
+### 3. Eval harness gate {#eval-harness-gate}
+
+This is what prevents agent regressions and is **non-negotiable** for any PR
+touching the agent substrate.
+
+Anything that touches `services/agents/`, the orchestrator graph, prompts,
+tools, the RAG corpus, or detection content **must** be re-graded against the
+public eval harness:
+
+```bash
+# Run all four substrate eval suites and write a JSON report.
+# Dataset size is fixed (200 incidents); there is no --count flag.
+python scripts/run_evals.py --out eval_report.json
+
+# Or run a single eval axis
+pytest services/agents/tests/test_mitre_accuracy.py
+pytest services/agents/tests/test_alert_reduction.py
+pytest services/agents/tests/test_investigation_completeness.py
+pytest services/agents/tests/test_response_quality.py
+```
+
+The harness writes `eval_report.json` and `eval_mitre_accuracy_report.json`,
+which the public [eval harness page](../benchmark) renders. The same harness
+runs in CI on every PR.
-## Pull Requests
+**If your PR regresses any axis below the published baseline**, the PR body
+must include:
-1. Fork the repo and create a branch from `main`
- (or from `develop` if you are coordinating a stack of changes there).
-2. Write tests for any new code.
-3. Ensure CI passes locally: `pnpm lint`, `pnpm --filter @aisoc/web test`,
- `pytest services/<name>/tests/` for Python services you touched, and
- `go test ./...` for Go services you touched.
-4. Update documentation if behavior, commands, or APIs changed.
-5. Open a PR against `main` (or `develop` if your work is being coordinated
- on the integration branch).
+1. The before/after delta for each affected axis.
+2. A written justification for why the regression is acceptable.
+
+> **Be honest about what you measure.** Three of the four metrics are
+> substrate self-consistency gates against deterministic synthetic incidents,
+> not live agent accuracy scores. The
+> [eval harness page](../benchmark) explains exactly which is which. Update
+> that page in the same commit if your PR changes a suite's metric category.
## Commit Messages
-Follow [Conventional Commits](https://www.conventionalcommits.org/):
+Follow [Conventional Commits](https://www.conventionalcommits.org/). The
+prefix is enforced by CI and used to generate changelog entries.
+```text
+feat(connectors): add Tailscale audit log connector
+fix(agents): handle empty IOC list in ForensicAgent
+docs(quickstart): add Go SDK example
+chore(deps): bump pnpm to 9.1.0
+test(api): cover RLS rejection path on alerts endpoint
+refactor(fusion): extract Bloom dedup into a shared module
```
-feat: add VirusTotal enricher plugin
-fix: handle empty indicator list in ForensicAgent
-docs: update quickstart with Go SDK example
-chore: bump pnpm to 9.1.0
+
+Allowed types: `feat`, `fix`, `docs`, `chore`, `test`, `refactor`, `perf`,
+`ci`, `build`, `revert`. Scope (in parentheses) is optional but encouraged
+when it makes the diff clearer.
+
+Breaking changes get a `!` and a `BREAKING CHANGE:` footer:
+
+```text
+feat(api)!: rename /alerts/{id}/triage to /alerts/{id}/verdict
+
+BREAKING CHANGE: clients calling POST /alerts/{id}/triage must
+migrate to POST /alerts/{id}/verdict before upgrading to v7.
```
## Code Style
-- **Python**: `ruff` for linting, `mypy` for type checking
-- **Go**: `go vet` + `gofmt`
-- **TypeScript**: ESLint + Prettier (enforced by CI)
+| Language | Linter / formatter | Type checker |
+| ---------- | ----------------------------- | ------------------- |
+| Python | `ruff` (lint + format) | `mypy` |
+| TypeScript | ESLint + Prettier | `tsc --noEmit` |
+| Go | `gofmt` | `go vet` |
+| YAML | `yamllint` (detections, hunts)| — |
-## Security
+Configurations live at the repo root (`ruff.toml`, `eslint.config.mjs`,
+`.prettierrc`) and per-service (`pyproject.toml`, `tsconfig.json`, `go.mod`).
+
+## Plan Files (for larger work)
+
+Multi-PR features, refactors, or anything that needs design review before
+implementation should land a **plan file** first.
-Never commit secrets, API keys, or credentials. Use `.env` and `.gitignore`.
+### When to write a plan
+
+Write a plan when your change:
+
+- Touches more than ~5 services or packages.
+- Introduces a new top-level concept (a new agent, a new storage tier, a new
+ API surface).
+- Requires a database migration that is not trivially reversible.
+- Changes a public API contract (REST, GraphQL, WebSocket, SDK, MCP tools).
+- Is expected to take more than one PR to land.
+
+You don't need a plan for bug fixes, small features, or docs.
+
+### Plan file conventions
+
+- Location: `docs/plans/<short-slug>.md` (create the directory if it doesn't
+ yet exist).
+- Filename: lowercase, hyphenated, descriptive — e.g.
+ `docs/plans/auto-triage-confidence-rework.md`.
+- Required sections:
+ - **Context** — what problem this solves and why now.
+ - **Goals / Non-goals** — explicit list of each.
+ - **Proposed change** — the design at a level a reviewer can argue with.
+ - **Migration / rollout** — how existing tenants and data are handled.
+ - **Eval impact** — which harness axes might move and your hypothesis.
+ - **Open questions** — things you want a maintainer to weigh in on.
+- Open the plan as its own PR. Maintainers review the plan before any
+ implementation PRs land. Once approved, implementation PRs reference the
+ plan in their `Related issues` / `Changes` section.
+
+> **Never edit a plan file once it is approved and implementation has started.**
+> If the design changes mid-implementation, write a follow-up "amendment" PR
+> against the plan file, or open a new plan that supersedes the old one.
+
+## Security
-Report security vulnerabilities privately via GitHub Security Advisories.
+- **Never commit secrets, API keys, or credentials.** Use `.env` files (which
+ are git-ignored) and document required keys in the
+ [environment variables reference](../deployment/env-vars).
+- Run `git diff --staged` before every commit and visually scan for tokens,
+ passwords, customer hostnames, or sample payloads with PII.
+- Report security vulnerabilities **privately** via GitHub Security
+ Advisories at
+ [github.com/beenuar/AiSOC/security/advisories/new](https://github.com/beenuar/AiSOC/security/advisories/new).
+ Do not open a public issue for vulnerabilities.
+
+See the [security operations guide](../operations/security) for the full
+threat model, RBAC layout, audit-log surface, and credential-vault rotation
+procedure.
## License
diff --git a/apps/docs/docs/glossary.md b/apps/docs/docs/glossary.md
new file mode 100644
index 000000000..d5602859f
--- /dev/null
+++ b/apps/docs/docs/glossary.md
@@ -0,0 +1,262 @@
+---
+sidebar_position: 99
+---
+
+# Glossary
+
+A reference for terminology used across AiSOC docs, code, and the UI.
+Terms are grouped so you can find them by area; everything is also
+alphabetized within each group.
+
+## Core platform
+
+**AiSOC** — Open-source AI Security Operations Center. The agent itself is
+MIT-licensed and self-hostable, with a public eval harness gating every PR
+that touches the substrate.
+
+**Ambient Copilot** — Context-aware suggestion strip that appears on every
+alert, case, rule, and playbook page. Each suggestion is a one-click action
+that runs an agent tool with a pre-filled payload.
+
+**Case** — A unit of investigation grouping one or more alerts, evidence
+items, agent decisions, and analyst actions. Cases are the surface where
+the [Investigation Ledger](./concepts/cases) is rendered.
+
+**Connector** — Schema-driven integration that pulls events from a vendor
+API (EDR, SIEM, cloud, IAM, SaaS, VCS, network) and pushes normalized OCSF
+records into the ingest spine. See the [connector catalog](./connectors).
+
+**Detection rule** — A query (Sigma / YARA / KQL / EQL) that fires an
+alert when matching events are seen. AiSOC ships ~800 native rules plus
+~6,000 imported from public catalogs, each tagged with provenance.
+
+**Investigation Ledger** — Append-only, replayable record of every
+prompt, tool call, evidence citation, and decision the agent emits while
+working a case. See [Concepts → Cases](./concepts/cases).
+
+**MCP (Model Context Protocol)** — Protocol used by `@aisoc/mcp` to expose
+AiSOC tools to IDE-side LLM clients (Claude Desktop, Cursor, Continue,
+Cody). See [Integrations → MCP](./integrations/mcp).
+
+**Playbook** — Visual, reusable automation workflow built from trigger,
+enrichment, decision, action, and notification nodes. See
+[Concepts → Playbooks](./concepts/playbooks).
+
+**Responder PWA** — Installable mobile route at `/responder/*` for
+on-call analysts. Passkey-only login, on-call rotation, approvals queue,
+VAPID Web Push, and an offline shell.
+
+**Substrate** — The deterministic non-LLM layer (extractors, fusion,
+templates, judges) that the eval harness exercises against synthetic
+data. Three of the four eval suites measure substrate self-consistency,
+not live agent accuracy.
+
+## Detection & alerting
+
+**Alert** — A single signal emitted by a detection rule, fusion model, or
+external SIEM. Alerts are the raw input to triage and may roll up into a
+case.
+
+**Detection-as-Code (DAC)** — Workflow where detection rules are proposed,
+reviewed, and gated by the eval harness before promotion. Proposals that
+regress MITRE accuracy are blocked.
+
+**Detection confidence** — Each fused alert carries a `high / medium /
+low` label derived from weighted factors (rule fidelity, ML score, IOC
+reputation, UEBA Z-score). The label is computed, not hand-set.
+
+**Detection drift** — Change in MITRE ATT&CK coverage over time.
+Scheduled coverage snapshots enable "delta vs. last week" tracking on
+the heatmap.
+
+**Fusion** — Real-time stage that ingests alerts off the Kafka spine,
+applies ML scoring (LightGBM + Isolation Forest), deduplicates on a
+Bloom filter of 10M+ IOCs, and writes correlated alerts to the storage
+tier.
+
+**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.
+
+**Indicator (IOC)** — Indicator of Compromise. An observable (IP,
+domain, hash, email, URL) used in detection and enrichment.
+
+**MITRE ATT&CK** — Adversary tactics-and-techniques framework that AiSOC
+uses for tagging detections, tracking coverage, and grading agent
+accuracy in the eval harness.
+
+**Risk-Based Alerting (RBA)** — Mode where alerts contribute time-decayed
+risk points to entities (user, host, IP, domain). Crossing a configurable
+threshold promotes the entity to an incident with contributing alerts
+attached.
+
+**Sigma** — Generic, vendor-agnostic detection rule format. AiSOC stores
+all native rules in a Sigma-shaped schema and translates at query time.
+
+**UEBA (User and Entity Behavior Analytics)** — Per-entity online
+baselines (Welford's online algorithm) and Z-score anomaly scoring.
+Anomalies are published back to Kafka for fusion.
+
+## Investigation & response
+
+**Attack graph** — Neo4j entity graph of users, hosts, processes,
+network flows, and IOCs. Used for attack-path reconstruction and
+blast-radius gating on automated response actions.
+
+**Blast radius** — The set of entities a proposed automated action would
+affect. Destructive actions are gated by approvals and ATT&CK-aware
+blast-radius checks.
+
+**ChatOps** — Slack and Teams interactive prompts with HMAC-signed
+callback choices (`acknowledge` / `deny` / `escalate`) for human-in-the-
+loop response actions.
+
+**Honeytoken** — HMAC-SHA256-signed deceptive credential (URL, file, AWS
+key, email, document) that fires a webhook the moment it is touched.
+
+**Incident** — Promoted case representing a confirmed or high-confidence
+threat. RBA, manual escalation, and certain auto-triage verdicts can
+produce incidents.
+
+**On-call rotation** — Scheduled set of analysts who receive Web Push
+notifications via the Responder PWA when high-priority alerts or
+approval requests arrive.
+
+**Triage** — First-pass classification of an alert as true positive,
+false positive, or benign. AiSOC's auto-triage agent assigns a confidence
+score; high-confidence false positives close automatically, uncertain
+alerts escalate to humans.
+
+## Threat intelligence
+
+**MISP** — Open-source threat intel platform. AiSOC ingests MISP feeds
+into its triple-storage model (search · vector · graph).
+
+**OTX** — AlienVault Open Threat Exchange. Ingested alongside MISP and
+TAXII feeds.
+
+**STIX 2.1** — Structured Threat Information eXpression. AiSOC publishes
+and consumes STIX 2.1 bundles for bidirectional intel sharing.
+
+**TAXII 2.1** — Trusted Automated eXchange of Indicator Information.
+Transport layer for STIX. AiSOC supports TAXII collection management
+and pull-based ingestion.
+
+## Identity, access, security
+
+**Audit log** — Immutable, tenant-scoped record of mutating operations
+on the API and console. Backed by Postgres with cryptographic chaining.
+See [Operations → Security](./operations/security).
+
+**API key** — Long-lived service credential. Stored hashed (SHA-256);
+the plaintext is shown exactly once at creation.
+
+**Credential vault** — Application-layer Fernet (AES-128-CBC + HMAC-
+SHA256) encryption for connector secrets. Key in `AISOC_CREDENTIAL_KEY`;
+rotation supported via `MultiFernet` and
+`AISOC_CREDENTIAL_KEY_ROTATION_FROM`. Vault tokens are formatted
+`vault:v1:<base64>`. See [Operations → Credentials](./operations/credentials).
+
+**JWT** — JSON Web Token used as the session credential between the web
+console and the API. Signed with `SECRET_KEY` (HS256 by default).
+
+**MFA (Multi-Factor Authentication)** — TOTP and WebAuthn (passkeys)
+supported. Passkeys are required on the Responder PWA.
+
+**Passkey** — WebAuthn credential bound to a user account; used as
+primary auth on the Responder PWA and as an MFA factor on the desktop
+console.
+
+**RBAC (Role-Based Access Control)** — Permissions granted via roles.
+AiSOC ships `viewer`, `analyst`, `responder`, `admin`, and `owner` roles
+with granular per-resource scopes.
+
+**RLS (Row-Level Security)** — Postgres feature used to enforce multi-
+tenant isolation. Every tenant-scoped table has an RLS policy keyed on
+the `app.current_tenant_id` session variable.
+
+**SAML 2.0** — Enterprise SSO protocol. Supported alongside OIDC for
+console and API authentication.
+
+**Tenant** — Top-level isolation boundary. All tenant-scoped tables
+carry a `tenant_id` column and are protected by RLS.
+
+## Eval & quality
+
+**Alert reduction** — Real measurement: ratio of raw alerts in to
+correlated incidents out, computed over a fixed noisy stream.
+
+**Eval harness** — Reproducible suite that runs in CI against a fixed
+200-incident synthetic dataset. Three suites measure substrate self-
+consistency; one (`mitre_accuracy`) calls the live agent. See
+[Benchmark](./benchmark).
+
+**False positive rate (FPR)** — Share of alerts marked false positive
+by analysts or auto-triage. Drives noise-tuning recommendations.
+
+**MTTD / MTTR / MTTC** — Mean Time To Detect / Respond / Contain.
+SLA-tracked on the compliance dashboard.
+
+## Operations & deployment
+
+**Air-gapped deploy** — Fully offline install with mirrored container
+images and signed plugin bundles. See [Operations → Air-gapped](./operations/airgap).
+
+**APScheduler** — Python in-process job scheduler used by connectors
+(per-instance polling) and Hunt-as-Code (continuous hunt execution).
+
+**Demo profile** — Slim Docker Compose stack (`docker-compose.demo.yml`)
+spun up by `pnpm aisoc:demo`. Pulls prebuilt GHCR images, seeds canonical
+data, and lands you on a live case.
+
+**Doctor** — `pnpm aisoc:doctor` health-check that walks ports,
+containers, demo data, the API, and the WebSocket gateway, and tells you
+exactly what's red.
+
+**Ingest spine** — Kafka-backed message bus that all connectors,
+ingestors, and stream processors read and write. Sub-second alert
+latency end-to-end.
+
+## Compliance & governance
+
+**DORA** — EU Digital Operational Resilience Act. AiSOC ships a DORA
+evidence dashboard alongside SOC 2, ISO 27001, NIST CSF, PCI-DSS, and
+HIPAA.
+
+**EASM (External Attack Surface Management)** — Continuous asset
+discovery, exposed-service detection, certificate monitoring with expiry
+alerts, and risk scoring.
+
+**Evidence** — Compliance artefact (configuration snapshot, log query
+result, attestation) collected automatically from connected sources and
+mapped to control IDs.
+
+**MSSP** — Managed Security Service Provider. AiSOC's MSSP dashboard
+gives cross-tenant aggregated KPIs and per-tenant risk scoring.
+
+## Plugin & SDK
+
+**Marketplace** — In-app catalog (`/marketplace`) of plugins, playbooks,
+and detection packs, surfaced via [`marketplace/index.json`](https://github.com/beenuar/AiSOC/tree/main/marketplace)
+and filterable by tier (`stable` / `beta` / `imported` / `community`).
+
+**Plugin manifest** — `plugin.yaml` mirroring a connector's `schema()`
+classmethod. Required for marketplace listing.
+
+**SDK** — Python, TypeScript, and Go client libraries plus matching
+plugin SDKs. Plugins are Ed25519-signed at publish time.
+
+**Tier** — Marketplace quality bucket. `stable` plugins/rules ship and
+are supported by the AiSOC project; `beta` are usable but evolving;
+`imported` come from public catalogs (SigmaHQ, Splunk Security Content,
+Chronicle, MITRE CAR); `community` are user-contributed.
+
+## See also
+
+- [Concepts → Cases](./concepts/cases) — including the Investigation Ledger
+- [Concepts → Detections](./concepts/detections)
+- [Concepts → Playbooks](./concepts/playbooks)
+- [Operations → Security](./operations/security)
+- [Operations → Credentials](./operations/credentials)
+- [Benchmark](./benchmark)
diff --git a/apps/docs/docs/intro.md b/apps/docs/docs/intro.md
index 074f15f49..307040370 100644
--- a/apps/docs/docs/intro.md
+++ b/apps/docs/docs/intro.md
@@ -75,20 +75,45 @@ See the full [Architecture](./architecture) page for the detailed service map an
## Quick Links
+### Get started
+
- [Quick Start](./quickstart) — `pnpm aisoc:demo`, under 5 minutes to a live investigation
+- [Architecture](./architecture) — service map and data flow
+- [Glossary](./glossary) — security and AiSOC-specific terminology in one place
+- [FAQ](./operations/faq) — common questions about scope, deployment, data, and licensing
+
+### Core concepts
+
+- [Detections](./concepts/detections)
+- [Playbooks](./concepts/playbooks) — anatomy, triggers, conditions, approvals
+- [Cases](./concepts/cases) — including the Investigation Ledger
+- [Capabilities](./concepts/capabilities) — full feature inventory by tier
+
+### Connect & extend
+
- [Connectors](./connectors) — click-and-connect catalog with 26 cloud / SaaS / SIEM / EDR / IAM / VCS / network sources
-- [Operations: Credentials](./operations/credentials) — `CredentialVault` threat model, key rotation, hosted-OAuth roadmap
-- [Public eval harness](./benchmark) — alert reduction (real measurement) plus MITRE / completeness / response-quality substrate self-consistency gates
- [MCP Integration](./integrations/mcp) — connect Claude / Cursor / Continue / Cody
-- [Architecture](./architecture) — service map and data flow
-- [API Reference (REST)](./api/rest) — OpenAPI 3.1 spec
-- [API Reference (GraphQL)](./api/graphql) — schema and queries
-- [API Reference (WebSocket)](./api/websocket) — real-time events
- [Plugin SDK (Python)](./plugins/python-sdk)
- [Plugin SDK (Go)](./plugins/go-sdk)
-- [Concepts: Detections](./concepts/detections)
-- [Concepts: Playbooks](./concepts/playbooks)
-- [Concepts: Cases](./concepts/cases) — including the Investigation Ledger
+
+### APIs
+
+- [REST API](./api/rest) — OpenAPI 3.1 spec
+- [GraphQL API](./api/graphql) — schema and queries
+- [WebSocket API](./api/websocket) — real-time events
+
+### Operate
+
- [Deployment: Docker](./deployment/docker)
- [Deployment: Kubernetes](./deployment/kubernetes)
- [Deployment: Environment Variables](./deployment/env-vars)
+- [Security model](./operations/security) — RBAC, MFA/SSO, audit logs, multi-tenant isolation
+- [Credentials](./operations/credentials) — `CredentialVault` threat model and key rotation
+- [Upgrades & versioning](./operations/upgrades) — release cadence, deprecation policy, in-place upgrades
+- [Troubleshooting](./operations/troubleshooting) — common errors, log locations, recovery
+
+### Quality & community
+
+- [Public eval harness](./benchmark) — alert reduction plus MITRE / completeness / response-quality gates
+- [Contributing](./contributing/dev-setup) — local dev setup
+- [Contribution guidelines](./contributing/guidelines) — branching, PR template, testing, plan files
diff --git a/apps/docs/docs/operations/sonali-consultation-questions.md b/apps/docs/docs/operations/adoption-questions.md
similarity index 100%
rename from apps/docs/docs/operations/sonali-consultation-questions.md
rename to apps/docs/docs/operations/adoption-questions.md
diff --git a/apps/docs/docs/operations/faq.md b/apps/docs/docs/operations/faq.md
new file mode 100644
index 000000000..7b15c556b
--- /dev/null
+++ b/apps/docs/docs/operations/faq.md
@@ -0,0 +1,257 @@
+---
+sidebar_position: 5
+title: FAQ
+description: Frequently asked questions about AiSOC — what it is, how it deploys, how the agent and detection content work, and how teams actually adopt it.
+---
+
+# Frequently Asked Questions
+
+The questions on this page are the ones that come up most often in the [adoption consultation](./adoption-questions) — both from security leaders evaluating AiSOC and from analysts running it day-to-day. Skim the section headers; jump in.
+
+---
+
+## What AiSOC is
+
+### What does AiSOC actually do?
+
+AiSOC is an open-source AI Security Operations Center. It does three things:
+
+1. **Pulls security signal in** from your existing stack — EDR, SIEM, identity providers, cloud audit logs, SaaS, network — through a click-and-connect [connector catalog](../connectors/).
+2. **Runs detection, fusion, and AI investigation** on that signal — Sigma-shaped detection rules, ML-based fusion, a LangGraph multi-agent investigation that builds a case end-to-end with full evidence and reasoning recorded to a replayable [Investigation Ledger](../concepts/cases).
+3. **Drives response with explicit human boundaries** — playbooks, ChatOps approvals, blast-radius gates, and an autonomy policy you control per action class.
+
+### How is this different from "yet another AI SIEM"?
+
+Three things.
+
+First, **the agent is auditable**. Every prompt, response, tool call, evidence citation, and decision is recorded step-by-step on the case. You can re-watch any investigation. AI that won't show its work is a non-starter for SOC.
+
+Second, **the substrate is gated by a public, reproducible eval harness on every PR**. Most "AI SIEMs" claim accuracy without a way to verify it. We publish the dataset, the suites, the gates, and run them in CI on every commit. See [Benchmark](../benchmark).
+
+Third, **everything is open source under MIT**. Self-host it, fork it, audit the code, embed it in an air-gapped network. There is no rug-pull because the only license is permissive.
+
+### Is AiSOC a SIEM, a SOAR, or an XDR?
+
+AiSOC is a "what comes after" — it sits on top of your existing SIEM/EDR/cloud stack and replaces the analyst's workflow, not the data lake.
+
+That said, it carries the building blocks: an OpenSearch + ClickHouse search tier, a Kafka spine, a fusion service, a detection engine, a playbook engine, an entity graph, an audit trail, a UEBA service, honeytokens, and a purple-team feedback loop. If you want to swap your SIEM for it, you can. Most teams start by pointing AiSOC *at* their existing SIEM.
+
+### Who is AiSOC for?
+
+In rough order of best-fit:
+
+- **Mid-market security teams** drowning in alerts they can't triage, with one or two analysts on rotation.
+- **MSSPs** running a SOC for multiple customers — see the multi-tenant + parent-tenant console.
+- **Internal SOCs at regulated enterprises** that need an auditable AI loop with hard autonomy boundaries.
+- **Open-source security engineers** who want a working substrate to build their own detection tooling on.
+
+If you have one analyst handling 50 alerts a day with no automation, AiSOC will give you back time. If you have a 30-person tier-3 SOC with mature SOAR, AiSOC is a force multiplier on your tier-1 / tier-2.
+
+---
+
+## Deployment & operations
+
+### Can AiSOC run on my laptop?
+
+Yes. `pnpm aisoc:demo` brings up a slim demo stack from prebuilt images in 3-4 minutes on a warm Docker daemon. The full development stack — every microservice plus ClickHouse, OpenSearch, Neo4j, Qdrant — needs ~12 GB RAM and a few minutes more. See [Quickstart](../quickstart).
+
+### Can AiSOC run air-gapped?
+
+Yes. The air-gap deployment pre-stages every container image, every dependency, every rule pack, and the bundled MITRE ATT&CK STIX file. You can run it on a network with zero outbound internet. Trade-offs (hosted OAuth flows, external threat intel, LLM API providers) are documented in [Air-gap operations](./airgap).
+
+### What does it cost to run?
+
+The AiSOC code is free (MIT). Real costs are:
+
+| Component | Driver |
+|---|---|
+| LLM inference | The biggest variable. The autonomous investigator and copilot call OpenAI / Anthropic per case. Self-host a model (Llama, Mistral) and the cost goes to GPU time. |
+| Storage | Postgres + ClickHouse + OpenSearch + Neo4j + Qdrant. ~50 GB / month / 1k EPS at default retention. |
+| Compute | All services together fit in ~6-8 CPU cores and ~16-24 GB RAM under typical mid-market load. |
+| Outbound API calls | Connector polling, threat-intel feeds, ChatOps webhooks. Negligible. |
+
+Most of our public deployments spend more on LLM tokens than on infrastructure. Token costs are visible per-case in the [Investigation Cost Telemetry](../concepts/capabilities#agent-intelligence-2026-h2).
+
+### What are the system requirements?
+
+Minimum, single-host Docker Compose:
+
+| Resource | Minimum |
+|---|---|
+| CPU | 4 cores |
+| RAM | 12 GB (16 GB recommended) |
+| Disk | 50 GB SSD |
+| OS | Linux x86_64 (Ubuntu 22.04+, RHEL 9+) or Docker Desktop on macOS / Windows |
+
+Production: scale `api`, `agents`, `fusion`, `realtime`, and `ingest` horizontally. Each is stateless. Postgres + Kafka + OpenSearch are the stateful tier — clustered as you'd expect. See [Kubernetes deployment](../deployment/kubernetes).
+
+### How does AiSOC scale?
+
+Horizontally where it matters. The hot path:
+
+- `ingest` (Go) — 4 workers handle ~5k EPS per replica. Add replicas as event volume grows.
+- `fusion` — the most CPU-bound service in steady state. Add replicas before everything else.
+- `agents` — each case is one agent run. Replicas split case load across a pool.
+
+Postgres and Kafka are the natural ceiling; both scale predictably under standard tuning.
+
+---
+
+## The AI agent
+
+### Which model does the agent use?
+
+Whichever you configure. `OPENAI_MODEL` (and per-agent overrides) is read at startup. Default is `gpt-4o`. Anthropic Claude works via the agents service's provider abstraction. Self-hosted Llama / Mistral works via OpenAI-compatible endpoints (vLLM, Ollama, llama.cpp server).
+
+### Will the agent do things without my permission?
+
+Only what your **autonomy policy** allows. The policy is per-action and per-tenant: every potentially impactful tool (`endpoint.isolate`, `identity.disable`, `network.block`, `email.purge`) maps to one of `auto / review / escalate / reject`. The default for every destructive action is `review` — analyst must approve in chat or in the UI before the tool runs.
+
+You can also enforce **blast-radius gates** ("never isolate more than 5 hosts in 1 hour") and a **panic stop** that puts the agent into pure-advisory mode globally.
+
+### Will the agent send my data to OpenAI / Anthropic / Google?
+
+Only what you send to the LLM. Every tool call's input and output is logged in the Investigation Ledger so you can see exactly what crossed the boundary.
+
+For regulated environments:
+
+- Use `Azure OpenAI` instead of OpenAI for an enterprise data-handling agreement.
+- Self-host an open-weights model (Llama 3, Qwen, Mistral) — the agent works against any OpenAI-compatible endpoint.
+- Or run the agent in advisory-only mode (every tool call gated to `review`) so an analyst sees exactly what would have been sent before authorizing.
+
+### Can the agent be fooled?
+
+Yes — and we test for it. The eval harness includes an [AI-vs-AI adversary suite](../concepts/capabilities#eval-harness--benchmarking-2026-h2) where a deterministic attacker LLM mutates incidents (synonym swap, leetspeak, zero-width injection, fragmentation) to try to flip the agent's verdict. The graceful-degradation gate requires the agent to retain ≥ 0.85 accuracy under light mutation and ≤ 0.50 *false confidence* under heavy mutation. PRs that regress this gate cannot land.
+
+This is not a guarantee against real-world prompt injection — it's a guarantee that we measure for it on every change.
+
+### What's the "Investigation Ledger"?
+
+A replayable record of every step the agent took on a case: each prompt, each LLM response, each tool called with its inputs and outputs, each evidence citation. You can scrub through it like a DVR, and you can hand it to compliance.
+
+It's also what makes the analyst-override feedback loop work — a verdict overridden by a human is written back as institutional memory so future similar alerts respect that decision. See [Capabilities → Override loop](../concepts/capabilities#agent-intelligence-2026-h2).
+
+---
+
+## Detection content
+
+### Where do detection rules come from?
+
+Three tiers:
+
+1. **Native rules** — ~800 rules authored for AiSOC, in our Sigma-shaped YAML. Tagged `tier: stable`.
+2. **Imported rules** — ~6,000 rules from SigmaHQ, Splunk Security Content, Chronicle, MITRE CAR. Each carries provenance and an upstream link. Tagged `tier: imported`.
+3. **Community contributions** — rules submitted via PR or installed from the marketplace. Tagged by author and license.
+
+All run on the same engine: native YAML over OpenSearch + ClickHouse plus YARA, KQL, EQL, and SPL via federated search.
+
+### Can I write rules in plain English?
+
+Yes. The NL-detection-authoring API converts an English description into Sigma YAML, runs it against historical data, shows the matches and false positives, and lets you iterate. See `/api/v1/nl-detection`.
+
+### How does detection-as-code work here?
+
+Every rule change goes through:
+
+1. **Propose** — PR or `POST /api/v1/detection-proposals`.
+2. **Review** — comments, requested changes.
+3. **Eval-gate** — the proposal carries an eval result. Candidates that regress MITRE accuracy by ≥ 1 percentage point cannot be promoted.
+4. **Promote** — `POST /api/v1/detection-proposals/{id}/promote` writes the rule to `detection_rules` and starts firing it.
+
+This is the same loop CI runs on every PR, so the rule you ship is the rule that was scored. See [Concepts: Detections](../concepts/detections).
+
+---
+
+## Data, privacy, retention
+
+### Where is my data stored?
+
+Wherever you deploy. AiSOC is self-hosted; we don't run a hosted service that holds your security data. Inside an AiSOC deployment:
+
+| Data class | Where |
+|---|---|
+| Connector credentials | Postgres `connector_instances.auth_config`, encrypted by the application-layer Fernet vault |
+| Cases, alerts, audit log | Postgres |
+| Raw event search | OpenSearch + ClickHouse |
+| Evidence files | Object storage (configurable: S3, GCS, MinIO, local FS) |
+| Vector embeddings (RAG memory) | Qdrant |
+| Entity graph | Neo4j |
+| Real-time push subscriptions | Redis |
+
+### How long are events / cases retained?
+
+By default — forever, because most AiSOC users are running on disk they own. To bound retention:
+
+- **Raw events** in OpenSearch / ClickHouse: configurable per-tenant ILM policy.
+- **Cases** in Postgres: archived to cold object storage after a configurable age, soft-deleted from the main DB.
+- **Investigation Ledger**: kept as long as the case is kept. It's the audit primitive.
+- **Audit log**: hash-chained, append-only. Truncating the audit log breaks the chain — by design.
+
+### Does AiSOC handle PII?
+
+It will *see* PII (usernames, emails, IPs, device names) by virtue of being a security tool. AiSOC:
+
+- Never logs plaintext credentials.
+- Redacts secret-typed connector fields before any log line.
+- Tags PII fields in the OCSF event schema so downstream consumers can filter.
+- Supports tenant-scoped data residency — a tenant's data never crosses tenant boundaries even within the same deployment.
+
+For GDPR / CCPA workflows, the audit log surfaces every read/write of identifiable fields with the requesting user and tenant.
+
+### Can I delete a user's data on request?
+
+Yes. `DELETE /api/v1/identity/{user_id}/data` tombstones every alert, case, and event referencing the identity within the requesting tenant, and rewrites the audit log entries to redact the identifier (the audit chain integrity is preserved; only the indexed value is replaced with a tombstone). The action itself is recorded in the audit log.
+
+---
+
+## Integration & ecosystem
+
+### Does AiSOC have an MCP server?
+
+Yes. `@aisoc/mcp` exposes 11 Investigation Ledger tools to MCP-compatible LLM clients (Claude Desktop, Cursor, Continue, Cody) so analysts can replay agent decisions, query cases, and run detection / playbook actions directly from their IDE. See [MCP integration](../integrations/mcp).
+
+### Are there SDKs?
+
+Three:
+
+- **Python** — `pip install aisoc-sdk`. Async first, typed against the OpenAPI spec.
+- **TypeScript** — `pnpm add @aisoc/sdk-ts`. Also typed against the OpenAPI spec.
+- **Go** — `go get github.com/beenuar/AiSOC/packages/sdk-go`.
+
+All three handle auth, retries, pagination, and backoff. See [Plugin SDK overview](../plugins/overview).
+
+### Can I write a plugin?
+
+Yes. Plugins are signed Python or Go packages that ship one or more of: a connector, an enrichment, a detection rule, a playbook, an action. Ed25519-signed publishing through the marketplace. See [Plugin SDK](../plugins/overview).
+
+### Does AiSOC integrate with Jira / ServiceNow?
+
+Yes. We treat ITSM as a *projection* of AiSOC, not the source of truth — the architectural model is documented in [ITSM as projection](../architecture/itsm-as-source-of-truth). In practice that means cases mirror to ITSM with two-way status sync, and ITSM can host approval workflows that gate AiSOC actions.
+
+---
+
+## Project & community
+
+### Is AiSOC really free?
+
+The agent and the platform are MIT-licensed. There are no enterprise-edition feature flags. Hosted OAuth (planned) and a managed Cloud offering may have a paid tier in future, but the self-host package will continue to be free under MIT.
+
+### Who maintains it?
+
+The AiSOC community. The project is hosted at [github.com/beenuar/AiSOC](https://github.com/beenuar/AiSOC). Contribution guidelines are in [contributing/guidelines](../contributing/guidelines). Security advisories are handled privately via GitHub Security Advisories.
+
+### How do I file a bug or feature request?
+
+GitHub Issues. For security vulnerabilities, use a private GitHub Security Advisory — never a public issue.
+
+### How do I contribute a connector?
+
+[Plugin SDK → Publishing](../plugins/publishing). The short version: implement `BaseConnector` in `services/connectors/app/connectors/<name>.py`, declare a `schema()`, register the class in `_CONNECTOR_CLASSES`, ship a marketplace manifest in `plugins/<name>/plugin.yaml`, run `pnpm marketplace:sync`, open a PR.
+
+## Related
+
+- [Adoption consultation questions](./adoption-questions) — the structured walkthrough for security leaders
+- [Quickstart](../quickstart) — get a working instance in under 5 minutes
+- [Architecture](../architecture)
+- [Capabilities](../concepts/capabilities)
+- [Glossary](../glossary)
diff --git a/apps/docs/docs/operations/security.md b/apps/docs/docs/operations/security.md
new file mode 100644
index 000000000..0fac5d27e
--- /dev/null
+++ b/apps/docs/docs/operations/security.md
@@ -0,0 +1,179 @@
+---
+sidebar_position: 2
+title: Security model
+description: How AiSOC handles authentication, authorization, multi-tenant isolation, audit logging, and secrets — the controls operators care about.
+---
+
+# Security model
+
+This page is the operator-facing summary of how AiSOC protects the data flowing through it. If you're evaluating AiSOC for a regulated environment, this is the page to read first; if you're already running it, this is the reference for the controls you have available.
+
+The companion page [Credentials & secrets](./credentials) covers connector-credential encryption in depth. This page covers the rest of the security surface: identity, access, audit, and tenant isolation.
+
+## At a glance
+
+| Control | Mechanism | Scope |
+|---|---|---|
+| **User auth** | Local password (bcrypt), OIDC, SAML 2.0, JWT access + refresh tokens | All web/API traffic |
+| **MFA** | WebAuthn / passkeys (Responder PWA), TOTP for analyst accounts | Per-user |
+| **API auth** | Scoped API keys (`aisoc_<48-hex>`, SHA-256 stored), JWT bearer tokens | Programmatic clients |
+| **Authorization** | Role-Based Access Control (8 built-in roles, fine-grained permissions) | Every endpoint |
+| **Tenant isolation** | Postgres Row-Level Security with `app.current_tenant_id` session variable | Every tenant-partitioned table |
+| **Secret storage** | Fernet (AES-128-CBC + HMAC-SHA256) at the application layer | Connector credentials |
+| **Audit log** | Immutable append-only log with actor, IP, user-agent, request-ID | All write actions |
+| **Plugin verification** | Ed25519 signature verification on plugin manifests | Marketplace + private plugins |
+| **Transport** | TLS terminated at the ingress; service-mesh mTLS optional | All traffic |
+
+## Identity and authentication
+
+### Local accounts
+
+The default install ships with local username/password authentication. Passwords are hashed with **bcrypt** (truncated to bcrypt's 72-byte limit, mirroring passlib's historical behaviour) and stored only as the hash. The verifier is implemented in [`services/api/app/core/security.py`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/core/security.py).
+
+Tokens issued at login:
+
+- **Access token** — short-lived JWT (`ACCESS_TOKEN_EXPIRE_MINUTES`, default 30 min). Carries `sub`, `role`, `tenant_id`, `exp`, `type=access`. Signed with `SECRET_KEY` using `ALGORITHM` (default HS256).
+- **Refresh token** — longer-lived JWT (`REFRESH_TOKEN_EXPIRE_DAYS`, default 7 days). Used only to mint new access tokens.
+
+Rotate `SECRET_KEY` periodically. Doing so invalidates every active session, which is the desired behaviour after a suspected key leak.
+
+### Single Sign-On (SSO)
+
+AiSOC supports two enterprise SSO protocols out of the box:
+
+- **OIDC** — configured via `services/api/app/auth/oidc.py`. Point AiSOC at your IdP's discovery URL, set the client ID/secret, and map IdP groups to AiSOC roles in the role mapping config. Common IdPs tested: Okta, Entra ID (Azure AD), Google Workspace, Auth0.
+- **SAML 2.0** — configured via `services/api/app/auth/saml.py`. Upload your IdP metadata XML or set the `SAML_IDP_METADATA_URL`. Group-to-role mapping uses the same shape as OIDC.
+
+Both providers issue the same internal JWT after authentication, so authorization (RBAC, RLS) works identically regardless of how the user signed in.
+
+### Multi-Factor Authentication
+
+Two MFA paths are available:
+
+- **WebAuthn / passkeys** — implemented in [`services/api/app/api/v1/endpoints/passkeys.py`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/api/v1/endpoints/passkeys.py). Required for the [Responder PWA](../intro) (`/responder/*` route). Passkey-only login means there is no password fallback for on-call responders — you authenticate with the device, biometric, or hardware key the user registered.
+- **TOTP** — standard 6-digit time-based codes for analyst console accounts when SSO is not in use. Backup codes are generated at enrolment and shown once.
+
+Both MFA methods are enforced per-user, configurable per-role: tenant admins can require MFA for any role they choose.
+
+### API keys
+
+For programmatic clients (CI runners, external integrations, scripts) AiSOC issues scoped API keys:
+
+```
+aisoc_<48 hex chars>
+└────┘ └─────────────┘
+prefix 192 bits of entropy
+```
+
+The full key is shown to the user **once**, at creation time. The server stores only the SHA-256 hash and the 12-character prefix (used for display and for routing the key to the right tenant). API keys carry a role and a list of permissions the same way user accounts do, and they appear in the audit log under the actor email of the user who minted them.
+
+Generation logic: [`generate_api_key()` in `services/api/app/core/security.py`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/core/security.py).
+
+## Authorization (RBAC)
+
+Every API endpoint is wrapped in a `require_permission(...)` dependency. Permissions are dot-or-colon strings of the form `<resource>:<verb>` (e.g. `cases:read`, `playbooks:execute`, `lake:query`).
+
+### Built-in roles
+
+Defined in [`ROLE_PERMISSIONS`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/core/security.py):
+
+| Role | Intended user | Notable permissions |
+|---|---|---|
+| `platform_admin` | AiSOC operator (you) | `*` — every permission |
+| `admin` | Demo / dev mode | `*` — same as `platform_admin` (kept aligned to avoid auth drift) |
+| `tenant_admin` | Customer security lead | Full read/write on alerts, cases, playbooks, connectors, users, rules, reports, threat intel, settings, lake |
+| `soc_lead` | SOC manager | Read/write alerts, cases; execute playbooks; manage rules; lake query |
+| `soc_analyst` | Tier-1/Tier-2 analyst | Read/write alerts, cases; execute playbooks; lake query (rate-limited) |
+| `threat_hunter` | Hunt-as-Code author | Read alerts; read/write cases, threat intel, rules; full lake access |
+| `viewer` | Read-only stakeholder | Read alerts, cases, reports, threat intel |
+| `api_service` | Service-to-service token | Read/write alerts and cases; read threat intel |
+
+Wildcards are supported (`*` grants everything). For everything else, the check is exact string match — no implicit hierarchies, no inherited verbs. This is deliberate: it keeps the permission list auditable.
+
+### Custom roles
+
+Custom roles can be defined by inserting rows into the `roles` table with the desired permission list. They are scoped per-tenant; one tenant's `compliance_auditor` does not bleed into another's.
+
+### Permission denied vs. not found
+
+When a user hits an endpoint they don't have permission for, AiSOC returns `403 Forbidden` with the missing permission name in the body. It does **not** return `404` to hide existence — the resource ID is already in the URL the caller chose, so hiding it offers no real protection and complicates support.
+
+## Multi-tenant isolation (RLS)
+
+AiSOC is multi-tenant by design. Every tenant-partitioned table has Postgres Row-Level Security enforced. The migration that sets this up is [`002_rls.sql`](https://github.com/beenuar/AiSOC/blob/main/services/api/migrations/002_rls.sql).
+
+The model:
+
+1. The application layer authenticates the user and resolves their `tenant_id`.
+2. Before issuing any query, the SQLAlchemy middleware sets `SET LOCAL app.current_tenant_id = '<uuid>'`.
+3. RLS policies on every tenant-scoped table (`cases`, `alerts`, `connectors`, `detection_rules`, `api_keys`, `playbooks`, `audit_log`, …) enforce `tenant_id = current_tenant_id()`.
+4. The `FORCE ROW LEVEL SECURITY` flag ensures even the table owner is subject to the policy — there is no superuser escape hatch via the application's DB role.
+
+If `app.current_tenant_id` is not set (e.g. an internal job that needs to operate cross-tenant), the policy permits the query. This is intentional for system-level workers but means **the application-level ORM session must always set the tenant** before serving user requests. The middleware that does this is wired in [`services/api/app/api/deps.py`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/api/deps.py).
+
+The `users` table is excluded from RLS deliberately — it would create a chicken-and-egg problem during authentication. Tenant filtering on `users` is enforced at the application layer through `get_current_user()`.
+
+## Audit logging
+
+Every state-changing API action is appended to an immutable audit log. The schema lives in [`004_audit_log.sql`](https://github.com/beenuar/AiSOC/blob/main/services/api/migrations/004_audit_log.sql), the model in `services/api/app/models/audit.py`, and the helper that emits events in [`services/api/app/services/audit.py`](https://github.com/beenuar/AiSOC/blob/main/services/api/app/services/audit.py).
+
+Each event captures:
+
+| Field | Source |
+|---|---|
+| `tenant_id` | Resolved from the actor's session |
+| `actor_id`, `actor_email` | Authenticated user (or API-key owner) |
+| `actor_ip` | `X-Forwarded-For` (first hop) or `request.client.host` |
+| `action` | Dot/colon string — e.g. `cases:create`, `connectors:delete`, `playbooks:execute` |
+| `resource`, `resource_id` | What was touched |
+| `changes` | Before/after delta JSON |
+| `metadata_` | `user_agent`, `request_id`, and any caller-supplied context |
+| `created_at` | UTC timestamp, set by Postgres |
+
+The log is **append-only**: there is no `UPDATE` or `DELETE` endpoint, and the table has RLS enabled so a tenant can only read their own events. The middleware that auto-populates audit on common write paths is `services/api/app/middleware/audit_middleware.py`; high-value actions (case state transitions, playbook executions, credential rotations) call `emit_audit(...)` explicitly so the `changes` payload is precise.
+
+For SOC 2 / ISO 27001 evidence collection, the [Compliance service](https://github.com/beenuar/AiSOC/blob/main/services/api/app/services/compliance.py) reads from this log directly — there is no separate compliance event store to keep in sync.
+
+## Secrets at rest
+
+Connector credentials are encrypted with Fernet at the application layer before they hit Postgres. The full threat model, key rotation procedure (`MultiFernet` + `AISOC_CREDENTIAL_KEY_ROTATION_FROM`), and the hosted-OAuth roadmap live in [Credentials & secrets](./credentials).
+
+For all other secrets (database URLs, JWT signing keys, Kafka credentials, LLM API keys), AiSOC reads from environment variables. In production, point those env vars at your secret manager of choice — AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault, sealed-secrets, etc. The full list is in [Deployment → Environment variables](../deployment/env-vars).
+
+The two never-commit rules:
+
+1. `SECRET_KEY` and `AISOC_CREDENTIAL_KEY` are not in any committed `.env*` file. They are generated at install time and stored in your secret manager.
+2. The `.env.example` files in the repo contain placeholder values only. CI fails any PR that introduces a live-looking key.
+
+## Plugin trust
+
+Plugins published to the AiSOC marketplace are signed with Ed25519. The publisher generates a keypair, registers the public key in their tenant settings, and signs every release manifest. On install, the API service verifies the signature against the registered public key before executing any plugin code.
+
+Verification entry point: `verify_ed25519_signature()` in `services/api/app/core/security.py`.
+
+If you run private plugins (not from the public marketplace), the same flow applies — register the publisher's public key and AiSOC will refuse unsigned or tampered manifests.
+
+## Network and transport
+
+AiSOC is HTTP-first. The expected production deployment terminates TLS at an ingress (nginx, Envoy, ALB, Cloud Run, …) and forwards plaintext to the API service over a private network. The API trusts `X-Forwarded-For` and `X-Forwarded-Proto` for IP attribution and HTTPS-redirect logic; configure your ingress to strip and replace those headers from external traffic.
+
+For service-to-service traffic between the API, ingest, fusion, and agents, mTLS via a service mesh (Istio, Linkerd, Consul Connect) is the recommended posture. AiSOC does not ship its own mesh.
+
+The ingest service exposes the public `/v1/ingest/batch` endpoint that connectors push into. It requires either a connector-scoped API key or a signed JWT with the `connector` role; raw events from unauthenticated callers are rejected at the gateway.
+
+## Hardening checklist
+
+When you move from `pnpm aisoc:demo` to a production deployment, walk through this list:
+
+- [ ] Rotate `SECRET_KEY` and `AISOC_CREDENTIAL_KEY` to fresh, randomly generated values stored in your secret manager.
+- [ ] Configure SSO (OIDC or SAML) and disable local password login for human users — leave it on only for break-glass platform admins.
+- [ ] Require WebAuthn/passkeys for any role that triggers destructive playbook actions or credential changes.
+- [ ] Confirm `FORCE ROW LEVEL SECURITY` is set on every tenant-partitioned table (verify with `\d+ <tablename>` in `psql`).
+- [ ] Set up an external log sink for the audit log (Splunk, Elastic, Loki) — the in-DB log is the source of truth, but a copy in your SIEM is good practice.
+- [ ] Confirm TLS is terminated at the ingress and that internal traffic is on a private network.
+- [ ] Enable mTLS between services if you're running on Kubernetes with a mesh.
+- [ ] Subscribe to the AiSOC GitHub Security Advisories for vulnerability notifications.
+
+## Reporting a vulnerability
+
+Security issues should be reported privately via [GitHub Security Advisories](https://github.com/beenuar/AiSOC/security/advisories/new), not as public issues. We aim to acknowledge reports within 2 business days and ship a coordinated disclosure with the reporter. The [Contributing guidelines](../contributing/guidelines) cover the full process.
diff --git a/apps/docs/docs/operations/troubleshooting.md b/apps/docs/docs/operations/troubleshooting.md
new file mode 100644
index 000000000..1fac514aa
--- /dev/null
+++ b/apps/docs/docs/operations/troubleshooting.md
@@ -0,0 +1,304 @@
+---
+sidebar_position: 4
+title: Troubleshooting
+description: Common AiSOC errors, where to look, and how to recover — from a stuck connector poll to a wedged Kafka consumer to a silent agent.
+---
+
+# Troubleshooting
+
+Most AiSOC issues fall into a handful of buckets: a service can't reach a dependency, a credential is wrong, a queue is wedged, or an LLM provider is unreachable. This page is the field guide — what symptom maps to which subsystem, where to read the log, and how to recover without paging the whole rotation.
+
+If the symptom is not listed here, the fastest diagnostic is almost always:
+
+```bash
+pnpm aisoc:doctor
+```
+
+It runs an end-to-end health check across ports, containers, demo data, the API, and the WebSocket gateway, and tells you exactly what is red.
+
+---
+
+## First: where logs live
+
+| Surface | Where to look |
+|---|---|
+| Service logs (Docker Compose dev) | `docker compose logs -f <service>` |
+| Service logs (Kubernetes) | `kubectl logs -n aisoc deploy/<service> -f` |
+| Structured app events | All services emit JSON via `structlog` (Python) or `pino` (Node). Pipe to your log aggregator (Loki, Elastic, Datadog, Splunk). |
+| Audit log (every state-changing API call) | UI → **Audit Log**, or `GET /api/v1/audit-log` |
+| Investigation Ledger (every agent decision) | UI → case workspace → **Ledger** tab, or `GET /api/v1/cases/{id}/ledger` |
+| Connector poll history | UI → **Connectors** → click instance → **Run history** tab |
+| Kafka consumer lag | `docker compose exec kafka kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups` |
+| Database health | `docker compose exec postgres psql -U aisoc -c '\l'` |
+
+Every log line carries `tenant_id`, `correlation_id`, and (where relevant) `case_id`, `alert_id`, `connector_id`. Filter by these — never grep raw text in production.
+
+---
+
+## Stack won't start
+
+### `pnpm aisoc:demo` hangs at "waiting for healthchecks"
+
+```
+[demo] Waiting for postgres healthcheck … (still waiting after 120s)
+```
+
+Almost always one of:
+
+1. **Old container state.** Run `pnpm aisoc:demo:down` (which also drops the demo volumes) and try again.
+2. **Port collision.** Postgres `5432`, Redis `6379`, or Kafka `9092` is already bound on the host. Either stop the local service or set `DATABASE_URL`, `REDIS_URL`, `KAFKA_BOOTSTRAP_SERVERS` to non-default ports in `.env` before re-running.
+3. **Docker resource limits.** Compose needs ~6 GB RAM for the slim demo and ~12 GB for the full stack. On Docker Desktop, raise the memory limit in **Settings → Resources**.
+
+### A service container restarts in a loop
+
+Read the last 50 lines of its log:
+
+```bash
+docker compose logs --tail=50 <service>
+```
+
+The four most common causes and fixes:
+
+| Symptom in log | Likely cause | Fix |
+|---|---|---|
+| `connection refused` to `postgres:5432` | The DB hasn't finished initializing yet | Compose `depends_on` retries automatically; if the loop persists for more than 60 s, restart `postgres` and check disk space |
+| `password authentication failed for user "aisoc"` | `.env` overridden after the volume was created | Either match the existing volume credentials or `pnpm aisoc:demo:down` and recreate |
+| `InvalidToken` in API or connectors | `AISOC_CREDENTIAL_KEY` is missing or differs between API and connectors services | Set the same key in both, see [Credentials](./credentials) |
+| `JWT_SECRET must be set in non-development environments` | Ingest service refuses to boot without a real key | Set `JWT_SECRET` in `.env` and restart |
+
+---
+
+## API service
+
+### `/healthz` returns 503
+
+The API healthcheck reports per-subsystem status. A 503 means at least one required subsystem is down. The response body lists which one:
+
+```json
+{ "status": "degraded", "subsystems": { "postgres": "ok", "redis": "ok", "kafka": "down", "opensearch": "ok" } }
+```
+
+Restart only the offending subsystem rather than the whole stack. If you intentionally don't run a subsystem (common in air-gap or minimal deployments), set the matching `AISOC_DISABLE_*` flag — see [Environment Variables](../deployment/env-vars). Endpoints that need the disabled subsystem will return 503 cleanly instead of crashing.
+
+### `401 Unauthorized` on every API call
+
+Three causes, in order of likelihood:
+
+1. **Token expired.** Access tokens default to 30 minutes. The web app refreshes silently; CLI / SDK clients must call `/auth/refresh` themselves.
+2. **`SECRET_KEY` rotated.** Existing tokens were signed with the old key. After any `SECRET_KEY` rotation, all sessions are invalidated by design. Users must re-authenticate.
+3. **Tenant mismatch.** The token is for tenant `A` but the request hit a route scoped to tenant `B`. Decode the JWT (no signature check needed for diagnosis): `python -c "import jwt; print(jwt.decode('<token>', options={'verify_signature': False}))"`.
+
+### `403 Forbidden` despite a valid token
+
+Almost always RBAC. The user has a role, the role lacks the required permission. Check **Settings → Roles** in the UI, or:
+
+```bash
+GET /api/v1/rbac/users/{user_id}/effective-permissions
+```
+
+Permissions are additive across roles; if the permission is missing here, no role grants it.
+
+### Slow API responses
+
+```bash
+docker compose exec api python -c "import asyncio, asyncpg; asyncio.run(...)" # quick DB probe
+```
+
+In practice, when the API gets slow, check three things in order:
+
+1. **Database connection pool.** `DATABASE_POOL_SIZE` defaults to 20. If you have ≥10 simultaneous heavy users, raise to 50 and watch.
+2. **OpenSearch query latency.** `/api/v1/alerts` with broad time ranges and no filters fans out to OpenSearch. Add a tenant or time-range filter, or pre-aggregate.
+3. **Realtime fan-out backlog.** If `realtime` is restarting, the API blocks briefly on internal RPC. Restart `realtime`.
+
+---
+
+## Connectors
+
+### Connector shows `last_run: failed` in the UI
+
+Click into the instance → **Run history** → expand the failed run. The error is captured verbatim from the upstream API.
+
+| Error pattern | Cause | Fix |
+|---|---|---|
+| `401` / `invalid_client` / `invalid_grant` | Upstream credential expired or rotated | Click **Configure**, paste a new secret, **Save** |
+| `403` / `insufficient_scope` | The connector identity doesn't have the required scope/role on the source | Re-check the per-connector setup doc (e.g. [Azure Entra](../connectors/azure-entra), [GitHub](../connectors/github)) — they list the exact scopes |
+| `429` / `rate_limited` | We hit the upstream API rate limit | Increase `connector_config.poll_interval_seconds` for that instance; AiSOC honors `Retry-After` automatically |
+| `Timeout after 30 s` | Upstream is slow or unreachable | Transient — retry on next poll. Persistent → check upstream status page |
+| `InvalidToken` | The vault can't decrypt this instance's `auth_config` | Means `AISOC_CREDENTIAL_KEY` was rotated without running the rewrite step. See [Credentials → Rotation](./credentials) |
+
+### Connector is enabled but `events_added` stays at 0
+
+In order of how often this is the cause:
+
+1. **Source has no new events.** Verify upstream — most APIs have a "view audit events" UI you can compare against.
+2. **Time window starts in the future.** A connector's first poll uses a default lookback (typically 24 h). If the source's clock is skewed or the connector was disabled then re-enabled with a too-recent watermark, you'll get no events. **Manual fix**: click **Configure** → **Reset watermark** → choose a timestamp in the past.
+3. **Polling is paused.** The scheduler is global and pausable via `AISOC_CONNECTORS_DISABLE_SCHEDULER=1`. Make sure that flag is *not* set in production.
+4. **Filters in the connector instance exclude everything.** Some connectors expose a `filter` field — check it.
+
+### Connector polls succeed but alerts don't show up
+
+The pipeline is `Connector → Ingest → Kafka → Fusion → Alerts`. Each hop has visibility:
+
+```bash
+# Did the connector hand events to ingest?
+curl -s http://localhost:8081/internal/metrics | grep ingest_events_received_total
+
+# Did Kafka receive them?
+docker compose exec kafka kafka-console-consumer.sh \
+ --bootstrap-server localhost:9092 --topic security.events --from-beginning --max-messages 1
+
+# Did fusion pick them up?
+docker compose logs --tail=200 fusion | grep "fused_alert"
+```
+
+If ingest received events but Kafka has none → check `KAFKA_BOOTSTRAP_SERVERS` matches between ingest and Kafka. If Kafka has them but fusion ignored them → most likely no detection rule fired (which is normal — most events are not alerts). Check the **Detections** page for active rule count.
+
+---
+
+## Agents (the AI investigator)
+
+### Agent investigation hangs forever
+
+Open the case → **Ledger** tab. The last entry is the diagnostic. The most common patterns:
+
+| Last ledger entry | Cause | Fix |
+|---|---|---|
+| `tool: search_alerts` with no follow-up after 2+ minutes | OpenSearch is unreachable or the query is too broad | Restart `opensearch`; check `OPENSEARCH_URL` |
+| `tool: search_threat_intel` then 30 s gap | Qdrant is unreachable | Check `QDRANT_URL`; restart `qdrant` |
+| `llm: <model>` with no response | OpenAI / Anthropic outage or invalid `OPENAI_API_KEY` | Check the provider status page; rotate the API key if a 401 is in agent logs |
+| Empty ledger after "Investigation started" | Agent crashed before its first tool call | `docker compose logs agents` — almost always a missing `OPENAI_API_KEY` |
+
+There's a manual escape: click **Cancel investigation** on the case to stop the run cleanly. The ledger is preserved.
+
+### Agent says "I don't have enough information"
+
+Two-thirds of the time, this means a connector hasn't fired yet for the relevant identity / host / IOC, so the agent's tools return empty. One-third of the time, RAG memory is empty (Qdrant is fresh) and the agent has no retrievable similar cases. Run `pnpm seed:demo` to populate Qdrant in dev; in production, accept that the first dozen investigations are the agent learning the environment.
+
+---
+
+## Web app
+
+### Login redirects to `/login` immediately after submitting
+
+Almost always cookie / domain mismatch:
+
+1. **`PASSKEY_RP_ORIGINS` doesn't include the URL the browser is actually using.** Localhost over `http://` and `127.0.0.1` over `http://` are *different* origins. Set both.
+2. **`CORS_ORIGINS` doesn't include the web app origin.** API rejects the cookie with no error visible in the UI. Set the env var, restart `api`.
+3. **Browser blocks third-party cookies.** Only matters if you put the API on a different eTLD+1 from the web app. Move them to the same parent domain or set `Strict-Transport-Security` plus `SameSite=None; Secure` on cookies.
+
+### "Realtime disconnected" banner
+
+The web app keeps a WebSocket open to `realtime`. If that drops:
+
+1. **Browser tab was backgrounded for a long time.** Browser killed the socket. The app auto-reconnects within a few seconds.
+2. **`realtime` service is down or restarting.** `docker compose logs realtime`. If it's stuck in `EADDRINUSE` on port 8086, another process is holding it.
+3. **Internal token mismatch.** `realtime`'s `INTERNAL_TOKEN` must equal the API's `REALTIME_INTERNAL_TOKEN`. Mismatch → API calls to push fan out 401, banner shows.
+
+### Push notifications don't arrive on the Responder PWA
+
+In order:
+
+1. The browser must have granted **Notifications** permission. Check via the address bar lock icon.
+2. The PWA must have an active subscription. Check the **Settings → Notifications** screen — it lists the active VAPID subscription per device.
+3. `VAPID_PUBLIC_KEY` (web) and `VAPID_PUBLIC_KEY` (realtime) must match exactly. A trailing newline in the env var will silently break it.
+4. Apple / Android quiet hours can suppress delivery. The Investigation Ledger and Audit Log will still record the push *was sent* even if the OS dropped it.
+
+---
+
+## Detections, alerts, and triage
+
+### A new detection rule never fires
+
+1. **Wrong `logsource`**. The Sigma `logsource` block must match the OCSF category your connector emits. Use the [Connector field reference](../connectors/api-coverage) to confirm.
+2. **Status is `disabled`.** New rules default to `disabled` to avoid noise on import. Enable in the UI before expecting fires.
+3. **Tier filter excludes it.** The Detections page filters by tier (stable / beta / imported / community). Imported rules from SigmaHQ default to the `imported` tier and can look invisible if the filter is set to `stable`.
+4. **`condition` is too restrictive.** Run the rule against historical data: **Detections → click rule → Backtest**. If the backtest shows zero matches over a known-positive window, the condition is wrong, not AiSOC.
+
+### Auto-triage closed an alert you wanted to investigate
+
+The auto-triage agent only auto-closes alerts above a configured confidence threshold *and* when no autonomy gate blocks the action. To recover:
+
+- Click the alert in the **Closed** tab → **Reopen**. Auto-triage will not touch it again on this run.
+- The analyst-override feedback loop captures this correction. See [Capabilities → Override loop](../concepts/capabilities#agent-intelligence-2026-h2). Future similar alerts will respect your verdict.
+- To globally lower autonomy, **Settings → Autonomy Policy** → set `auto_triage_close` to `review` instead of `auto`.
+
+---
+
+## Database / Kafka / search
+
+### `psql` shows healthy DB but the API can't connect
+
+Verify the DSN actually used by the API:
+
+```bash
+docker compose exec api python -c "from app.core.config import settings; print(settings.DATABASE_URL)"
+```
+
+If this prints the default `localhost:5432` from inside the container, your `.env` isn't being loaded into the API service. Check `docker-compose.yml` — every service block needs `env_file: .env` or `environment:` entries.
+
+### Kafka consumer lag keeps growing
+
+```bash
+docker compose exec kafka kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --all-groups
+```
+
+Lag on `aisoc.normalized_events` → fusion is overloaded or stalled. Lag on `aisoc.alerts.fused` → realtime can't keep up, usually because a downstream WebSocket client backed up. Either restart the consumer or scale it horizontally (more replicas of `fusion` / `realtime`).
+
+### OpenSearch shards are red
+
+Run:
+
+```bash
+curl -s http://localhost:9200/_cluster/health?pretty
+```
+
+Red almost always means disk pressure (default flood-stage watermark is 95 %). Free disk space, then:
+
+```bash
+curl -X PUT 'http://localhost:9200/_all/_settings' \
+ -H 'Content-Type: application/json' \
+ -d '{ "index.blocks.read_only_allow_delete": null }'
+```
+
+This unsticks any indices that auto-locked themselves into read-only mode.
+
+---
+
+## Eval harness
+
+### `python scripts/run_evals.py` exits with a regression error
+
+Expected behaviour after a substrate change. The harness compares your branch's score against the saved baseline; a regression on `mitre_accuracy` blocks the PR. Fix paths:
+
+1. **Genuine regression.** Roll back the substrate change or re-tune the affected component (extractor, fusion, judge).
+2. **Intentional improvement that moves the score in either direction.** Update the baseline: `python scripts/update_eval_baseline.py --suite mitre_accuracy`. Commit the new baseline alongside the change.
+3. **Synthetic dataset drift.** The dataset is fixed at 200 incidents; if you edited it, you must update the baseline.
+
+See [Benchmark](../benchmark) for what each suite measures.
+
+---
+
+## When to escalate
+
+If after the above:
+
+- A subsystem keeps crash-looping for more than 10 minutes,
+- The Investigation Ledger shows the agent has been silent for more than 5 minutes on an active P1,
+- Kafka consumer lag exceeds 1 hour and is growing,
+- Or any data integrity error appears (`audit_log` checksum mismatch, `evidence` row missing in ledger reference),
+
+— page the on-call platform owner. Open a GitHub issue with:
+
+- Git SHA running in production (`docker exec api cat /etc/aisoc.version`).
+- Output of `pnpm aisoc:doctor`.
+- Last 200 lines of the offending service log.
+- A correlation_id from a failing request.
+
+Most data-plane issues are caught and explained by `aisoc:doctor` — please run it before opening the issue.
+
+## Related
+
+- [Operations: Credentials](./credentials)
+- [Operations: Air-gap deployments](./airgap)
+- [Operations: Security & access](./security)
+- [Environment Variables](../deployment/env-vars)
diff --git a/apps/docs/docs/operations/upgrades.md b/apps/docs/docs/operations/upgrades.md
new file mode 100644
index 000000000..129084d3d
--- /dev/null
+++ b/apps/docs/docs/operations/upgrades.md
@@ -0,0 +1,129 @@
+---
+sidebar_position: 6
+title: Upgrades & versioning
+description: How AiSOC versions releases, what each digit means, the deprecation policy, and the procedure to upgrade in place.
+---
+
+# Upgrades and versioning
+
+AiSOC follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) on a single shared version across the monorepo. The authoritative version lives in [`VERSION`](https://github.com/beenuar/AiSOC/blob/main/VERSION); every release tag, container image, and SDK package is stamped with the same number.
+
+This page is what you read before running `git pull` against a new release.
+
+## Release cadence
+
+| Channel | Frequency | What's in it |
+|---|---|---|
+| **Patch** (`x.y.Z`) | As needed, often weekly | Bug fixes, security patches, doc fixes. Always backwards compatible. |
+| **Minor** (`x.Y.0`) | ~Every 1–3 weeks | New connectors, new agents, new endpoints. Backwards compatible — your existing config keeps working. |
+| **Major** (`X.0.0`) | When breaking changes accumulate | Schema migrations that require downtime, removed endpoints, renamed env vars. |
+
+Every release ships with a [CHANGELOG.md](https://github.com/beenuar/AiSOC/blob/main/CHANGELOG.md) entry that lists added features, behaviour changes, and any breaking notes. **Read it before upgrading across a major version.**
+
+## What "breaking" means in AiSOC
+
+A change is breaking — and therefore lives in a major release — if any of these apply:
+
+1. An existing REST/GraphQL/WebSocket endpoint changes its request or response shape in a non-additive way.
+2. An environment variable is renamed or its parsing semantics change.
+3. A database migration cannot be rolled back without data loss.
+4. A connector schema changes such that previously valid `auth_config` JSON would be rejected.
+5. A built-in role's permission list is **reduced** (additions are not breaking).
+6. An SDK function signature changes in a non-additive way.
+
+Adding new endpoints, new fields, new connectors, new permissions, or new optional env vars is **not** breaking and ships in minor releases.
+
+## Deprecation policy
+
+When we plan to remove or change something:
+
+1. **Announce in a minor release.** The CHANGELOG calls out the deprecation, the runtime emits a warning log, and the OpenAPI spec marks the endpoint as `deprecated: true`.
+2. **Keep working for at least one full major-version cycle.** If we deprecate a behaviour in 6.3.0 and the next major is 7.0.0, the behaviour still works in every 6.x release.
+3. **Remove in a major release.** The CHANGELOG's "Breaking" section names the removal explicitly and links to the replacement.
+
+If you depend on something marked deprecated, open an issue — sometimes we extend the window.
+
+## Before you upgrade
+
+Run through this list every time:
+
+1. **Read the CHANGELOG** between your current version and the target. Pay attention to anything labelled "Breaking", "Migration", or "Action required".
+2. **Back up your database.** `pg_dump` of the AiSOC schema is the minimum bar. For Kafka- and ClickHouse-backed deployments, snapshot those too.
+3. **Snapshot your `AISOC_CREDENTIAL_KEY`.** If you lose it during the upgrade, every encrypted connector credential in the database becomes unrecoverable. Treat the key the same way you treat your database backup.
+4. **Confirm a maintenance window** for the API service. Migrations run inside a single transaction where possible; minor releases typically take seconds, major releases can take minutes on large `audit_log` tables.
+5. **Stage first.** If you operate a non-production tenant on the same code as production, upgrade it first and let it run for a day before promoting.
+
+## In-place upgrade procedure
+
+The supported upgrade path is "stop, pull, migrate, start". Rolling upgrades across multiple API replicas are safe within a minor release; cross-major rolling upgrades are not supported because the running code may not understand the migrated schema.
+
+```bash
+# 1. Park new traffic at the ingress (return 503 to the API service).
+# 2. Stop the API service replicas. Connectors and ingest can keep running —
+# they tolerate a temporary API outage and back-pressure into Kafka.
+
+cd /opt/aisoc # your install path
+git fetch --tags
+git checkout v6.1.0 # the target tag
+
+# 3. Pull dependencies.
+pnpm install --frozen-lockfile
+(cd services/api && uv sync)
+
+# 4. Run database migrations.
+(cd services/api && uv run alembic upgrade head)
+
+# 5. Start the API service back up.
+docker compose -f docker-compose.dev.yml up -d api
+
+# 6. Verify health and remove the maintenance gate.
+curl -fsS http://localhost:8000/healthz
+```
+
+For Kubernetes deployments, the same flow applies: scale the API deployment to zero, run the migration as a `Job`, then scale back up. The Helm chart in [`infra/helm/`](https://github.com/beenuar/AiSOC/tree/main/infra/helm) exposes this as `helm upgrade --set runMigrations=true`.
+
+## Verifying the upgrade
+
+After a successful upgrade you should be able to:
+
+- Hit `/healthz` and `/readyz` and get `200 OK` with no `degraded` services in the body.
+- Run `aisoc-cli benchmark` (or `pnpm aisoc:benchmark`) and see the same or better numbers as before.
+- Open the analyst console and see the version footer match the new tag.
+- Check `/api/v1/system/version` and see the same number.
+
+If any of those fail, see [Troubleshooting](./troubleshooting) — the upgrade can almost always be rolled back by checking out the previous tag and reverting the last migration with `alembic downgrade -1`.
+
+## Rolling back
+
+Patch and minor releases are designed to roll back cleanly. The procedure mirrors the upgrade:
+
+```bash
+git checkout v6.0.0 # the previous tag
+pnpm install --frozen-lockfile
+(cd services/api && uv sync)
+(cd services/api && uv run alembic downgrade <previous_revision>)
+docker compose -f docker-compose.dev.yml up -d api
+```
+
+Major releases occasionally ship one-way migrations (e.g. column drops). When that's the case, the CHANGELOG flags the migration as "irreversible" and the only rollback is restoring from the database snapshot you took in step 2 of the pre-upgrade checklist.
+
+## Version skew
+
+Within a given major version, the following components are guaranteed to be wire-compatible across one minor version of skew:
+
+- Browser ↔ API service
+- API service ↔ Connectors
+- API service ↔ Agents
+- SDK clients (Go, Python, TypeScript) ↔ API
+
+That means you can upgrade the API service to `6.1.0` while connectors are still on `6.0.x`, finish their rollout over the day, and not break anything. Across a major version (`6.x` ↔ `7.x`) the contract resets — upgrade the API first, then everything else, on the same maintenance window.
+
+## Long-Term Support
+
+AiSOC does not currently offer formal LTS releases. The most recent major version is the supported version; security patches and CVE fixes are backported to the previous major for **90 days** after a new major lands, which is the window we expect operators to need to plan and execute their upgrade.
+
+If your environment requires a longer support window, raise it in [Discussions](https://github.com/beenuar/AiSOC/discussions) — we're happy to discuss commercial support arrangements with the community.
+
+## Pre-1.0 history
+
+Versions `1.0.0` through `5.x` shipped during the original feature build-out and are documented in the [CHANGELOG](https://github.com/beenuar/AiSOC/blob/main/CHANGELOG.md). The `6.0.0` release in May 2026 was the first version we consider production-ready; new deployments should start from the latest `6.x`.
diff --git a/apps/docs/docs/quickstart.md b/apps/docs/docs/quickstart.md
index 39c45f186..ef44defdf 100644
--- a/apps/docs/docs/quickstart.md
+++ b/apps/docs/docs/quickstart.md
@@ -224,13 +224,36 @@ permissions / scopes / role assignments and a troubleshooting section.
## Next Steps
+### Learn the platform
+
- [Architecture deep-dive](./architecture)
+- [Capabilities](./concepts/capabilities) — full feature inventory by tier
+- [Glossary](./glossary) — security and AiSOC-specific terminology
+- [FAQ](./operations/faq) — common questions about scope, deployment, data, and licensing
+
+### Connect data and detections
+
- [Connect your first source](./connectors)
-- [Operations: Credentials](./operations/credentials) — vault, key rotation, hosted-OAuth roadmap
-- [Concepts: Cases & Investigation Ledger](./concepts/cases)
- [Write your first detection rule](./concepts/detections)
- [Build a playbook](./concepts/playbooks)
+- [Concepts: Cases & Investigation Ledger](./concepts/cases)
+
+### Extend AiSOC
+
- [Install a community plugin](./plugins/overview)
- [Connect your IDE via MCP](./integrations/mcp)
- [Run the public eval harness](./benchmark)
+
+### Operate in production
+
- [Deploy to Kubernetes](./deployment/kubernetes)
+- [Operations: Credentials](./operations/credentials) — vault, key rotation, hosted-OAuth roadmap
+- [Security model](./operations/security) — RBAC, MFA/SSO, audit logs, multi-tenant isolation
+- [Upgrades & versioning](./operations/upgrades) — release cadence, deprecation policy, in-place upgrades
+- [Troubleshooting](./operations/troubleshooting) — common errors, log locations, recovery
+
+### Got stuck?
+
+If `pnpm aisoc:demo` failed, healthchecks went red, or migrations didn't run cleanly,
+the [troubleshooting page](./operations/troubleshooting) has runbooks for the most
+common failure modes.
diff --git a/apps/docs/docusaurus.config.ts b/apps/docs/docusaurus.config.ts
index 36fd088f5..45658bdd3 100644
--- a/apps/docs/docusaurus.config.ts
+++ b/apps/docs/docusaurus.config.ts
@@ -42,13 +42,18 @@ const config: Config = {
],
onBrokenLinks: "throw",
- onBrokenMarkdownLinks: "warn",
i18n: {
defaultLocale: "en",
locales: ["en"],
},
+ markdown: {
+ hooks: {
+ onBrokenMarkdownLinks: "warn",
+ },
+ },
+
presets: [
[
"classic",
diff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.ts
index a0e00cb4b..4178d7257 100644
--- a/apps/docs/sidebars.ts
+++ b/apps/docs/sidebars.ts
@@ -10,7 +10,12 @@ const sidebars: SidebarsConfig = {
{
type: "category",
label: "Core Concepts",
- items: ["concepts/cases", "concepts/playbooks", "concepts/detections"],
+ items: [
+ "concepts/capabilities",
+ "concepts/cases",
+ "concepts/playbooks",
+ "concepts/detections",
+ ],
},
{
type: "category",
@@ -49,9 +54,13 @@ const sidebars: SidebarsConfig = {
type: "category",
label: "Operations",
items: [
+ "operations/security",
"operations/credentials",
"operations/airgap",
- "operations/sonali-consultation-questions",
+ "operations/upgrades",
+ "operations/troubleshooting",
+ "operations/faq",
+ "operations/adoption-questions",
],
},
{
@@ -84,6 +93,7 @@ const sidebars: SidebarsConfig = {
label: "Contributing",
items: ["contributing/dev-setup", "contributing/guidelines"],
},
+ "glossary",
],
};