Repository navigation
Detection Architecture
OodaTap detects autonomous and hybrid human+agentic OODA loops (Observe → Orient → Decide → Act) strictly from encrypted network metadata. Events are grouped per source host (src_ip) and scored across three orthogonal detectors before policy-aware verdict fusion.
Autonomous LLM agents replay growing conversation transcripts (tool calls + tool outputs) on every turn until context compaction resets the prompt size, producing a distinctive uplink byte sawtooth paired with SSE token-streaming downlinks.
-
Per-endpoint scoring: Groups a host's
TlsBurstEventstreams by endpoint key (sniordst_ip:dst_port), evaluates each independently, selects the highest-scoring endpoint ((score, turn_count)), and records all endpoints scoring>= 0.30inmatched_endpoints. -
Minimum turns: Requires
n >= min_turns_for_sawtooth(default4). -
Compaction-cliff detection: Marks turn
idx >= 1as a compaction cliff whenuplinks[idx - 1] >= 4000bytes anduplinks[idx] < 0.65 * uplinks[idx - 1](>35% sudden drop). -
Segment-wise trend metrics (split at compaction cliffs, weighted across segments of length
>= 3, falling back to full series):-
Noise-tolerant Kendall's τ: Pair
(i, j)(j > i) is concordant ifu[j] - u[i] > 64B, discordant if< -64B. -
Monotonic step ratio: Fraction of adjacent steps increasing by
> 64B. -
Max growth ratio: Maximum segment ratio
max(seg) / max(min(seg), 1).
-
Noise-tolerant Kendall's τ: Pair
-
SSE streaming downlink cadence (
sse_stream_ratio): Fraction of turns with plausible TTFT (0.12s <= ttft_seconds <= 15.0s) and either multi-record small-chunk streaming (downlink_record_count >= 4and average record<= 1800B) or sustained decode duration (decode_duration_seconds >= 0.15s). -
Composite sawtooth score:
tau_norm = clip((weighted_tau + 0.10) / 1.05, 0, 1)mono_norm = clip((mono_ratio_weighted - 0.30) / 0.60, 0, 1)growth_norm = clip((max_growth - 1.15) / 2.20, 0, 1)raw = 0.34*tau_norm + 0.24*mono_norm + 0.20*growth_norm + 0.22*sse_ratio + cliff_bonus (0.08) + endpoint_bonus (0.07)-
Flat-traffic damping: Multiplies
rawby0.35ifmax_growth < 1.12(suppressing steady non-growing HTTPS polling).
Measures whether North-South LLM inference completions directly drive East-West internal tool executions, and whether tool outputs flow right back into the next North-South LLM uplink turn.
-
Stream selection: Picks the host's busiest
is_llm_endpointstream with>= 3turns (else overall busiest stream) so unrelated endpoints are never merged. Considers actions in{EAST_WEST_INTERNAL, DEV_LOCAL}. Requires>= 3LLM turns and>= 2actions. -
Inter-turn cycle matching: For each consecutive turn pair
(prev_turn, cur_turn):- Collects actions falling within
[prev_turn.downlink_end_ts - 0.05, cur_turn.timestamp]. -
Dispatch lag:
max(0, first_action.timestamp - prev_turn.downlink_end_ts) <= max_dispatch_lag_seconds(default2.2s). -
Observation lag:
max(0, cur_turn.timestamp - max(a.end_ts)) <= max_obs_lag_seconds(default2.5s). - Matching cycles record
coupled_links, target hosts, protocols, and (on non-compaction turns with positive uplink delta)(sum(bytes_in), cur.uplink_bytes - prev.uplink_bytes)pairs for Pearson correlation (byte_delta_correlation, requiring>= 3pairs).
- Collects actions falling within
-
Binned OLS Granger-causality F-test:
- Bins LLM completion timestamps (
cause) and action start timestamps (effect) into0.5sbins (16 <= n_bins <= 20000) withmax_lag = 4(up to2.0s). - Compares restricted autoregressive OLS (
RSS_r) against unrestricted OLS addingcauselags1..4(RSS_u):F = ((RSS_r - RSS_u) / 4) / (RSS_u / (n_rows - 9)).
- Bins LLM completion timestamps (
-
Composite coupler score:
raw = 0.30*obs_ratio + 0.30*dispatch_ratio + 0.22*max(0, byte_corr) + 0.18*(1 - exp(-granger_f / 6.0))- Scaled by sample count (
0.35 + 0.65 * min(1, coupled_cycles / min_actions_for_coupling)), or0.0ifcoupled_cycles == 0.
Analyzes East-West / local action timing geometry independently of TLS streams to separate autonomous agents from rapid scripted scanners and human operators—and to pinpoint mid-session Agent ↔ Human handoffs.
-
Parallel tool fan-out clustering: Groups consecutive actions starting within
fanout_window_seconds(default0.20s) into_ActionBurstclusters (requires>= 4actions and>= 3bursts). -
Scanner regularity penalty: Computed on raw inter-action timestamp diffs when
median < 0.35sandCV < 0.85(scanner_regularity_score). High scanner regularity (>= 0.65) damps the kinematics score by(1.0 - 0.85 * scanner_regularity). -
Exact BIC-penalized L2 optimal partitioning:
- Builds standardized 2D burst features
[log1p(gaps), fanout_flags * 1.5]. - Runs dynamic programming (
min_seg_size = 5, penalty4.0 * ln(n)) with O(1) prefix-sum SSE cost to detect arbitrary non-monotonic regime shifts (includingAgent → Human → Agent).
- Builds standardized 2D burst features
-
Per-segment regime classification:
-
SCRIPTED_SCANNER:median_gap < 0.45sandCV < 0.85andfanout_ratio < 0.85 -
AUTONOMOUS_AGENT:(0.55s <= median_gap <= 8.5s and CV <= 0.72)or(fanout_ratio >= 0.25 and 0.45s <= median_gap <= 10.0s) -
HUMAN_OPERATOR:median_gap >= 7.5sor(median_gap >= 3.0s and CV > 0.72 and fanout_ratio < 0.15) -
IDLE_OR_MIXED: otherwise
-
-
Handoff emission: Any adjacent pair switching between
AUTONOMOUS_AGENTandHUMAN_OPERATORemits aHandoffEventwith timestamp, rationale, and confidenceclip(0.45 + 0.12*log1p(gap_ratio) + 0.35*abs(fan_diff), 0.5, 0.99). -
Composite kinematics score:
- Combines autonomous action share (
0.40), normalized fan-out ratio (0.30), inference-bandsize_to_pause_correlation(0.25, for0.5s <= gap <= 15.0s), and+0.15handoff bonus, damped byscanner_regularity.
- Combines autonomous action share (
-
Weighted composite:
0.30 * sawtooth + 0.45 * coupler + 0.25 * kinematics(weights tunable via YAML policy). -
Off-box LLM fallback: If
sawtooth.turn_count < min_turns_for_sawtoothANDkinematics.score >= 0.70ANDscanner_regularity < 0.45, raises composite tomax(composite, 0.72 * kinematics.score). -
Verdict priority order:
-
BENIGN_DEV_AGENT(suppressed_as_dev_agent = True):- Zero sensitive lateral actions, zero non-allowlisted internal actions,
>= 2dev-local actions, and(sawtooth >= 0.40 or coupler >= 0.35); or - Host IP listed in
dev_allowlist.approved_dev_hostswith zero sensitive lateral actions andcomposite >= suspicious_threshold(0.40).
- Zero sensitive lateral actions, zero non-allowlisted internal actions,
-
SCRIPTED_AUTOMATION:scanner_regularity >= 0.65,sawtooth < 0.35, andcoupler < 0.25. -
HYBRID_HUMAN_AGENT_INTRUSION/AGENTIC_OODA_INTRUSION:composite >= alert_threshold(0.58) AND (sensitive_lateral_actions > 0orunique_internal_targets >= 2orcoupler >= 0.55). EmitsHYBRID_HUMAN_AGENT_INTRUSIONwhenhandoffsis non-empty, otherwiseAGENTIC_OODA_INTRUSION. -
SUSPICIOUS_LOOP:composite >= suspicious_threshold(0.40). -
BENIGN: Default fallback.
-
Deterministic NumPy-seeded evaluation across 5 traffic classes (base_seed = 100):
| Scenario Class | Traces | Alerts | Exact Match | Mean Composite | Sawtooth | Coupler | Kinematics |
|---|---|---|---|---|---|---|---|
human_admin |
15 | 0 | 15/15 | 0.07 | 0.18 | 0.00 | 0.05 |
scripted_scanner |
15 | 0 | 15/15 | 0.03 | 0.00 | 0.00 | 0.11 |
benign_dev_agent (suppressed)
|
15 | 0 | 15/15 | 0.85 | 1.00 | 0.88 | 0.60 |
autonomous_agent_intrusion |
15 | 15 | 15/15 | 0.96 | 1.00 | 0.94 | 0.95 |
hybrid_human_agent_intrusion |
15 | 15 | 15/15 | 0.93 | 1.00 | 0.97 | 0.77 |
Overall synthetic metrics: 100.0% Precision, 100.0% Recall, 100.0% F1, 0.0% Benign Dev-Agent FPR, and 100.0% Agent ↔ Human Handoff Recall.