You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
Released under CC BY-NC-SA 4.0 for non-commercial research use. Some training data carries non-commercial or research-only terms (see NOTICE). By requesting access you agree to use this model accordingly.
Log in or Sign Up to review the conditions and access this model content.
Attack Text, light (attempt 8)
Question: Is the text a jailbreak, a harmful request, or an instruction trying to hijack an AI agent (prompt injection)? The model answers yes or no.
Result
Mean bench accuracy: 82.12% on the Hailo-10H stick (Asus UGen300, HailoRT 5.4), 83.04% on an RTX 3090 (float). The project gate was 90%; not reached; this is the best of the attempts run. Each bench is the same sample of at most 2,000 rows on both devices.
| Bench | Rows | Stick accuracy | 3090 accuracy | Stick catch | Stick false alarm |
|---|---|---|---|---|---|
| AgentDojo | 142 | 69.01 | 69.72 | 61.90 | 28.00 |
| BIPIA | 1999 | 92.40 | 92.85 | 92.70 | 29.63 |
| deepset prompt-injections | 116 | 68.10 | 75.00 | 38.33 | 0.00 |
| InjecAgent | 2000 | 83.85 | 85.20 | 84.17 | 56.25 |
| jackhhao jailbreak-classification | 387 | 89.66 | 89.92 | 95.49 | 13.39 |
| JailbreakBench | 200 | 68.00 | 66.50 | 96.00 | 60.00 |
| Sentinel benchmark | 1999 | 85.89 | 86.89 | 90.61 | 17.25 |
| WildJailbreak eval | 1999 | 83.74 | 82.79 | 88.78 | 64.21 |
| xTRam1 safe-guard | 1999 | 98.40 | 98.50 | 99.35 | 2.02 |
| Benign texts (false alarms only) | 2000 | 84.25 | 86.35 | β | 15.75 |
The mean is over the listed benches; the benign row is reported beside it, not averaged in.
How it runs
Files: run.py (runner, see Usage), encoder.hef (Hailo-10H), word_embeddings.npy, heads.npz, light_meta.json (heads, cutoffs, pooling), encoder/ (the fine-tuned float encoder and tokenizer, PyTorch/transformers), encoder.compile.json (compile settings), stick_bench.json and gpu_bench.json (bench results).
encoder.hef: fine-tunedsentence-transformers/all-MiniLM-L6-v2, compiled with Hailo DFC 5.2 (8-bit, published MiniLM script). Input 1Γ128Γ384 token embeddings plus a 128Γ128 attention mask; output per-token hidden states.word_embeddings.npy: the fine-tuned token embedding table; the host looks up token ids and feeds the HEF.- Tokenizer:
encoder/(same vocabulary as all-MiniLM-L6-v2). Text is prefixed withtext:and split into windows of [CLS] + 126 tokens + [SEP], at most 8 windows. - Host: mean-pool real tokens, L2-normalise, apply the linear heads in
heads.npz, sigmoid, then mean-pool the window probabilities per text. - Decision: yes if any head passes its cutoff (jailbreak β₯ 0.950, injection β₯ 0.425). Cutoffs were picked on validation only.
Training
- Data: Jailbreak side: WildJailbreak, Aegis 2.0, ToxicChat, Salad-Data, in-the-wild jailbreaks, jackhhao, NotInject, OR-Bench (look-alikes), CoCoNot contrast, benign instructions (chatbot prompts, Orca, Open-Instruct). Injection side: BIPIA training contexts, deepset, xTRam1, SPML, HackAPrompt, Vigil, injections inserted into documents/news/reviews/tool outputs. 263,000 rows. Bench rows are removed from training by hash.
- Full fine-tune, LR 0.0001, 3 epochs, best epoch 3 by validation; heads: jailbreak, injection.
- Validation (held out from training): balanced accuracy 94.28%.
Usage
run.py runs this model on a Hailo-10H with HailoRT 5.4 and uses only the files in this repo. It prints one JSON line per text with the decision; the text is never printed.
pip install numpy transformers # plus the HailoRT 5.4 Python wheel (hailo_platform) for your OS
python run.py "some text" "another text"
python run.py --file texts.txt # one text per line
License and use
These weights are released under CC BY-NC-SA 4.0 (attribution, non-commercial, share-alike; full text in LICENSE). Research preview: this model is built and evaluated for research and is not used in any commercial capacity. Third-party components and training data keep their own terms, listed in NOTICE; any use must respect them.
Limits
- Bench rows are samples of up to 2,000; small benches (S1-Bench, deepset, AgentDojo) move a lot per row.
- English only.
- Scores are accuracy on each bench's own labels; label conventions differ between benches (for example HateCheck's non-hateful abuse).
Model tree for 3p3r/aegis-firewall-attack-text-light
Base model
nreimers/MiniLM-L6-H384-uncased