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.

1.4 KB
Raw Blame
-- Migration 041: SOC console parity — alert correlation narrative
-- Implements W6 (structured InvestigationRail) from the v1.5 SOC Console
-- Parity plan.
--
-- Changes:
--   alerts.narrative (TEXT, nullable) — a deterministic, human-readable
--   correlation narrative cached on the alert. Generated by the fusion
--   service at correlate-time and refreshed by the API at read-time when
--   missing or stale. The InvestigationRail surfaces this verbatim so the
--   right pane renders instantly without an LLM round-trip; the
--   on-demand `ExplainDrawer` (renamed "Deep Explain" in the rail) still
--   provides the streaming LLM explanation when an analyst wants more.
--
-- Backfill: leave narrative NULL on existing rows. The API layer will
-- compute and cache narrative lazily on first read of an alert, so
-- legacy rows pick it up the moment an analyst opens them.
--
-- Idempotent — safe to re-run.

BEGIN;

ALTER TABLE alerts
    ADD COLUMN IF NOT EXISTS narrative TEXT;

COMMENT ON COLUMN alerts.narrative IS
    'Deterministic correlation narrative cached at fusion time. '
    'NULL means "not yet computed"; the API will lazily compute and '
    'persist on first read of the alert. Surfaced verbatim by the '
    'InvestigationRail. For the streaming LLM explanation, see the '
    'Deep Explain action which goes through /api/v1/alerts/{id}/explain.';

COMMIT;