The task
Each input is one alert summary. The model returns one of three actions:
BLOCK_IP
ISOLATE_HOST
IGNORE
Every response is a single JSON object containing the decision and evidence citations. Each citation is a table-qualified row reference with a verbatim quote from the summary. The model gets one turn and no tools.
Systems compared
Results are from eval/results/summary.md on 45 held-out eval cases.
Table with columns: System, N, Accuracy, JSON validity, Evidence recall, False-positive rate, Missed detections, p50 latency| System | N | Accuracy | JSON validity | Evidence recall | False-positive rate | Missed detections | p50 latency |
|---|
| LoRA (Qwen3.5-4B + adapter) | 45 | 64.4% | 97.8% | 83.0% | 47.1% | 21.4% | 4.1s |
| Base Qwen3.5-4B | 45 | 57.8% | 73.3% | 43.7% | 17.6% | 28.6% | 7.3s |
| Deterministic rules | 45 | 88.9% | n/a | n/a | 29.4% | 0.0% | 3.6ms |
| 35B baseline (ornith-1.5-35b, agentic, golden set) | 31 | 90.3% | n/a | 88.5% | 16.7% | 0.0% | 28.7s |
| 35B baseline (agentic, holdout) | 14 | 78.6% | n/a | 100.0% | 60.0% | 0.0% | 47.3s |
The 35B rows are not a like-for-like comparison with the single-turn systems. See Evaluation.
Pipeline
The scripts run in this order:
build_dataset.py renders summaries from the harness's per-case SQLite DBs. It takes the harness repo root as --harness-root.
gen_scenarios.py generates synthetic scenarios. It writes data/synthetic/ and appends to data/train.jsonl.
prompts.py is the single source of the system prompt and the evidence-type enum.
train_lora.py runs SFT.
eval_lora.py scores the lora, base, and rules systems and writes eval/results/<system>.json.
derive_baseline.py derives the 35B figures from the harness recordings into eval/results/baseline-35b.json.
write_failure_analysis.py writes eval/results/summary.md and eval/results/failure-analysis.md.
File layout:
DESIGN.md: design document, §1–§10
- The seven scripts above
data/train.jsonl, data/eval.jsonl
eval/results/: four result JSON files (lora, base, rules, baseline-35b), train-meta.json, and two reports
tests/: test_offline.py (32 offline tests), run in CI via .github/workflows/ci.yml on pytest
Training data
The training set has 194 records:
- 14 real dev triage cases
- 180 synthetic scenarios, 60 per class
By label, the training set has BLOCK_IP 61, ISOLATE_HOST 66, and IGNORE 67.
Generator safeguards:
- Every synthetic target cites evidence whose quote is a verbatim substring of the rendered summary. This is asserted and enforced by tests.
- Quotes contain no double quotes, backslashes, or control characters.
- 41 of 60 synthetic IGNORE scenarios target external IPs, so
target_is_internal does not predict the label. Across all IGNORE records, 47 of 67 are external.
- 35 of 60 synthetic ISOLATE_HOST cases carry Windows event evidence (alongside syslog brute-force rows), and 25 carry only syslog and bash-history events. 22 of 60 synthetic IGNORE cases carry only Windows events (endpoint evidence all
windows_event), so the model learns to cite Windows rows with simple quotes.
- 16 of 60 synthetic IGNORE cases carry informational IDS alerts (ET INFO/POLICY, priority 3), 21 carry routine ASA Built/Teardown connection rows, and 22 external IGNORE cases have no endpoint events and cite flow evidence instead. 16 of 60 synthetic BLOCK_IP cases carry zeek flows, so evidence-occupancy features (alert presence, firewall rows, empty endpoints, flow absence) do not predict the BLOCK_IP label; a test enforces that no single feature or feature pair predicts BLOCK_IP at 0.90 precision and 0.90 recall.
- Every synthetic case is cross-checked against the harness deterministic rules, with 180/180 agreement (DESIGN §4).
Training
- LoRA with r=16 and alpha=32 on attention and MLP projections
- bf16
- 3 epochs
- Max sequence length 4096
- Completion-only loss via unsloth
train_on_responses_only, with the assistant JSON as the response
- Seed 20261125
- One RTX 5070 Ti 16GB
- Final train loss 0.1207 (
train_loss in the Trainer's final summary line; backing file eval/results/train-meta.json, which also records the training data sha256)
Evaluation
The eval set has 45 held-out cases: 9 BLOCK_IP, 17 IGNORE, and 19 ISOLATE_HOST. data/eval.jsonl is frozen byte-for-byte across all runs, and its sha256 has not changed since the first commit.
Metric definitions:
- Accuracy: a case counts as correct only if the strict JSON parse yields the expected decision. Invalid JSON counts as wrong.
- Evidence recall: the fraction of the model's own cited quotes that appear verbatim in the input summary. This measures citation discipline, not grounding quality.
- False-positive rate: the fraction of benign (IGNORE) cases the system acted on.
- Missed detections: the fraction of attack cases the system took no action on.
Strict-parsing policy: evaluation is a single pass with no retries and no schema repair, and generation is capped at 512 new tokens.
Failure modes for the LoRA system, from eval/results/failure-analysis.md:
- IGNORE → ISOLATE_HOST, 7 cases: benign internal scanner, RDP-admin and password-typo activity that trips IDS signatures (CASE-025, CASE-026, CASE-029, CASE-031, CIC-162-208-22-34, CIC-192-168-10-255, CIC-192-168-10-3)
- ISOLATE_HOST → IGNORE, 3 cases: benign-looking Windows binaries and a mail gateway (CASE-003, CASE-010, CASE-011)
- BLOCK_IP → IGNORE, 2 cases (CASE-006, CASE-019)
- BLOCK_IP → ISOLATE_HOST, 2 cases (CASE-018, CASE-021)
- IGNORE → BLOCK_IP, 1 case (CASE-007-EXT-VPN)
- ISOLATE_HOST → invalid JSON, 1 case (CASE-009)
The 35B baseline is agentic, with a maximum of 12 tool turns. Its records under eval/results/baseline-35b.json are derived from the harness's own recordings. It is not a like-for-like comparison with the single-turn systems.
Out-of-distribution evaluation (CSE-CIC-IDS2018)
The OOD set is 42 held-out cases from CSE-CIC-IDS2018: 11 BLOCK_IP, 10 ISOLATE_HOST, and 21 IGNORE (7 internal and 14 external benign). Nothing from it was used in training. The set is committed as data/ood-eval.jsonl.
Table with columns: System, Accuracy, False-positive rate| System | Accuracy | False-positive rate |
|---|
| Deterministic rules | 88.1% | 23.8% |
| LoRA (this adapter) | 81.0% | 33.3% |
| Base Qwen3.5-4B | 47.6% | 66.7% |
Per-class OOD accuracy for this adapter is 90.9% on BLOCK_IP, 100.0% on ISOLATE_HOST, and 66.7% on IGNORE. JSON validity and evidence recall are both 100%. The adapter acted on 7 of 21 benign cases, all internal-benign cases misrouted to ISOLATE_HOST, and on zero external benign cases.
The first published adapter, trained before the generator's shortcut fix, collapsed on this set at 47.6% accuracy with 90.5% FPR. It acted on 19 of 21 benign cases, with fabricated synthetic template rationales. This adapter replaces it. The deterministic rules baseline still leads (88.1%).
Limitations
- The eval set is small: 45 cases with per-class n of 9–19, so one flipped case moves per-class accuracy by several points.
- The deterministic rules baseline was tuned against the same golden cases it is scored on, so its 88.9% is an upper bound, not a fair head-to-head.
- The synthetic labels agreed with the rules 180/180, so the adapter partially distills the rules boundary, and the interesting comparison is what it does beyond keyword rules.
- Verbatim-quote recall measures citation discipline, not whether the quote supports the decision.
- The first published adapter collapsed on the OOD set (90.5% FPR against 23.8% for rules); this adapter was retrained after fixing evidence-occupancy shortcut leakage in the synthetic generator and recovers to 33.3% FPR OOD, but still trails the rules baseline on both distributions.
Reproducing
Export HARNESS_ROOT to the root of the sibling ai-triage-agent repo, then run:
export HARNESS_ROOT=/path/to/ai-triage-agentpython build_dataset.py --harness-root $HARNESS_ROOT --out data/python gen_scenarios.py --harness-root $HARNESS_ROOT --out data/synthetic --n-per-class 60 --train-out data/train.jsonlpython train_lora.py --out outputs/lora-r16python eval_lora.py --system lora --adapter outputs/lora-r16python eval_lora.py --system basepython eval_lora.py --system rules --eval-file data/eval.jsonl # reads $HARNESS_ROOT from the environment; no flag# OOD runs must pass --out explicitly: without it, results overwrite the# in-distribution files in eval/results/ (the default is results/<system>.json).python eval_lora.py --system lora --adapter outputs/lora-r16 --eval-file data/ood-eval.jsonl --out eval/results/lora-ood.jsonpython eval_lora.py --system base --eval-file data/ood-eval.jsonl --out eval/results/base-ood.jsonpython eval_lora.py --system rules --eval-file data/ood-eval.jsonl --out eval/results/rules-ood.json# build_ood_cases.py ran on a GPU host with the raw CSE-CIC-IDS2018 per-flow# CSVs, which are not in the repo.python derive_baseline.py --harness-root $HARNESS_ROOTpython write_failure_analysis.pypython -m pytest -q tests/