Decisions, AI & Fleet·4 min read·docs/decision-graph.md

Decision Graphs & Judges

Versioned YAML graphs with bounded CEL predicates, probability gauges, 16 curated graphs, and replay diff.

Interactive Guide LabBounded CEL & judge probability
Visual Isometric WalkthroughDetection Engineering & SecOps Teams

Interactive Isometric Architecture Simulators

Deterministic CEL Decision Graph → Calibrated Judge → Signed Alert Outbox

See how noisy kernel streams become high-precision cases and reliable multi-channel alerts under strict UTC budgets.

Decision Graphs guide →
RING 3 · AI / PROCUntrusted user spaceRING 0 · eBPFTetragon v1.8.0PQ ZERO-TRUSTML-DSA-65 + HPKEHUB · CEL & MCPGraphs & 23 toolsHUMAN SEALSHA-256 audit chainWAL LEDGER #ev-9084 →
Step 1 of 5 · Ledger Ingestinternal/adapter/sqlite/ledger.go

Ring 0 kernel event commits to append-only SQLite WAL

Tetragon emits a ptrace / privilege-escalation event over Unix gRPC. Ometsuke normalizes untrusted strings through printable() and persists entry #ev-9084 into WAL SQLite.

Developer invariant · Durability comes first: even if external judges or webhook receivers are down, zero kernel evidence is ever lost.
Immutable SQLite WAL ledger row
entry_id:  #ev-9084  (node: prod-eu-01)
hook:      security_ptrace_access_check
binary:    /tmp/.cache/helper -> target pid 1 (systemd)
sanitized: printable() applied before storage & UI

Status (v0.1.0+). The decision engine evaluates matching live and replayed entries across all five step kinds (read, judged, investigated, check, and action). The binary embeds exec-in-container plus 16 curated decision graph templates (/graphs/catalog), supports comparative replay across revisions and thresholds (/graphs/compare), and provides a sealed live visual/YAML Graph editor (/graphs/editor) with 0600 persistence and hot-reload. Embedded graph

#1. Why a decision graph instead of an unconstrained agent

  • Inspectable routes: Every opened case preserves the exact path traversed, each step's answer, and its cited ledger entries.
  • Low-cost filtering: Fast bounded CEL read steps filter benign events before invoking a probability judge or language model.
  • Deterministic boundaries: Event text is hostile data; graph structure, available exits, and terminal proposals come strictly from operator-owned YAML files.
  • Testable before rollout: Comparative replay (/graphs/compare) evaluates candidate revisions or threshold adjustments against stored events before saving.

#2. Step kinds

KindEvaluatesExits
readBounded CEL predicate over the event, process, container, overlay diff, and related entriesyes, no
judgedPinned probability judge (jev, Liquid AI) compared against ordered no_at / yes_at thresholdsyes, no, uncertain
investigatedBounded LLM investigation over numbered, redacted evidence (requires configured LLM)yes, no, uncertain
checkBounded CEL predicate that can inspect route_confidence accumulated so faryes, no
actionTerminal proposal (isolate-container, kill-process, review) opening a waiting case for a human sealEnds evaluation

#3. Graph file format and curated catalog

Graphs are single YAML files loaded from embedded graphs/*.yaml and overridden or extended by -graphs <dir> (and sealed edits saved under <data>/graphs/). Duplicate graph names in the same directory, unknown keys, unreachable steps, cycles, or invalid CEL expressions are rejected on load.

The console ships 16 curated templates in graphs/catalog/ covering container escape, credential theft, fileless memfd chains, cloud IMDS SSRF, crypto-miner egress, SSH lateral movement, LD_PRELOAD hijacks, BPF rootkit watch, io_uring evasion, kernel module tampering, sysctl tampering, log evasion, overlay-dropper egress, and runtime package drift — each linked to its MITRE ATT&CK techniques and required monitor-first TracingPolicies.

#Shipped exec-in-container example

yaml
graph: exec-in-container
revision: 1
about: Checks executables started inside containers under /tmp, /var/tmp, or /dev/shm.
judge: {name: jev, version: jev-1.14.0}
enter:
  when: event.kind == "exec" && process.container_id != ""
  settle: 3s
start: writable-path
steps:
  writable-path:
    kind: read
    ask: Was the program started from a directory anyone can write to?
    expr: process.binary.startsWith("/tmp/") || process.binary.startsWith("/dev/shm/") || process.binary.startsWith("/var/tmp/")
    yes: dropped
    no: close
    says: {yes: ran from a writable directory, no: not from a writable directory}
  dropped:
    kind: judged
    ask: Was it put there and then executed by the same session?
    proposition: Within the entries shown, a program was copied or downloaded into a world-writable directory, made executable, and then executed.
    evidence: {scope: process-tree, window: 60s, max_entries: 40}
    no_at: 0.15
    yes_at: 0.85
    yes: called-out
    no: close
    uncertain: to-a-person
    says: {yes: put there and executed, no: not dropped by this session, uncertain: may have been dropped}
  called-out:
    kind: read
    ask: Did it open a connection to the outside?
    expr: entries.exists(e, e.kind == "kprobe" && e.hook == "tcp_connect" && e.binary == process.binary)
    yes: confident
    no: propose-kill
    says: {yes: called out, no: made no connection}
  confident:
    kind: check
    ask: Is the route confidence 0.90 or more?
    expr: route_confidence >= 0.90
    yes: propose-isolate
    no: to-a-person
    says: {yes: confident route, no: not confident enough}
  propose-isolate: {kind: action, ask: Propose to isolate the container, propose: isolate-container}
  propose-kill: {kind: action, ask: Propose to kill the process, propose: kill-process}
  to-a-person: {kind: action, ask: Bring it to a person, propose: review}

#Top-level and step keys

KeyScopeMeaning
graph, revision, aboutTop-levelKebab-case identifier, integer revision ≥ 1, operator summary
judge {name, version}Top-levelExact pinned judge and model version required for judged steps (-latest/-preview refused)
enter {when, settle}Top-levelCEL entry predicate and settle window (up to 60s) before walking
start, stepsTop-levelEntry step ID and ordered step map (max 32 steps, acyclic, all reachable)
kind, askAll stepsStep kind (read, judged, investigated, check, action) and operator-readable question
exprread, checkBounded CEL boolean predicate
proposition, evidence {scope, window, max_entries}judged, investigatedClaim to score or investigate over process-tree or container evidence (1s–1h, max 40 entries)
no_at, yes_atjudgedOrdered thresholds (0 <= no_at < yes_at <= 1)
yes, no, uncertainNon-terminalNext step ID or close (uncertain applies to judged and investigated)
proposeactionisolate-container, kill-process, or review — opens a waiting case; never auto-executes
says {yes, no, uncertain}OptionalShort overview labels (≤ 40 chars each)

#4. Bounded CEL expression environment

Expressions compile with cel.dev/cel-go against read-only event maps:

VariableFields exposed
eventkind, hook, args, policy, tags, action, severity
processbinary, args, cwd, pid, uid, in_init_tree, container_id
containerid, name, image
imageadded_files (read-only Docker overlay diff GET /containers/{id}/changes when Docker is enabled)
entriesRelated ledger entries (kind, hook, args, policy, action, binary, process_args, pid)
route_confidenceCumulative confidence across judged hops (double)

Hard bounds: ≤ 1,024 chars at compile; only has, all, exists, exists_one macros (no map/filter); 100,000 evaluation cost cap; 100 ms soft deadline; ≤ 64 KiB per string, ≤ 256 list items, ≤ 128 related entries, ≤ 1 MiB total text. Any bound violation aborts evaluation rather than silently returning false.

#5. Rules, replay comparison and live editing

  • Route confidence: Multiplies judged exit probabilities (p on yes/uncertain, 1 - p on no, 0 if unjudged).
  • Fail-safe uncertainty: Unreachable judges/LLMs or exhausted UTC daily budgets (under person fallback) route down uncertain so unfamiliar activity is surfaced for human review rather than dropped or auto-blocked.
  • Comparative replay (/graphs/compare): Evaluates two graph revisions, candidate YAML, or threshold overrides against stored ledger entries without creating cases or mutating state.
  • Sealed Graph editor (/graphs/editor): Validates syntax, DAG topology, and CEL rules via POST /api/v1/graphs/validate, then writes an owner-only (0600) YAML revision under an operator seal via PUT /api/v1/graphs/{name} and hot-reloads active evaluators.