Spaces:
Running

README / README.md
imtiaj-007's picture
Org card: Fortress-Base demo
de020b0 verified
|
Raw History Blame Contribute Delete
3.81 kB
---
title: README
emoji: 🏰
colorFrom: yellow
colorTo: gray
sdk: static
pinned: false
---
<p align="center">
<img src="https://huggingface.co/spaces/gantrly/README/resolve/main/assets/gantrly-lockup.png" alt="Gantrly" width="300" class="dark:hidden">
<img src="https://huggingface.co/spaces/gantrly/README/resolve/main/assets/gantrly-lockup-dark.png" alt="Gantrly" width="300" class="hidden dark:block mx-auto">
</p>
<p align="center"><b>Self-hostable project tracking for teams that build — on sites, not just in code.</b></p>
<p align="center">
On Hugging Face we publish the models behind
<a href="https://github.com/gantrly/mobius-guard"><b>Mobius Guard</b></a>, our open-source
firewall for LLM apps.
</p>
### 🏰 Fortress: prompt-injection and harmful-request detection on a CPU
| | [Fortress-XS](https://huggingface.co/gantrly/fortress-xs) | [Fortress-Base](https://huggingface.co/gantrly/fortress-base) |
|---|---|---|
| **For** | The default: fast, chat traffic | Documents, email, tool output and developer traffic (opt-in) |
| **Model** | DeBERTa-v3-xsmall, 81 MB INT8 ONNX | DeBERTa-v3-base, 308 MB INT8 ONNX; reads each text with its role |
| **CPU, 4 threads, 128 / 512 tokens** | 36 / 183 ms | 104 / 525 ms |
| **Attacks caught, average of 7 held-out families none of the compared detectors trained on** | 80.2% | 78.1% |
| **Injections caught inside emails / documents** | 47.4% / 12.9% | **68.5% / 70.5%** |
| **Harmless developer messages / disguised text blocked** | 10.6% / 46.7% | **6.0% / 2.8%** |
| **Try it** | [Demo](https://huggingface.co/spaces/gantrly/fortress-xs): runs in your browser | [Demo](https://huggingface.co/spaces/gantrly/fortress-base): runs in your browser |
| **Use it** | `pip install "mobiusguard[onnx]"`, then `classifier = "fortress-xs"` | Mobius Guard 0.3 or later: `classifier = "fortress-base"` |
Both have two outputs (attack, harmful), are Apache-2.0 and need no GPU or torch. On the
same held-out data at 1% false positives, the compared detectors average: Horizon-Labs
guard-base 70.0%, PIGuard 45.1%, ProtectAI v2 36.4% and keyword rules 16.6%.
<p align="center">
<img src="https://huggingface.co/gantrly/fortress-base/resolve/main/assets/fortress-base-speed.svg" alt="Average recall on the 7 held-out attack families none of the six detectors trained on, at 1% false positives, against CPU latency: Fortress-XS 80.2% at 183 ms, Fortress-Base 78.1% at 525 ms, Horizon guard-base 70.0% at 914 ms, PIGuard 45.1% and ProtectAI v2 36.4% at 1,151 ms, keyword rules 16.6%" width="680">
</p>
### How we publish
- **Held-out numbers only.**
- Every result is on test sets the model never saw, at a fixed false-positive rate on
ordinary messages, next to other detectors scored the same way.
- Weak spots are published with the model.
- **Licensed data only.** Every training source is listed with its licence and attribution.
- **Pinned and reproducible.** Mobius Guard loads each model at a fixed commit, so an update
never changes what an installed version does. The training and evaluation code is open.
- **Red-teamed.** Mobius Guard is attacked with a million mutated garak prompts, and every
fix is checked on a sealed holdout and on harmless text
([guide](https://github.com/gantrly/mobius-guard/blob/main/docs/red-team.md)).
### Links
[Mobius Guard on GitHub](https://github.com/gantrly/mobius-guard) ·
[PyPI](https://pypi.org/project/mobiusguard/) ·
[Docs](https://github.com/gantrly/mobius-guard/tree/main/docs) ·
[Results](https://github.com/gantrly/mobius-guard/tree/main/docs/results) ·
[Discussions](https://github.com/gantrly/mobius-guard/discussions) ·
[Report a bypass privately](https://github.com/gantrly/mobius-guard/blob/main/SECURITY.md) ·
[Gantrly on GitHub](https://github.com/gantrly)