Intended use (defensive only)
Score email, SMS, chat, URLs, tool or web output, and (with the extended prompt) short request logs or traces, that a human or an AI agent may read. Flag unsupervised attack-agent handoffs, malicious artifacts, honeypot bait, prompt injection / credential exfiltration, and agent social engineering, as well as classic human phishing. Not a penetration-testing tool, exploit generator, or bypass assistant.
Taxonomy (17 training tactics + three 2026-12 eval slugs + none)
Training slugs: artificial_urgency, authority_spoofing, credential_harvesting, payment_redirection, link_manipulation, attachment_lure, emotional_anchoring, consequence_threat, reciprocity_bait, trust_transfer, pretexting, context_injection, autonomous_attack_agent, malicious_agent_artifact, agent_honeypot_deception, prompt_injection_exfil, agent_social_engineering.
Eval-only 2026-12 extensions (not in R3 training; used with an extended inference prompt on the ood_hard split, same JSON shape): ssrf_metadata_probe, credential_harvest_recon, sybil_account_rotation, plus a log channel for request/trace inputs. Motivated by a public 2 December 2026 report from Aravind Srinivas (Perplexity) of an autonomous agent campaign.
Use "none" when the message or traffic is benign.
Eval (greedy decoding, max_new_tokens=768, bootstrap 95% CIs)
Hardware: 1× H100. Original test n=3,243 (frozen R1 split). gold_test_r2 n=132 (frozen hard gold). General probe n=25. Intervals are percentile bootstrap 95% CIs from 2,000 resamples of (gold, pred) pairs, seed 42. Decoding is greedy (do_sample=False); a 3-seed loop would be identical, so we report one pass plus CIs rather than claiming three independent measurements.
Original held-out test
Table with columns: Model, Precision, Recall, F1, Acc, Benign FPR, Tactic micro-F1, JSON valid| Model | Precision | Recall | F1 | Acc | Benign FPR | Tactic micro-F1 | JSON valid |
|---|
| This adapter (R3, ckpt-258) | 0.984 | 0.966 | 0.975 | 0.980 | 0.0103 | 0.699 | 3243/3243 |
| R1 LoRA (ckpt-306) | 0.978 | 0.961 | 0.970 | 0.976 | 0.0145 | 0.687 | 3241/3243 |
| Zero-shot Qwen3-4B-Instruct-2507 | 0.791 | 0.933 | 0.856 | 0.874 | 0.166 | 0.133 | 3231/3243 |
| TF-IDF + logistic regression | 0.914 | 0.946 | 0.930 | 0.942 | 0.060 | — | 1.0 |
Teger gold patterns in this test (12 short MIT examples): R3 11/12, R1 8/12, zero-shot 11/12. The remaining miss is a trust-transfer gift-card pretext (teger-gold-TP-0008).
Bootstrap 95% CIs on phish F1 (full original test): R3 0.975 [0.969, 0.981]; R1 0.969 [0.963, 0.976]; zero-shot 0.856 [0.843, 0.870]; TF-IDF 0.930 [0.920, 0.940]. R3 vs the base model is clearly resolved. R3 vs R1 is a small point-estimate gain whose CIs overlap, so it should not be read as a statistically established improvement on this split.
Near-duplicate check (R3 train vs this test; char 3–5gram TF-IDF cosine): 0 exact normalized copies, 0 template-key copies, 1 item at cosine ≥ 1.0, 40 at ≥ 0.99, 259 at ≥ 0.95 (mostly shared ealvaradob email templates with a different date, host, or greeting). After dropping the 259 flagged items (clean n=2,984), R3 F1 is 0.974 [0.967, 0.980] and the ranking vs zero-shot and TF-IDF is unchanged.
gold_test_r2 (hard gold, all JSON valid)
Table with columns: Model, Precision, Recall, F1, Acc, Benign FPR, Tactic micro-F1| Model | Precision | Recall | F1 | Acc | Benign FPR | Tactic micro-F1 |
|---|
| This adapter (R3, ckpt-258) | 0.981 | 0.972 | 0.977 | 0.962 | 0.083 (2/24) | 0.789 |
| Zero-shot Qwen3-4B-Instruct-2507 | 0.971 | 0.944 | 0.958 | 0.932 | 0.125 | 0.377 |
| TF-IDF + logistic regression | 0.885 | 0.926 | 0.905 | 0.841 | 0.542 | — |
| R1 LoRA (ckpt-306) | 1.000 | 0.741 | 0.851 | 0.788 | 0.000 | 0.417 |
Bootstrap 95% CIs on gold_test_r2 phish F1: R3 0.977 [0.954, 0.995]; zero-shot 0.958 [0.925, 0.982]; R1 0.851 [0.794, 0.902]; TF-IDF 0.905 [0.860, 0.943]. R3 vs R1 is clearly resolved. R3 vs zero-shot F1 CIs overlap (n=132 is small); the tactic-set micro-F1 gap is resolved (R3 0.789 [0.740, 0.836] vs zero-shot 0.377 [0.332, 0.422]). Benign FPR 2/24 has a wide interval, 0.083 [0.000, 0.211]. There is no text near-duplicate of this set in train (max char cosine 0.59), but the items were written by the same gpt-4.1-mini pipeline as the R2/R3 gold train, so they are same-author / in-generator-distribution, not an independent gold source.
R3 vs R1 tactic recall on this set (support in parentheses): trust_transfer 10/12 vs 0/12; context_injection 13/14 vs 0/14; pretexting 11/17 vs 1/17; malicious_agent_artifact 12/12 vs 4/12; prompt_injection_exfil 12/12 vs 1/12; agent_honeypot_deception 11/12 vs 0/12; agent_social_engineering 12/14 vs 3/14; attachment_lure 12/19 vs 5/19; autonomous_attack_agent 12/12 for both.
General-ability probe
R3 / R1: 23/25 (0.92). Zero-shot: 24/25 (0.96). That 1-point gap is too small to interpret on n=25.
Standard 90-item check (50 GSM8K MIT + 40 ARC-Easy CC-BY-SA, seed-42 sample in teger-ft/eval/general_standard.jsonl), scored from public Hub artifacts: R3 79/90 (0.878) — GSM8K 42/50, ARC-Easy 37/40. Zero-shot base: 82/90 (0.911) — GSM8K 43/50, ARC-Easy 39/40. A modest 3-item drop, not a collapse.
Out-of-distribution (Apache SpamAssassin, Apache-2.0, n=400, 200 spam + 200 ham; 1,995/6,040 source messages dropped for char cosine ≥ 0.95 vs R3 train). Vintage ham/spam is only an approximation of modern phishing. Public-artifact scores, bootstrap 95% CIs: R3 phish F1 0.970 [0.952, 0.986] (FPR 0.020 [0.005, 0.043]); TF-IDF 0.970 [0.951, 0.985] (FPR 0.030); zero-shot 0.899 [0.867, 0.928] (FPR 0.145). R3 matches the classical baseline and beats the untuned base; this is an easy lexical-shift test, not a hard modern-phishing OOD set.
Harder held-out test (ood_hard, n=532, eval-only, never used for training)
Modern 2023–2026 lures, African-context scams plus official bank/OTP alerts, non-English messages, and an autonomous-agent intrusion / log slice. Packed after licence review, a different generator than training gold (Llama 3.3 70B via OpenRouter, verified by gpt-4.1, hand-reviewed), and a char cosine ≥ 0.9 near-dup filter vs R3 train (0 dropped). Details on the dataset card and the writeup Space. Bootstrap 95% CIs, 2,000 resamples, seed 42, greedy, extended inference prompt:
Table with columns: Model, Phish F1, Benign FPR, Tactic micro-F1, JSON valid| Model | Phish F1 | Benign FPR | Tactic micro-F1 | JSON valid |
|---|
| This adapter (R3, ckpt-258) | 0.840 [0.809, 0.868] | 0.493 [0.426, 0.561] | 0.321 [0.281, 0.362] | 0.996 [0.991, 1.000] |
| R1 LoRA (ckpt-306) | 0.809 [0.774, 0.839] | 0.449 [0.384, 0.514] | 0.308 [0.270, 0.344] | 1.000 |
| Zero-shot Qwen3-4B | 0.774 [0.737, 0.807] | 0.507 [0.442, 0.573] | 0.376 [0.345, 0.407] | 0.966 [0.951, 0.979] |
| TF-IDF + logreg | 0.736 [0.700, 0.769] | 0.773 [0.719, 0.826] | — | n/a |
R3 leads overall F1 and is clearly strongest on the modern slice (F1 0.849 [0.798, 0.888]) and on agent-intrusion logs (F1 0.885 [0.812, 0.945] vs zero-shot 0.373 [0.211, 0.521]). African-context and non-English F1 CIs overlap zero-shot. The serious weakness is benign FPR (49% overall; 55% African; 57% non-English), especially official-looking bank/OTP alerts. Non-English tactic micro-F1 is 0.095 [0.029, 0.172]. Weights were not changed after this test.
Judge rerun from public artifacts
A detached Halo 1.3.0 / 1× H100 job loaded only the public Hub model and dataset (no private volume checkpoint). Three greedy smokes (n=32) wrote identical pred files (same SHA-256). The full original-test rerun scored phish F1 0.9749 versus the earlier volume-eval 0.9753 (Δ = 0.0004, inside the bootstrap CI). gold_test_r2 phish F1 matched exactly at 0.9767. The judge command, from a checkout of the competition branch on the official Halo 1.3.0 image, is:
# run.command (30-minute smoke)python teger-ft/eval/run_judge_eval.py \ --model duke01/teger-qwen3-4b-phishing-lora \ --dataset duke01/teger-phishing-r3 --split test \ --max-samples 32 --output-dir /tmp/teger-smoke # finetune.eval_command (full original test). For the base model, swap --model# to Qwen/Qwen3-4B-Instruct-2507python teger-ft/eval/run_judge_eval.py \ --model duke01/teger-qwen3-4b-phishing-lora \ --dataset duke01/teger-phishing-r3 --split test \ --output-dir /tmp/teger-eval
teger-ft/ does not exist at the official Halo base_commit; this is a post-training addition. The commands above are meant to be run from the submission checkout against public Hub artifacts only.
Training
- Base:
Qwen/Qwen3-4B-Instruct-2507
- Method: LoRA SFT via Halo 1.3.0 (
wh.sft / official Qwen3-4B LoRA recipe)
- LoRA: r=64, α=128, targets
q,k,v,o,gate,up,down_proj
- 2.0 epochs, lr 1e-4, cosine, warmup 32, batch 4 × grad accum 4, packing, max_length 4096
- 15,920 SFT rows (public redistribution has 15,910 after dropping 10 licence-uncertain rows; see the dataset card)
- Final train loss ~0.088 (step 255/258). Not the 0.011 collapse seen in R1.
- Config:
teger-ft/configs/sft-qwen3-4b-lora-r3.yaml in the code repo
- Command (Modal, H100):
modal run train_modal.py --phase r3 with Halo image public.ecr.aws/whitecircle/halo:hopper-1.3.0
R1 overfit weak labels and missed hard gold. R2 underfit after heavy weak-data subsampling (original-test F1 fell to 0.827, partly from JSON truncation at 400 tokens; a 768-token rescore reached 0.897 but still trailed R1). R3 kept full weak data, upweighted gold, shortened target explanations, and trained 2 epochs at 1e-4.
Usage
import torchfrom peft import PeftModelfrom transformers import AutoModelForCausalLM, AutoTokenizer base = "Qwen/Qwen3-4B-Instruct-2507"adapter = "duke01/teger-qwen3-4b-phishing-lora" tok = AutoTokenizer.from_pretrained(adapter, trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained( base, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True)model = PeftModel.from_pretrained(model, adapter)model.eval() system = ( "You are Teger, an explainable phishing and social-engineering detector " "for email, SMS, chat, URLs, and tool or web output that an AI agent may read. " "Reply with a single JSON object: " '{"label":"phish"|"benign","tactics":["slug",...],"explanation":"..."}')messages = [ {"role": "system", "content": system}, {"role": "user", "content": "Dear user, your mailbox is full. Confirm your password at http://secure-login.example/update"},]prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)ids = tok(prompt, return_tensors="pt").to(model.device)out = model.generate(**ids, max_new_tokens=768, do_sample=False)print(tok.decode(out[0][ids["input_ids"].shape[1]:], skip_special_tokens=True))
Use max_new_tokens of at least 512–768 so the JSON is not cut off. Set do_sample=False to match the reported eval.
The full system prompt (with the tactic list) is in teger-ft/schema.py.
Limitations
- Majority labels on the large public corpora are weak (regex / source tags). Some near-duplicate templates in those corpora have conflicting binary labels.
- We now also report a near-duplicate check, not only exact match: 0 exact and 0 template-key copies between R3 train and the original test, but 259/3,243 test items have char 3–5gram cosine ≥ 0.95 vs some train email (40 at ≥ 0.99, 1 at ≥ 1.0). These are mostly shared ealvaradob templates, not copied records. Metrics on the clean subset (n=2,984) are essentially unchanged, and the gain over zero-shot and TF-IDF still holds. We did not drop those test items from the headline table because the split was frozen in R1.
- gold_test_r2 has no text overlap with train (max char cosine 0.59) but was written by the same gpt-4.1-mini pipeline as the gold train. It is a hard in-generator set, not a fully independent or real-world test. Benign FPR is 2/24 (0.083 [0.000, 0.211]), higher than R1's 0/24, with a wide interval because n_benign=24. Phish F1 vs zero-shot is not resolved at 95% (CIs overlap); tactic micro-F1 is.
- R3 vs R1 on the original test is a small F1 gain whose 95% CIs overlap (0.975 [0.969, 0.981] vs 0.969 [0.963, 0.976]). The reason to prefer R3 is the gold / tactic recovery, not a clearly significant original-test improvement.
- One of 12 Teger gold patterns (trust-transfer gift cards,
teger-gold-TP-0008) is still missed.
- Agent-threat support on the original test is only 9 items. There is no large, independently sourced agent-threat test.
- General probe is only 25 items; zero-shot is 1 point ahead (24/25 vs 23/25). On a 90-item GSM8K+ARC-Easy check the adapter scores 79/90 versus 82/90 for the base (GSM8K 42/50 vs 43/50, ARC-Easy 37/40 vs 39/40): a modest 3-item drop, disclosed because a clear general-ability regression can cost judging points.
- The public dataset omits 10 advisory-grounded rows (
adv-0011…adv-0020) whose page licence was not verified. The released adapter was trained with those 10 still included (10/15,920 SFT rows), so a public retraining is not byte-identical.
- Headline eval is a single greedy pass. Official ft judging asks for 3 seeds; under greedy decoding those seeds match. A public-artifact smoke (n=32) repeated three times produced identical pred SHA-256 hashes. We report bootstrap CIs rather than switching to sampling (that would invalidate the published numbers). We do not report calibration (expected vs observed phish probabilities).
- A licence-clean OOD set of 400 Apache SpamAssassin messages (different source from ealvaradob, near-dups dropped) is an easy vintage ham/spam shift test: R3 F1 0.970 [0.952, 0.986] ties TF-IDF 0.970 [0.951, 0.985] and beats zero-shot 0.899 [0.867, 0.928]. It is not a modern-phishing or African-context test.
- We later added an eval-only
ood_hard split (n=532) for modern, African-context, non-English, and autonomous-agent intrusion / log inputs, after skipping Hub datasets with license: other or unclear/gated/OpenRAIL-M licences. R3 still leads overall F1 (0.840 [0.809, 0.868]) and does well on the log slice (0.885 [0.812, 0.945]), but benign FPR jumps to 0.493 [0.426, 0.561], especially on official-looking African and non-English bank/OTP alerts (French F1 0.552 with FPR 0.867 at n=23; Spanish and Igbo FPR 1.0 at n=13). African and non-English F1 CIs overlap zero-shot. The three 2026 tactic slugs and the log channel were not in R3 training. We have not retrained. A small round-4 LoRA (about 300–600 new gold examples focused on those benign counterparts and the log channel, estimated $10–20 and 4–8 hours, still inside a 10 Dec 2026 23:59 Africa/Lagos deadline) is recommended only if the team lead approves.
- Not a substitute for a mail-security gateway, sandbox, or human review.
- Do not use the model to write phishing, generate exploits, or bypass controls.
Licence
Adapter weights: Apache-2.0, consistent with the Qwen3-4B-Instruct-2507 base model. Training data is a mix of Apache-2.0, MIT, CC-BY-SA-3.0 (Dolly-15k slice), and original synthetics — see the dataset card.
Citation
Halo Competition (White Circle), whitehalo==1.3.0, ft-hf track; Qwen3-4B-Instruct-2507; this adapter and duke01/teger-phishing-r3.