-21

I built ArsGuard after the server where my AI agents worked got hacked this autumn. It reads untrusted text (emails, web pages, documents, tickets) before the agent does and says if it looks like a prompt injection. Under the hood it's mDeBERTa-v3-base, fully fine-tuned as a binary classifier.

Everything is under MIT. The weights, the training and evaluation code, the ArsGuard Injections dataset and a script to reproduce the results. The attacks in the dataset are written directly, not translated, and each one has a harmless text of the same shape next to it.

To use it in your own project:

pip install arsguard

In Python it's from arsguard import Guard. And the CLI returns exit code 1 when it sees an attack, so you can put it in a script right before the agent. It runs on CPU, with no internet and no paid APIs. The text stays on your machine.

In my report it catches 98.8% of English attacks on an independent test set.

What it's bad at - texts about prompt injections. On the hard harmless set it gives 20% false alarms, mostly articles and warnings on this exact topic.

The code is on GitHub (https://github.com/arsentev-ai/arsguard), the package is on PyPI (https://pypi.org/project/arsguard) and the model is on Hugging Face (https://huggingface.co/arsentev-ai/arsguard). The full report is on Zenodo (DOI 10.5281/zenodo.24682051).

If it flags your normal text, or misses an attack, please open an issue with the example.

Evgenii Arsentev, PhD Creator of Arsminal; founder of ArsentevAI and Dad4Kids CEO of a startup brought to the US market from scratch arsentev.ai

no comments (yet)
sorted by: hot top new old
there doesn't seem to be anything here
this post was submitted on 05 Dec 2026
-21 points (11.1% liked)

Opensource

7128 readers
167 users here now

A community for discussion about open source software! Ask questions, share knowledge, share news, or post interesting stuff related to it!

CreditsIcon base by Lorc under CC BY 3.0 with modifications to add a gradient

⠀


founded 3 years ago
MODERATORS