AISOCin‑a‑box

Architecture Deep Dive

The four interactive diagrams of the reference architecture, plus the narrative that ties them to the code and the spec. (For the animated, full-screen version of the whole map — the day in the life and the ten-stop tour — see the architecture explorer.) Every claim below is one of three things: enforced today (in the reference stack, with the test or config that proves it), contract (in the frozen §4.5 OpenAPI or a committed schema), or spec (in docs/spec/LWL-32-architecture-spec.md, not yet built — said so explicitly).

Normative source of truth: docs/spec/LWL-32-architecture-spec.md ("the spec"). The standalone architecture overview is the shorter §1–§4 distillation; this page is the depth layer.

customer network — sovereign boundary vendor cloud — control plane outbound-only seam TunnelFrame / gRPC over mTLS (dial-out) Telemetry sources endpoints · identity · SaaS · network Vector (MPL-2.0) ECS pipeline → PII redaction → ES sink Edge Elasticsearch raw ECS tier — data never leaves the box Edge Agent (Go) tunnel supervisor · detection · spool OPA sidecar (edge veto) re-evaluates every cloud request — 2nd gate Tunnel Gateway cert SAN → tenant · session · replay Control-plane API FastAPI · RLS tenant scope per request Agent Orchestrator LangGraph triage · LLM router · OPA gate PostgreSQL shared schema · RLS on every table Central ES alert metadata + cases only Audit chain hash-chained · WORM · self-verifying Portal (Next.js) six personas · BFF mints 60 s JWTs Concierge vendor humans OIDC IdP portal authn (MFA) local · loopback ≤ 2 s ingest lag budget rule fires → alert doc directive re-checked before any provider call ingest → case → triage run verdict → autonomy gate RLS-scoped tx alert idx + cases write-before-execute REST + WS personas sign-in
Hover a node to preview it; click for the evidence.

System context — the sovereign boundary. The customer network owns the raw data; the vendor cloud owns the control plane; the only thing between them is an outbound-only tunnel seam. The nodes that carry the invariants:

  • Edge Elasticsearch is the raw tier — it physically never leaves the box. The cloud sees alert metadata pushed to it and ≤ 200-row ES|QL results fetched back (§1.3, §3.5).
  • OPA appears twice — the cloud bundle gates what may be dispatched, the (Phase 1) edge bundle vetoes it locally. A compromised cloud cannot make the edge do anything the edge's own policy forbids (§3.3.1). The cloud bundle is live in this repo: apps/agent-orchestrator/policies/.
  • Audit chain — hash-chained per tenant, audit-before-execute, self-verifying on read (§3.4). Implementation: apps/agent-orchestrator/src/orchestrator/audit_chain.py.
customer box — raw tier + detection (steps 1–4) vendor cloud (steps 5–10) ≤ 2 s ingest lag local rule eval RTT + 1 s spool 24 h if tunnel down at-least-once open case median < 90 s p95 < 4 min (2 queries) OPA verdict tier + blast radius receipt → close 01 Raw telemetry event endpoint · identity · SaaS · network 02 Vector pipeline ECS normalize → PII redaction 03 Edge Elasticsearch raw tier — stays on the box 04 Detection rule fires Sigma-compiled + ES|QL hunts 05 Tunnel push AlertMetadataPush redaction-checked 06 Ingest + case alert idx · dedupe · case open 07 LLM triage hunt → RAG → verdict 08 Autonomy gate OPA · verdict + evidence 09 HITL or autonomous approval wait · MFA hard bool 10 Close case receipt · timeline · audit degraded modes — the pipeline never loses data, it changes who decides Tunnel down edge-autonomous: detect locally, alert customer's own channels, spool pushes; directives expire, none accepted Cloud down local logging + local containment via the customer's own console keep working; triage pauses, nothing is lost Gate / OPA failure fail closed: unreachable OPA, bad decision, failed audit append → case parks at escalate_to_analyst. No action runs.
Hover a step to preview it; click for the evidence.

Data flow — one alert's path, hop by hop: edge detection → Vector (normalize → redact → sink) → AlertMetadataPush across the seam → control-plane ingest (dedupe by (tenant, local_alert_id)) → LangGraph triage run (hypothesis → ESQL context hunt → enrichment → verdict) → autonomy gate (OPA) → autonomous action or HITL approval → finalize. Numbered hops carry the budget that makes the run bounded (§3.2): replan count ≤ 2, ES|QL calls ≤ 5 per run, LIMIT ≤ 200 rows, LLM timeout 120 s. The graph's full state schema and node list are llm-triage.md.

vendor cloud — one shared control plane outbound-only seam 1 · single box — the reference deploy (§2.3 basic tier) 2 · HA pair — active / standby on one /126 (§1.2.1) 3 · multi-tenant — N customer networks, one plane (§1.3) the box — customer hardware Vector ECS + redaction Edge ES raw tier, 30 d Edge Agent (Phase 1) tunnel · spool · detection TunnelFrame / gRPC over mTLS (dial-out) box A — active (.2) Vector + Edge ES ingest + raw tier serves EsqlDispatch box B — standby (.3) Vector + Edge ES spool replay 24 h dedupe on re-push both boxes dial out — the plane is the only stateful side failover: spool replay; (tenant, local_alert_id) dedupe (§1.4 step 2) tenant A — own hardware box + raw tier cert spiffe://…/tenants/tnt_A tenant B — own hardware box + raw tier cert spiffe://…/tenants/tnt_B identity is the certificate, not the payload (§1.2.1) tenancy enforced by RLS + writer binding — not by app if-checks Tunnel Gateway cert → tenant · dedupe · replay Control-plane API RLS tenant scope per request Agent Orchestrator LangGraph · OPA gate · LLM OPA (cloud) §3.3 gate, bundle sha PostgreSQL shared schema · RLS Central ES alert metadata only Audit chains one hash chain per tenant Box sizing (§2.3): 8 vCPU · 32 GB · 1 TB NVMe · 30-day raw tier plane scales per-tenant; boxes scale per-EGress… per-ingest-rate
Hover a node to preview it; click for the evidence.

Deployment topology — the three shapes the spec commits to (the tab state deep-links, e.g. #ha-pair):

The reference deploy. In the compose stack this is the edge/ services (Vector 0.47.0 + single-node ES, §2.1/§2.2); the Edge Agent and the real tunnel are the Phase 1 gap, and the stack says so loudly (SimulatedTunnel, simulated_tunnel: true in every fabricated receipt).

Active .2 / standby .3 on a /126 overlay (§1.2.1). Both boxes dial out; the plane is the only stateful side; failover is spool replay made idempotent by the unique (tenant, local_alert_id) index (§1.4 step 2 — implemented in apps/control-plane-api/src/soc_api/routers/ingest.py).

N customer networks onto one control plane. Tenancy is not an if-check: it is RLS + writer binding + per-tenant audit chains (§1.3). Full walkthrough: multi-tenancy.md.

customer network — untrusted inputs the box — sovereign boundary vendor cloud — control plane the single crossing — outbound-only Telemetry sources endpoints · identity · SaaS NEVER CROSSES THE SEAM · raw telemetry / log bodies · secrets, credentials, keys · PII — redacted at the edge · customer identifiers beyond the redaction profile · full LLM prompts — the audit chain stores the redacted form Vector ECS → redact (gdpr-standard) → sink Edge Elasticsearch raw tier — physically on customer hardware Edge Agent (Phase 1) tunnel dial-out · spool · signs dispatches Edge OPA (Phase 1) re-vetoes every cloud request — 2nd gate ① AlertMetadataPush (redacted metadata + redaction digest) ② EsqlDispatch (read-only · allow-listed indices · ≤ 200 rows) ③ ContainmentDirective (JWS + nonce + expiry — spec §1.2.3) ④ receipts + case events (edge audit ref) Tunnel Gateway cert SAN → tenant · dedupe Control-plane API RLS scope per request Agent Orchestrator triage · OPA gate · LLM lanes Central ES metadata only OPA (cloud) fail-closed gate PostgreSQL RLS, 13 tables Audit chain per tenant · self-verify air-gap proof points — what makes the boundary provable, not just claimed Loopback-only host bindings every compose port 127.0.0.1 — no ingress Redaction at the edge vector transform + profile digest per alert RLS tenant isolation ∅-read integration tests in the gate Audit-before-execute hash chain sealed before the action runs Outbound-only dial (§1.2.1) the box never listens — simulated here Signed directives + nonce (§1.2.3) placeholder signature strings in the reference Edge OPA veto (§3.3.1) Phase 1 edge bundle — 2nd gate Air-gap update bundle (§2.4) signed OCI — Phase 5 ● enforced in the reference stack today    ● spec-defined — planned or simulated in the reference
Hover a node or proof point to preview it; click for the evidence.

Threat model — trust zones, the four frame types that cross the seam, the list of things that never cross it, and the air-gap proof points with their honest status:

Proof point Status in the reference stack
Loopback-only host bindings Enforced — every compose port is 127.0.0.1; tailnet exposure only via tailscale serve
Redaction at the edge Enforced — redact_pii transform in deploy/compose/edge/vector.toml, profile digest per alert
RLS tenant isolation Enforced — db/rls/01-schema.sql + ∅-read integration tests in the gate
Audit-before-execute Enforced — chain event sealed before the action's side effect
Outbound-only dial (§1.2.1) Spec — the tunnel is simulated; the box side has no dial-out yet
Signed directives + nonce + expiry (§1.2.3) Spec — the envelope shape is real; signatures are placeholder strings in the reference
Edge OPA veto (§3.3.1) Spec — the edge bundle ships with Phase 1
Air-gap update bundle (§2.4) Spec — Phase 5

Click the proof points in the diagram for the evidence per row.

Where the honesty lines are

The reference stack is a deliberately small, real slice of the spec. What is real today, end to end, verifiable in the running demo:

  • ingest → triage → verdict → OPA gate → HITL approval → containment action (simulated execution, recorded receipt) → case projection, getting started;
  • RLS multi-tenancy with cross-tenant ∅-read tests, multi-tenancy.md;
  • the hash-chained audit trail with on-read verification, operations.md;
  • the ES|QL validator and the (simulated) federated query leg, llm-triage.md §ES|QL.

What is spec-only and must not be described as shipped: the Edge Agent (Go), the WireGuard/gRPC tunnel, edge-side OPA, the JWS/nonce/expiry signature checks, the G1 isolation gate suite (tests 1.A1–1.A14 — NOT-STARTED per deliverables/audit-2026-11-23.md; the in-repo cross-tenant tests are the proxy), fleet/signed updates (Phase 5), and the full §4.5 /v1/* endpoint surface beyond the reference-stack markers in the API reference.

Cross-references

Topic Page
The §4.5 contract, 65 paths, what runs today API reference
LLM triage internals: prompts, verdict schema, failure modes LLM triage
Detection rules: what exists, what is planned, how to author Detection rules
RLS walkthrough + isolation guarantee + how it is tested Multi-tenancy
Install, upgrade, backup, health, logs, runbook Operations
The scenario lab that stands in for real connectors Edge simulator
Portal modules Console guide
Repo layout + how to contribute Contributing