Skip to content

CLI and Output Reference

Evan Newman edited this page Nov 30, 2026 · 1 revision

CLI and output reference


CLI commands (src/oodatap/cli.py)

Installed entry point: oodatap (oodatap.cli:app, prints help when invoked with no arguments).

oodatap analyze SOURCE [OPTIONS]

Runs ingest, policy enrichment, and all three detectors, prints a Rich summary table, and optionally writes HTML/ECS outputs.

Option Default Description
SOURCE (arg) (required) Input .pcap, .pcapng, Zeek conn.log, Suricata eve.json, or JSONL file
-f, --format auto Force adapter: auto, pcap, pcapng, zeek, suricata, or jsonl
-p, --policy (bundled default) Custom YAML policy path
--ssl-log (auto-discover) Explicit Zeek ssl.log path
--html (none) Write offline, zero-CDN interactive HTML timeline report
--ecs-out (none) Write Elastic Common Schema (v8.11.0) JSONL alerts
--include-benign-ecs false Include benign & dev-suppressed hosts in ECS output
--fail-on-alert false Exit with status code 2 if any alerting host (hybrid_human_agent_intrusion, agentic_ooda_intrusion, or suspicious_loop) is detected

oodatap ingest SOURCE --out PATH [OPTIONS]

Normalizes raw telemetry into canonical OodaTap JSONL (TlsBurstEvent / ActionEvent).

  • Required: SOURCE, -o / --out PATH
  • Optional: -f / --format (auto), -p / --policy, --ssl-log

oodatap benchmark [OPTIONS]

Evaluates the 5-class synthetic corpus (human_admin, scripted_scanner, benign_dev_agent, autonomous_agent_intrusion, hybrid_human_agent_intrusion).

  • -n, --seeds INT (default 5, range 1..50) — traces per class (5 * seeds total)
  • --base-seed INT (default 100) — deterministic NumPy seed
  • -p, --policy PATH — optional custom policy

oodatap generate-corpus [OPTIONS]

Writes labeled .jsonl traces, optional binary .pcap captures, and manifest.json.

  • -o, --out PATH (default corpus)
  • -n, --seeds INT (default 2, range 1..25)
  • --no-pcap (flag, default false) — skip writing .pcap files

oodatap version

Prints oodatap 0.1.0.


Python library API

from pathlib import Path
from oodatap.detectors import OodaTapEngine
from oodatap.ingest import load_events
from oodatap.policy import load_policy
from oodatap.report import write_ecs_jsonl, write_html_report

policy = load_policy()
events, adapter = load_events(Path("examples/sample_traces/hybrid_intrusion.pcap"), policy=policy)
report = OodaTapEngine(policy=policy).analyze_events(events, source_path="hybrid_intrusion.pcap", adapter=adapter)

for hv in report.alerting_hosts:
    print(hv.host_ip, hv.verdict, hv.scores.composite)

write_ecs_jsonl(report, Path("out/alerts.ecs.jsonl"))
write_html_report(report, Path("out/timeline.html"))

Key module exports:

  • oodatap: ActionEvent, AnalysisReport, DetectorScores, HandoffEvent, HostVerdict, TelemetryEvent, TlsBurstEvent, VerdictLevel, __version__
  • oodatap.detectors: OodaTapEngine, analyze_sawtooth, analyze_coupling, analyze_kinematics
  • oodatap.ingest: detect_format, load_events, read_jsonl, write_jsonl, read_pcap, write_pcap_from_events, write_pcapng_from_events, read_suricata_eve, read_zeek_logs
  • oodatap.policy: PolicyConfig, DevAllowlistConfig, ScoringConfig, ScoringWeights, DEFAULT_POLICY_PATH, PORT_PROTOCOL_MAP, load_policy
  • oodatap.report: render_html_report, write_html_report, report_to_ecs_alerts, write_ecs_jsonl
  • oodatap.benchmark: SCENARIO_CLASSES, GeneratedScenario, ScenarioEvaluation, BenchmarkResult, generate_scenario, generate_corpus, generate_mixed_enterprise_events, run_benchmark

ECS v8.11.0 JSONL alert format (src/oodatap/report/ecs.py)

Each line conforms to Elastic Common Schema 8.11.0:

{
  "@timestamp": "2026-11-24T12:00:00+00:00",
  "ecs": { "version": "8.11.0" },
  "event": {
    "kind": "alert",
    "category": ["network", "intrusion_detection"],
    "module": "oodatap",
    "action": "hybrid_human_agent_intrusion",
    "severity": 90,
    "risk_score": 93.4
  },
  "source": { "ip": "10.0.20.55" },
  "destination": {
    "ip": ["10.0.1.10", "10.0.1.15"],
    "domain": ["api.anthropic.com"]
  },
  "network": { "protocol": ["ldap", "smb", "ssh"] },
  "message": "...",
  "oodatap": {
    "source_file": "hybrid_intrusion.pcap",
    "verdict": "hybrid_human_agent_intrusion",
    "confidence": 0.97,
    "suppressed_as_dev_agent": false,
    "scores": { "composite": 0.934, "sawtooth": 1.0, "coupler": 0.97, "kinematics": 0.77 },
    "evidence": {
      "kendall_tau": 0.94,
      "compaction_cliffs": 1,
      "coupled_cycles": 14,
      "byte_delta_correlation": 0.91,
      "granger_f_stat": 18.2,
      "parallel_fanout_bursts": 5,
      "handoffs": []
    }
  }
}

Severity mapping

VerdictLevel event.kind event.severity
hybrid_human_agent_intrusion alert 90
agentic_ooda_intrusion alert 85
suspicious_loop alert 55
scripted_automation event 35
benign_dev_agent event 10
benign event 0

Offline HTML timeline reports & bundled sample traces

write_html_report renders src/oodatap/report/templates/timeline.html.j2 into a single self-contained HTML file with zero external CDN requests, displaying per-host verdict cards, dual-track North-South sawtooth & East-West action SVGs, regime shading, compaction cliff markers, causal coupling arcs, Agent ↔ Human handoff markers, interactive hover tooltips, and expandable ECS JSON.

Bundled sample traces (examples/sample_traces/)

File Format Scenario
mixed_enterprise.pcapng PCAPNG (~2.9 MB) 5 concurrent enterprise hosts (2 alerting intrusions + benign dev agent + scanner + human admin)
hybrid_intrusion.pcap PCAP (~836 KB) Compromised host 10.0.20.55 executing hybrid agentic + human-handoff intrusion
hybrid_intrusion.jsonl JSONL (63 events) Normalized JSONL representation of hybrid_intrusion.pcap
benign_dev_agent.pcap PCAP (~528 KB) Legitimate developer coding agent (10.0.10.33) suppressed as BENIGN_DEV_AGENT
zeek_sample_conn.log Zeek JSON (53 rows) Autonomous agentic intrusion (10.0.20.44) in Zeek format

Regenerate all sample traces and the preview SVG via:

uv run python examples/generate_sample_traces.py
uv run python examples/generate_timeline_svg.py

Clone this wiki locally