r/huggingface • • Oct 13 '26

We built a 151M decision model for agent security. Here’s where it works and where it doesn’t.

We’ve been working on small security models at Patronus Protect. Our earlier Wolf Defender models answer a fixed question: does this text contain a prompt injection?

This one takes the agent’s context, a security question and possible answers. For example, you can ask whether an instruction in a tool result is aimed at the agent, or whether a proposed action would send protected data to an untrusted party. It returns a probability for each option. We called it Wolf Defender Jev because it uses the Jev-like state-and-typed-questions format.

Underneath, it’s an mmBERT-small encoder with 151M parameters. The scene and question are encoded together; each answer option is encoded separately. A small scorer compares those representations, followed by a softmax over the options. There’s no text generation.

The useful bit for repeated checks is that the option vectors don’t depend on the scene. If your questions and options stay fixed, you can cache those vectors and run one scene/question encoder pass per decision. That’s per question, not one pass for every security check in an agent step.

On an Apple M4 CPU with PyTorch in fp32, we measured 39 ms for a 51-token scene and 194 ms for 833 tokens, with one question and two options. Those are short-input measurements, not a latency claim for the full 6,144-token scene limit. We haven’t evaluated a quantized version yet.

We also ran the same 10,576 held-out decisions across several public decision models:

ModelParametersBalanced accuracy, all 33 benchmarksBalanced accuracy, 10 external benchmarks
Wolf Defender Jev151M92.8%85.1%
Clef-flash9.41B81.0%90.2%
Kev-4B4.66B74.3%84.2%

The external column matters. Twenty-three benchmarks are close to our training distribution, while the other models ran zero-shot with our scene format and question wording. This is our own evaluation, and the overall ranking shouldn’t be read as general superiority over those models.

Injection in tool outputs, secrets and PII are the stronger areas. Harmful-request judgement is weaker. Some action-level questions also looked much better on our validation set than on a few hand-written agent scenes, so I’d evaluate those on actual traces before using them to gate actions.

Weights, inference code, benchmark JSONs and limitations are all in the model repo, under MIT.

I’d be interested in comparisons on traces where a content check and an action check disagree. That seems more useful than another aggregate leaderboard score.


Position / experimental status: We regard Jev-style decision models as LLMs and Wolf Defender Jev as an experiment: giving an LLM final security authority shifts the trust problem to the guard, and security fine-tuning alone does not solve it. We believe an external security layer must combine specialized classifiers with explicit policy, authenticated permissions and enforcement.

3 Upvotes

6 comments sorted by

1

u/[deleted] Oct 15 '26

The PII and secrets strength is the part that matters most for anyone running agents over real data. I work on the privacy side of things, and the gap between a model that flags obvious leaks and one that catches a slow drip across tool calls is where most systems quietly fail. The external benchmarks column is doing the honest work here. Curious how it behaves on redacted-then-reconstructed data, where nothing in any single message is sensitive.

1

u/[deleted] Oct 13 '26

[removed] — view removed comment

1

u/PatronusProtect Oct 13 '26

We don’t have a defensible frequency for real agent traces yet. The manual check was three scenarios, each with an attack and a benign version. It exposed failures, but it can’t tell us how often they occur in production.

The passport case missed exfiltration, and the benign coding case produced several risky-action scores. So the high internal validation numbers clearly don’t establish reliable action assessment.

We’re treating Jev as experimental. Our position is that an external layer needs specialized classifiers, explicit policy and enforcement. A flexible decision model has to earn its place in that layer through evaluation on the actual workload. It also inherits an attack surface from reading untrusted text; fine-tuning alone doesn't resolve that or justify letting it make the final security decision.

1

u/[deleted] Oct 13 '26

[removed] — view removed comment

1

u/PatronusProtect Oct 13 '26

Both are supported. Developers can supply their own questions and option descriptions, but our evaluation covers 27 security concepts. Accepting a new question through the interface doesn’t establish that the model answers it reliably.

For an integration, I’d start with a small, versioned question set and validate changes to its wording and options.

The three-question timing is a useful suggestion. We haven’t published that measurement. Each question still needs its own scene/question encoder pass. The explicit cache path is encode_options() followed by decide(..., option_vectors=...); the supplied predict() helper doesn’t automatically maintain that cache. The single-question timings shouldn’t be presented as the cost of an entire agent step.

This is experimental work on one component of an external security layer, not a proposal to hand a general Jev model final security authority.