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: the model-placement and metrics work, and three pages that were wrong (#1125)

Beenu Arora3795bac88e8b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf916e60f..2f8fab05f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Documentation
+
+- **Documented the model-placement and metrics work**, and corrected three
+ pages that were teaching something false while doing it.
+
+ New or expanded: the four ways to run the model in the Technical Guide and
+ the quickstart; `GET /llm/runtime` and `POST /llm/credentials/test` with
+ their full outcome tables in the REST reference; the case lifecycle and the
+ reopen route; the `period` parameter and what `alerts.total` now counts.
+
+ Corrected: `concepts/cases.md` documented `open` as a case state, which the
+ `aisoc_cases` CHECK rejects — a reader following it would write a filter
+ that silently matches nothing. `console/funnel-kpis.md` stated the delta
+ contract **backwards** ("signed fractions, not percent"), which is the error
+ the console believed when it rendered `-93.75` as `-9375%`. The ITSM
+ architecture page named a status chain with two states that do not exist.
+
+- **A route in the Technical Guide did not exist.** `POST /api/v1/hunt/search`
+ appears in no schema; the lake is queried at `POST /api/v1/lake/sql`. Found
+ by checking every `/api/v1/` path the guide names against `app.openapi()`
+ rather than reading it. The API totals were stale too (516/416 operations
+ and paths against a real 518/417, `cases` 24 against 25, `detection_rules`
+ 33 against 30).
+
+- **Technical Guide PDF regenerated** at the versions CI pins, and verified by
+ extracting the text back out of the rendered file rather than trusting the
+ byte count: 26 pages, every new section present, the dead route gone, the
+ Cyble credit intact in the footer.
+
### Added
- **Three ways to run the model, and a wizard step that says which is in
diff --git a/README.md b/README.md
index 0e4878c43..c74b71b6d 100644
--- a/README.md
+++ b/README.md
@@ -46,8 +46,8 @@ make up
```
The [Technical Guide](apps/web/public/papers/aisoc-technical-guide.pdf) covers this in depth —
-server sizing, every failure mode with its cause and fix, the REST API, MCP, and a screenshot of
-each console surface.
+server sizing, where the model runs, every failure mode with its cause and fix, the REST API, MCP,
+and a screenshot of each console surface.
Needs Docker Compose v2 with **8 GB memory and 20 GB free disk in the Docker VM**, plus `python3`
(3.9+) and `bash`; `make doctor` checks all of it and
diff --git a/apps/docs/docs/api/rest.md b/apps/docs/docs/api/rest.md
index be7bf2216..372fc7d4a 100644
--- a/apps/docs/docs/api/rest.md
+++ b/apps/docs/docs/api/rest.md
@@ -181,6 +181,7 @@ Re-keying on `(tenant_id, natural_key)` is the proper fix and needs a migration.
|--------|------|-------------|
| `GET/POST` | `/cases` | Case list / create |
| `GET/PATCH/DELETE` | `/cases/{id}` | Case detail / update / close |
+| `POST` | `/cases/{id}/reopen` | Reopen a closed case, with a reason |
| `POST` | `/cases/{id}/comments` | Add comment |
| `POST` | `/cases/{id}/timeline` | Add timeline event |
| `GET/POST` | `/playbooks` | Playbook catalog |
@@ -188,6 +189,26 @@ Re-keying on `(tenant_id, natural_key)` is the proper fix and needs a migration.
| `GET` | `/playbooks/{id}/runs` | Execution history |
| `POST` | `/actions/dry-run` | Simulate an action |
+`PATCH` is **forward-only**. The case state machine
+(`new → triaged → investigating → contained → resolved → closed`) has no
+backward edge, which is what makes "this case was closed" mean something —
+otherwise a title edit that happened to carry a status could walk a case
+backwards silently.
+
+Reopening is therefore its own verb. It requires `cases:write`, takes a
+`reason` of at least 8 characters, increments `reopen_count`, and clears
+`closed_at` / `resolved_at` so the case is not counted as both terminal and
+active. Only `closed` is terminal: `resolved` still has a forward edge to
+`closed`, so it is not reopenable and the route answers `409` saying so.
+
+```bash
+curl -sX POST "$AISOC_API/api/v1/cases/$CASE_ID/reopen" \
+ -H "Authorization: Bearer $AISOC_TOKEN" \
+ -H 'content-type: application/json' \
+ -d '{"reason": "The indicator reappeared on two more hosts overnight.",
+ "status": "investigating"}'
+```
+
### Investigations & Ledger
Every prompt, response, evidence citation, and tool call the AI investigator
@@ -209,6 +230,112 @@ the data model and rationale.
| `GET` | `/copilot/context/{resource_type}/{resource_id}` | Context-aware suggestions for an alert / case / rule / playbook |
| `POST` | `/copilot/actions/{action_id}:run` | Run a suggested action with the right agent tool |
+### AI model & credentials
+
+Where the model runs, and whether the credential pointed at it works.
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `GET` | `/llm/status` | Which provider and model this pod is configured for |
+| `GET` | `/llm/runtime` | Where the local model is **actually** running |
+| `GET/PUT/DELETE` | `/llm/credentials` | The tenant's own provider credential (BYOK) |
+| `POST` | `/llm/credentials/test` | Place one real call with it and report what happened |
+
+`/llm/status` reports *configuration*; `/llm/runtime` reports *outcome*. The
+two differ more often than you would expect: a GPU reservation is a request,
+and a model can still land on the CPU for want of VRAM or a usable driver.
+`/llm/runtime` asks Ollama rather than reading the compose file back.
+
+```json
+{
+ "placement": "gpu",
+ "detail": "llama3.2:3b-instruct-q4_K_M is running on the GPU (2.9 GB in VRAM).",
+ "base_url": "http://ollama:11434",
+ "model": "llama3.2:3b-instruct-q4_K_M",
+ "vram_bytes": 3113851904,
+ "total_bytes": 3113851904,
+ "options": ["Use a hosted provider instead: Settings -> Deployment & AI, or the setup wizard."]
+}
+```
+
+`placement` has five values and **`unknown` is one of them**: Ollama unloads a
+model after a few minutes idle, so an empty answer means nobody has asked it
+anything yet — which is not the same as CPU, and answering CPU there would be
+a guess about the exact thing you are deciding on.
+
+| `placement` | Means |
+|---|---|
+| `gpu` | the whole model is in VRAM |
+| `partial` | split between VRAM and CPU; `detail` says what fraction |
+| `cpu` | entirely on the CPU |
+| `unknown` | no model loaded right now, so it cannot say |
+| `unreachable` | nothing answered — expected on a deployment using a hosted provider |
+
+`vram_bytes` and `total_bytes` are **absent**, not zero, when nothing was
+measured.
+
+#### Testing a credential
+
+The `GET`/`PUT`/`DELETE` routes validate *shape* — that the URL parses, that
+the provider/key/base-URL combination is internally consistent. None of them
+talks to the provider, so a revoked key used to surface as triage quietly
+falling back to the deterministic path.
+
+```bash
+curl -sX POST "$AISOC_API/api/v1/llm/credentials/test" \
+ -H "Authorization: Bearer $AISOC_TOKEN"
+```
+
+```json
+{
+ "outcome": "ok",
+ "detail": "Completed a one-token request against 'gpt-4o-mini' in 412 ms.",
+ "provider": "openai",
+ "model": "gpt-4o-mini",
+ "latency_ms": 412
+}
+```
+
+| `outcome` | Means |
+|---|---|
+| `ok` | the provider answered. A `429` counts: being rate-limited means you reached it and were authenticated |
+| `refused` | reached it and it said no — usually the key, sometimes the model name, which `detail` distinguishes |
+| `unreachable` | nothing answered at that address |
+| `unverified` | air-gapped, so the call was **not attempted** — the policy working, not a bad key |
+
+Requires `settings:write` rather than `settings:read`: it spends the tenant's
+money and touches an external service, which is not a read. The request is one
+token against a fixed prompt.
+
+See [Where the model runs](../operations/where-the-model-runs) for the four
+deployment options these routes report on.
+
+### Metrics
+
+| Method | Path | Description |
+|--------|------|-------------|
+| `GET` | `/metrics/dashboard` | Alert, case and MTTR tiles |
+| `GET` | `/metrics/soc` | SOC KPIs, ATT&CK heatmap, calibration curve |
+| `GET` | `/metrics/funnel` | events → correlations → alerts, with deltas |
+| `GET` | `/metrics/alerts/trend` | Alert volume over time |
+
+All four take `period` — `1h`, `24h`, `7d` or `30d`, defaulting to `24h` —
+and it is the same window the console's global selector sets.
+
+**`alerts.total` is open work, not everything ever received.** It counts
+`new`, `triaging` and `in_progress`; the severity counts beside it are scoped
+the same way, because the console labels them *Active Alerts* and *Critical —
+Require immediate action*. Closed work is reported separately as
+`alerts.resolved`, so narrowing the active tile did not lose the number.
+
+Counts of current state are deliberately **not** windowed. "How many criticals
+are open" is a question about now, and scoping it to the last hour would hide
+the backlog rather than scope it. `period` drives the trend, the funnel and
+the closure figures.
+
+`deltas` on `/metrics/funnel` are **percentages** — `5.0` means +5%, not
++500%. A client that multiplies by 100 again renders `-93.75` as `-9375%`.
+
### Marketplace
The marketplace surface is backed by the JSON index at
diff --git a/apps/docs/docs/architecture/itsm-as-source-of-truth.md b/apps/docs/docs/architecture/itsm-as-source-of-truth.md
index bc40f6298..867e2b083 100644
--- a/apps/docs/docs/architecture/itsm-as-source-of-truth.md
+++ b/apps/docs/docs/architecture/itsm-as-source-of-truth.md
@@ -97,7 +97,7 @@ If a single connector fails, fan-out continues for the rest. The case itself is
## Outbound: status change
-When a case status moves inside AiSOC (`open → triage → contained → resolved → closed`), `case_fanout.fanout_status_change` runs:
+When a case status moves inside AiSOC (`new → triaged → investigating → contained → resolved → closed`, or a [reopen](../concepts/cases#reopening)), `case_fanout.fanout_status_change` runs:
1. Loads every `case_external_refs` row for the case.
2. For each row, instantiates the connector and calls `push_status_change(external_id, new_status)`.
diff --git a/apps/docs/docs/concepts/cases.md b/apps/docs/docs/concepts/cases.md
index ab1138c4b..96d0f1534 100644
--- a/apps/docs/docs/concepts/cases.md
+++ b/apps/docs/docs/concepts/cases.md
@@ -9,7 +9,53 @@ or investigation is tracked as a Case.
## Case States
-`open` → `investigating` → `resolved` | `closed`
+Six states, and the machine is **forward-only**:
+
+```
+new → triaged → investigating → contained → resolved → closed
+ │
+ └──────────────────► resolved
+```
+
+`investigating` can go straight to `resolved` when there was nothing to
+contain. Every other move is one step along the chain, and `PATCH /cases/{id}`
+refuses anything else with a `422` naming the transitions that *are* allowed.
+
+Two states are easy to misread:
+
+- **`resolved` is not terminal.** It means the case has an outcome, not that
+ it has been closed out. It is still on somebody's queue, and treating it as
+ finished is what made "cases closed this week" count the wrong rows. Only
+ `closed` writes `closed_at`, which every duration metric reads.
+- **`open` and `in_progress` are not states.** They belonged to a
+ pre-consolidation vocabulary and the `aisoc_cases` CHECK constraint rejects
+ both. A query filtering on either returns nothing — not an error, just a
+ structurally empty result, which is why these lingered.
+
+### Reopening
+
+Forward-only is what makes "this case was closed" mean something, so there is
+no backward edge in the state machine — a title edit that happened to carry a
+status must not be able to walk a case backwards silently.
+
+"Closed in error" and "it came back" are still real, so reopening is its own
+deliberate act:
+
+```
+POST /api/v1/cases/{id}/reopen
+{ "reason": "The indicator reappeared on two more hosts overnight.",
+ "status": "investigating" }
+```
+
+It needs `cases:write`, requires a reason of at least 8 characters, increments
+`reopen_count`, records `reopened_at`, and clears `closed_at` / `resolved_at`
+so the case is not counted as terminal and active at once. Only `closed` can
+be reopened; `resolved` still has a forward edge, so the route answers `409`
+and tells you to use `PATCH`.
+
+`reopen_count` exists because `reopened_at` is overwritten each time: a case
+reopened four times is a different conversation from one reopened once, and a
+single timestamp cannot tell them apart.
## Case Fields
@@ -18,7 +64,10 @@ or investigation is tracked as a Case.
| `id` | UUID | Unique identifier |
| `title` | string | Short description |
| `severity` | enum | `critical`, `high`, `medium`, `low` |
-| `status` | enum | `open`, `investigating`, `resolved`, `closed` |
+| `status` | enum | `new`, `triaged`, `investigating`, `contained`, `resolved`, `closed` |
+| `reopened_at` | timestamp? | When last reopened. `null` means never — not zero |
+| `reopen_count` | int | How many times. `0` is a real measurement here, unlike the timestamp |
+| `reopen_reason` | string? | Why it was last reopened |
| `mitre_tactics` | string[] | Associated ATT&CK tactics |
| `indicators` | Indicator[] | IOCs linked to the case |
| `playbook_runs` | PlaybookRun[] | Automation runs |
diff --git a/apps/docs/docs/console/funnel-kpis.md b/apps/docs/docs/console/funnel-kpis.md
index e142a8de6..fe82c5a11 100644
--- a/apps/docs/docs/console/funnel-kpis.md
+++ b/apps/docs/docs/console/funnel-kpis.md
@@ -61,6 +61,24 @@ Three bars, all clamped to `[0, 1]` so the visualization never overflows:
The `EfficiencyReport` and `FunnelKpiBar` deliberately share an SWR cache key (`funnel-metrics:<period>`) so both widgets de-dupe on a single call to `GET /api/v1/metrics/funnel`.
+### The period comes from the global selector
+
+The window selector in the console header drives these tiles, and
+`/metrics/dashboard` and `/metrics/soc` alongside them. It used to drive
+nothing: `useTimeWindow()` had no data-fetching consumers at all, the
+dashboard's SWR key was a constant string, and `period="24h"` was hardcoded
+into both widgets — so changing the window re-rendered a header and refetched
+nothing.
+
+The window is part of the cache key, which is the half that is easy to miss:
+passing the period to the fetcher alone is not enough, because SWR serves one
+entry per key and a constant key means every window shares one cached answer.
+
+The SOC Insights page has no 1-hour window, so a global `1h` is clamped to
+`24h` **and the clamp is shown**. Rendering a day of data under a header
+reading "1h" would be a quietly wrong number, which is worse than a note
+saying what happened.
+
## `PipelineHealth` — five stages, four statuses
The rail mirrors the data path end-to-end:
@@ -148,7 +166,8 @@ Key implementation notes (`services/api/app/api/v1/endpoints/metrics.py`):
- `events_of_interest` reads from ClickHouse `aisoc.raw_events` when the lake is enabled, with a Postgres-only fallback (alerts table count) for air-gapped deployments where `AISOC_DISABLE_CLICKHOUSE=1`.
- `mttd_seconds` reuses the exact same `AVG(EXTRACT EPOCH FROM (created_at - first_seen_at))` expression as the existing SOC metrics endpoint so the two never disagree.
- `signal_to_noise` is `1 − (FP count / total dispositioned)` — alerts with `disposition` in `false_positive` divided by alerts with any disposition. Returns `0.0` when there is no dispositioned alert (no work done yet).
-- Deltas are signed fractions, not percent: `0.05` means +5%. The previous-period window is the same duration immediately before the current one.
+- **Deltas are signed percentages, not fractions: `5.0` means +5%.** `_pct_delta` multiplies by 100 and rounds to two decimals before returning, so a run that fell from 160 events to 10 sends `-93.75`. This page said the opposite for several releases and the console believed it, multiplying by 100 a second time and rendering `-9375%` on the first tile of the dashboard. Scale comes from the contract, never the magnitude — a real +1% delta and a fraction of `1.0` are the same number, so "it looks small, it must be a fraction" is a guess that is right until it is catastrophically not.
+- A delta of exactly `0.0` means **no meaningful baseline** (the previous window was empty), not "no change". The previous-period window is the same duration immediately before the current one.
- `deltas` covers the six tiles only. The suppression and triage-quality fields have no delta, because a period-over-period change in, say, `mean_groundedness` reads as a trend when it is usually a change in which alerts happened to arrive.
- The field list on this page is gated: `scripts/check_funnel_contract.py` compares it against the keys the endpoint actually returns, so a field cannot ship undocumented again.
diff --git a/apps/docs/docs/operations/llm-gateway.md b/apps/docs/docs/operations/llm-gateway.md
index eb84703f8..b11e6f84b 100644
--- a/apps/docs/docs/operations/llm-gateway.md
+++ b/apps/docs/docs/operations/llm-gateway.md
@@ -11,6 +11,20 @@ contextual copilot, summaries, reports, and natural-language generation. The
workloads make. AiSOC asks for a **logical task alias**; the gateway decides
which real provider and model that alias resolves to.
+:::tip Choosing where the model runs
+
+This page is about the **gateway** — which provider and model requests are
+routed to. Where that model physically executes (CPU, an NVIDIA GPU, a host
+Ollama using Apple's Metal, or someone else's datacentre) is a separate
+decision with its own page: [Where the model runs](./where-the-model-runs).
+
+`GET /api/v1/llm/status` answers the first question and
+`GET /api/v1/llm/runtime` answers the second. They disagree more often than
+you would expect, because a GPU reservation is a request rather than a
+guarantee.
+
+:::
+
```
AiSOC task ──▶ alias (e.g. "aisoc-triage") ──▶ LiteLLM ──▶ real model
```
diff --git a/apps/docs/docs/operations/where-the-model-runs.md b/apps/docs/docs/operations/where-the-model-runs.md
index df17347a2..af7b69f69 100644
--- a/apps/docs/docs/operations/where-the-model-runs.md
+++ b/apps/docs/docs/operations/where-the-model-runs.md
@@ -124,6 +124,18 @@ Before this existed, the routes validated only *shape*, so a revoked key
surfaced as triage quietly falling back to the deterministic path — a failure
that is hard to attribute to a credential precisely because it is silent.
+The same check from the API:
+
+```bash
+curl -sX POST localhost:8000/api/v1/llm/credentials/test \
+ -H "Authorization: Bearer $TOKEN"
+```
+
+It places one token against a fixed prompt, so it costs essentially nothing
+and is safe to run from a health check. See the
+[REST reference](../api/rest#testing-a-credential) for the full response
+shape.
+
## Checking what is actually running
A GPU reservation is a *request*. A model can still land on the CPU for want of
@@ -135,8 +147,9 @@ curl -s localhost:8000/api/v1/llm/runtime -H "Authorization: Bearer $TOKEN"
docker compose exec ollama ollama ps # SIZE and the GPU/CPU split
```
-The wizard shows the same thing. Five answers, and **not loaded right now** is
-one of them: Ollama unloads after a few minutes idle, so an empty answer means
+The wizard shows the same thing, and so does the
+[REST reference](../api/rest#ai-model--credentials). Five answers, and **not
+loaded right now** is one of them: Ollama unloads after a few minutes idle, so an empty answer means
nobody has asked it anything yet — which is not the same as CPU, and reporting
CPU there would be a guess about the exact thing you are deciding on.
diff --git a/apps/docs/docs/quickstart.md b/apps/docs/docs/quickstart.md
index 787fd3e39..d78c486ea 100644
--- a/apps/docs/docs/quickstart.md
+++ b/apps/docs/docs/quickstart.md
@@ -271,6 +271,27 @@ left the default install routing a key nobody had
- **If no model is reachable at all**: every alert takes the deterministic
path and the console labels it as such. Nothing pretends the AI ran.
+**Where that model runs is a separate choice**, and `make up` takes the one
+that works everywhere: CPU. Three alternatives:
+
+| | Command | Works on |
+|---|---|---|
+| NVIDIA GPU | `make up-gpu` | Linux, Windows + WSL2 |
+| An Ollama you already run | `make up-host-llm` | everything, and the **only** GPU route on a Mac |
+| A hosted provider | configured in the console | everything |
+
+`make doctor` says which fits the host you are on, and
+`GET /api/v1/llm/runtime` says which is in effect right now — asking Ollama
+rather than reading the compose file back, because a GPU reservation is a
+request and a model can still land on the CPU.
+
+On Apple Silicon `make up-gpu` cannot help: Docker Desktop does not pass the
+Metal GPU into a Linux container, so a container there is CPU-only whatever is
+reserved. A natively-installed Ollama does use Metal, which is what
+`make up-host-llm` points at. The preflight says this rather than letting you
+find out slowly. Full detail: [Where the model
+runs](./operations/where-the-model-runs).
+
### Database migrations — nothing to run
Every schema is applied by the stack itself; there is no manual migration
diff --git a/apps/web/content/papers/aisoc-technical-guide.md b/apps/web/content/papers/aisoc-technical-guide.md
index 78d2728b5..462120f48 100644
--- a/apps/web/content/papers/aisoc-technical-guide.md
+++ b/apps/web/content/papers/aisoc-technical-guide.md
@@ -76,6 +76,77 @@ connector / ingest API
CORE is not a demo. It runs the real pipeline and a real local model; what it
leaves out is the stores that only matter once you have volume.
+### Where the model runs
+
+A model ships with AiSOC and runs on CPU, which is why `make up` needs no
+account, no key and no GPU. It is also the slowest of four options.
+
+| Option | Command | Works on |
+|---|---|---|
+| Bundled model, CPU | `make up` | everything |
+| Bundled model, NVIDIA GPU | `make up-gpu` | Linux, Windows + WSL2 |
+| An Ollama you already run | `make up-host-llm` | everything, and the **only** GPU route on a Mac |
+| A hosted provider | configured in the console | everything |
+
+`make doctor` tells you which fits the host you are on. The first-run wizard's
+**Choose where the AI runs** step tells you which is in effect right now.
+
+**The GPU reservation is an overlay, not a line in the base compose file**, and
+that is deliberate rather than tidy. A host without an NVIDIA GPU *and* the
+container toolkit cannot start a service that reserves one — the daemon
+answers `could not select device driver "nvidia"` and refuses — so putting it
+in `docker-compose.yml` would take out first run for every Mac, every CPU-only
+Linux box and every CI runner.
+
+`make up-gpu` runs `scripts/check_gpu_runtime.py` first, which exists because
+the daemon's own error names neither a cause nor a next command. The preflight
+distinguishes a missing card, driver, toolkit and daemon configuration, and
+names the install step for whichever is absent.
+
+**On Apple Silicon, `make up-gpu` cannot help and the preflight says so.**
+Docker Desktop does not pass the Metal GPU into a Linux container — no toolkit,
+driver or setting changes that, so a container on a Mac is CPU-only whatever is
+reserved. A natively-installed Ollama *does* use Metal:
+
+```bash
+brew install ollama
+OLLAMA_HOST=0.0.0.0 ollama serve # in its own terminal
+ollama pull llama3.2:3b-instruct-q4_K_M
+make up-host-llm
+```
+
+`OLLAMA_HOST=0.0.0.0` matters: Ollama binds loopback by default, which a
+container cannot reach.
+
+`make up-host-llm` is worth running even without a GPU. `11434` is in the
+managed port inventory, so on a host already running Ollama, `make up` sees the
+conflict and republishes the *bundled* one on a free port — leaving you with
+two Ollamas, the stack talking to the new one, and yours idle.
+
+#### Checking what is actually running
+
+A GPU reservation is a **request**. A model can still land on the CPU for want
+of VRAM or a usable driver, so reading the compose file back would report the
+intent and call it the outcome. Ask instead:
+
+```bash
+curl -s localhost:8000/api/v1/llm/runtime -H "Authorization: Bearer $TOKEN"
+docker compose exec ollama ollama ps # SIZE and the GPU/CPU split
+```
+
+Five answers, and **not loaded right now** is one of them: Ollama unloads after
+a few minutes idle, so an empty answer means nobody has asked it anything yet.
+That is not the same as CPU, and reporting CPU there would be a guess about the
+exact thing you are deciding on.
+
+| `placement` | Means |
+|---|---|
+| `gpu` | the whole model is in VRAM |
+| `partial` | split; `detail` says what fraction, which explains the latency |
+| `cpu` | entirely on the CPU |
+| `unknown` | nothing loaded, so it cannot say |
+| `unreachable` | nothing answered — expected on a hosted-provider deployment |
+
---
## 2. Workstation install
@@ -155,6 +226,10 @@ is not zero, and publishing it as zero would claim instant resolution.*
| Services restart-loop | Not enough memory for `full` | Use `make up` (CORE) and raise Docker's allocation before retrying |
| `credential vault unavailable` saving a connector | `AISOC_CREDENTIAL_KEY` is set to something that is not a valid Fernet key | `make env` generates a real one, then `docker compose up -d api` |
| `make doctor` shows 22 red checks | You have not run `make up` yet | Run it. `doctor` says this explicitly rather than listing failures |
+| `make doctor` warns that Ollama holds 11434 | You already run Ollama | Not a problem. `make up-host-llm` uses yours instead of starting a second one; `make up` republishes the bundled one on a free port |
+| `make up-gpu` refuses before compose starts | The NVIDIA container toolkit is missing, or this is a Mac | The preflight names which of the four pieces is absent. On Apple Silicon no install helps — use `make up-host-llm` |
+| Triage is slow | The model is on CPU, which is the default | `GET /api/v1/llm/runtime` confirms it. `make up-gpu`, `make up-host-llm`, or a hosted provider |
+| AI verdicts stopped after adding a provider key | The key is wrong, revoked, or names a model the account cannot use | **Settings → Deployment & AI → Test.** It distinguishes a bad key from a wrong model name, which are different fixes |
### Windows
@@ -373,11 +448,51 @@ What the agent does and does not do:
lookups. The model picks the tool and passes arguments; it never writes SQL.
- **Everything is logged** to the Investigation Ledger: prompts, tool calls,
citations, verdict, token cost. It exports as a signed bundle.
-- **Grounding is checked.** A verdict citing an indicator the evidence never
- contained is demoted to human review rather than auto-closed.
+- **Grounding is checked on both paths.** A verdict citing an indicator the
+ evidence never contained is demoted to human review rather than auto-closed.
+ On the investigation path — the one you launch deliberately — nothing
+ auto-closes, so the intervention is different: the reported confidence drops
+ to the measured groundedness and a caveat naming the unsupported indicators
+ is written into the summary you read.
- **No vendor is touched without a human**, unless a tenant has explicitly
granted autonomy for that verb.
+The gate **refuses to score an empty evidence set**, and reports
+`groundedness: null` rather than `0.0`. The distinction is the whole point: a
+case opened by hand carries no telemetry, every indicator the model mentions
+would read as unsupported, and a gate that scored anyway would demote
+everything while appearing to catch hallucination. `null` means not measured;
+`0.0` means measured and nothing was supported.
+
+### Using your own provider
+
+Seven providers are supported — `openai`, `anthropic`, `azure-openai`,
+`local-ollama`, `local-vllm`, `local-litellm`, `custom`. Configure one per
+tenant in **Settings → Deployment & AI**, or from the first-run wizard. The key
+is encrypted at rest with the credential vault and never returned by the API;
+reads report only `has_api_key`.
+
+**Test it before you rely on it.** The *Test* button places one real one-token
+completion and reports what happened:
+
+```bash
+curl -sX POST localhost:8000/api/v1/llm/credentials/test \
+ -H "Authorization: Bearer $TOKEN"
+```
+
+| Outcome | Means |
+|---|---|
+| `ok` | the provider answered. A `429` counts — being rate-limited means you reached it and were authenticated |
+| `refused` | reached it and it said no. `detail` distinguishes a bad key from a wrong model name, which are different fixes |
+| `unreachable` | nothing answered at that address |
+| `unverified` | air-gapped, so the call was **not attempted** — the policy working, not a bad key |
+
+Before this existed, the credential routes validated only *shape* — that the
+URL parses, that the provider/key/base-URL combination is consistent — and none
+of them talked to the provider. A revoked key surfaced as triage quietly
+falling back to the deterministic path, which is a failure that is hard to
+attribute to a credential precisely because it is silent.
+
### Threat intelligence
![The CISA KEV catalogue](apps/web/public/screenshots/threat-intel-kev.png)
@@ -417,6 +532,39 @@ much of the product as the populated view.*
where the engine has no durable pause — a step that cannot suspend should not
be offered.*
+### The case lifecycle
+
+Six states, and the machine is forward-only:
+
+```
+new → triaged → investigating → contained → resolved → closed
+ │
+ └──────────────────► resolved
+```
+
+Two readings catch people out. **`resolved` is not terminal** — it means the
+case has an outcome, not that it has been closed out; only `closed` writes
+`closed_at`, which every duration metric reads. And **`open` is not a state**:
+it belonged to a pre-consolidation vocabulary and the database rejects it, so
+a filter naming it returns nothing rather than erroring, which is why it took
+a while to notice.
+
+Forward-only is deliberate. It is what makes "this case was closed" mean
+something, and without it a title edit that happens to carry a status could
+walk a case backwards silently. So reopening is its own act, with its own
+record:
+
+```bash
+curl -sX POST "localhost:8000/api/v1/cases/$CASE_ID/reopen" \
+ -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' \
+ -d '{"reason": "The indicator reappeared on two more hosts overnight."}'
+```
+
+It requires a reason, increments `reopen_count`, and clears `closed_at` and
+`resolved_at` so a case cannot be counted as terminal and active at once.
+`reopen_count` exists because `reopened_at` is overwritten each time — a case
+reopened four times is a different conversation from one reopened once.
+
### Honest empty states
![No cases](apps/web/public/screenshots/cases-empty.png)
@@ -432,7 +580,7 @@ investigation.*
## 6. The REST API
-**516 operations across 416 paths.** The specification is
+**518 operations across 417 paths.** The specification is
`docs/openapi.yaml` in the repository, regenerated on every change and gated
against breaking changes in CI.
@@ -454,23 +602,36 @@ TOKEN=$(curl -s -X POST http://localhost:8000/api/v1/auth/login \
| Create a case | `POST /api/v1/cases` |
| Launch an investigation | `POST /api/v1/cases/{id}/investigate` |
| Poll an investigation | `GET /api/v1/cases/{id}/investigations/{run_id}` |
-| Query the lake | `POST /api/v1/hunt/search` |
+| Query the lake | `POST /api/v1/lake/sql` |
| Propose a detection | `POST /api/v1/detection-proposals` |
| Configure SSO | `POST /api/v1/sso-connections` |
-
-One contract detail that costs people time: `GET /api/v1/alerts` returns the
-array under **`items`**, not `alerts`.
+| Reopen a closed case | `POST /api/v1/cases/{id}/reopen` |
+| Where the local model is running | `GET /api/v1/llm/runtime` |
+| Test the tenant's provider credential | `POST /api/v1/llm/credentials/test` |
+| Dashboard tiles for a window | `GET /api/v1/metrics/dashboard?period=7d` |
+
+Two contract details that cost people time:
+
+- `GET /api/v1/alerts` returns the array under **`items`**, not `alerts`.
+- On `/metrics/dashboard`, **`alerts.total` is open work, not everything ever
+ received.** It counts `new`, `triaging` and `in_progress`, and the severity
+ counts beside it are scoped the same way, because the console labels them
+ *Active Alerts* and *Critical — Require immediate action*. Closed work is
+ reported separately as `alerts.resolved`. Period-over-period `deltas` on
+ `/metrics/funnel` are **percentages** — `5.0` means +5%, and a client that
+ multiplies by 100 again renders `-93.75` as `-9375%`.
### Groups worth knowing about
| Tag | Operations | What it covers |
|---|---|---|
-| `detection_rules` | 33 | The rule catalogue, tuning, proposals, backtesting |
| `mssp` | 33 | Child tenants, portfolio views, cross-tenant overrides |
-| `cases` | 24 | Cases, tasks, comments, evidence, investigations |
+| `detection_rules` | 30 | The rule catalogue, tuning, proposals, backtesting |
+| `cases` | 25 | Cases, tasks, comments, evidence, investigations, reopen |
| `scim` | 21 | SCIM 2.0 user and group provisioning |
| `graph` | 14 | Entity graph traversal, blast radius, context import |
| `connectors` | 13 | Catalogue, instances, test-connection, scheduling |
+| `llm` | 6 | Provider configuration, where the model runs, credential testing |
### Rate limits and errors
diff --git a/apps/web/public/papers/aisoc-technical-guide.pdf b/apps/web/public/papers/aisoc-technical-guide.pdf
index 4591f20cb..671530388 100644
Binary files a/apps/web/public/papers/aisoc-technical-guide.pdf and b/apps/web/public/papers/aisoc-technical-guide.pdf differ
diff --git a/apps/web/public/papers/render-manifest.json b/apps/web/public/papers/render-manifest.json
index 1e8e53015..01231bf6d 100644
--- a/apps/web/public/papers/render-manifest.json
+++ b/apps/web/public/papers/render-manifest.json
@@ -1,6 +1,6 @@
{
"sources": {
- "aisoc-technical-guide.md": "c391d60080f0d2b06132f3154ef60cf8cc553401e1a346c41e7d46cb0731c7f7",
+ "aisoc-technical-guide.md": "7965cab62a6c72ca44fa123da3262faad931a50bacea1baebad699f8200f8d8e",
"l0-l4-automation-maturity.md": "4da4b02d8e7b6d2839a593f09303191cd71c6b9ef28b34555a1a2086cf4c8781"
}
}