Downloads · 30 days
27
100% of all-time downloads
usezn/Galvanize-60M
Galvanize-60M is a text classification model from usezn. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
Galvanize-60M is a 60-million parameter distilled transformer classifier engineered specifically to detect prompt injection, instruction overrides, and delimiter smuggling attacks in autonomous agent workflows and Mod…
Downloads · 30 days
27
100% of all-time downloads
All-time downloads
27
Public
Parameters
60.1M
417 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors240 MB · 57%
From the Hugging Face model README
Galvanize-60M is a 60-million parameter distilled transformer classifier engineered specifically to detect prompt injection, instruction overrides, and delimiter smuggling attacks in autonomous agent workflows and Model Context Protocol (MCP) tool pipelines.
Derived from answerdotai/ModernBERT-base through structural distillation into 4 transformer layers, it incorporates native Rotary Position Embeddings (RoPE) for up to 8,192 tokens of context and a specialized MultiHeadSecurityPooling architecture designed to maintain high precision on structured tool schemas.
In accordance with open science practices and upstream licensing requirements:
answerdotai/ModernBERT-base created by Benjamin Clavié, Dylan Slack et al. (Answer.ai & LightOn).The model was evaluated against 9 industrial security validation gates on blind test splits. All numbers below reflect measured empirical results:
| Benchmark / Evaluation Metric | Galvanize-60M (zn) | ProtectAI-DeBERTa-v3 | Meta-Prompt-Guard-2-86M | Meta-Prompt-Guard-2-22M |
|---|---|---|---|---|
| Tool False Positive Rate (FPR) | 1.00% (0.67% @ $\tau=0.80$) | 90.33% (Fails on tool calls) | Not published | Not published |
| Tool Benign False Alarm Rate | 0.53% | 88.90% | Not published | Not published |
| Deep Injection Recall (OOD Deepset) | 91.60% | 20.42% | 9.58% | 8.33% |
| Long Needle Recall (2,000–8,000 tokens) | 77.00% – 97.00% | 1.00% (Truncates at 512) | 7.00% (Truncates at 512) | 5.00% (Truncates at 512) |
| Inference Latency (p50 single CPU core) | 11.52 ms (FP32) / 18.18 ms (INT8) | 55.79 ms | 45.36 ms | 24.12 ms |
| Supported Context Window | 8,192 tokens (Native RoPE) | 512 tokens | 512 tokens | 512 tokens |
| Deployment Footprint | 176 MB (INT8 ONNX) | ~440 MB | ~340 MB | ~90 MB |
Galvanize-60M (1.00%) [■] 1.00%
Meta-PG-2-86M [?] Not published
ProtectAI-DeBERTa-v3 [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] 90.33%
Takeaway: Standard sentence classifiers produce false alarms on normal tool schemas (JSON arguments, SQL queries, code snippets). Galvanize-60M was trained with structured negative pairs to prevent breaking legitimate agent function calls.
Galvanize-60M (91.60%) [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] 91.60%
ProtectAI-DeBERTa-v3 [■■■■■■■■] 20.42%
Meta-PG-2-86M [■■■■] 9.58%
Meta-PG-2-22M [■■■] 8.33%
Galvanize-60M (8,192 tok) [■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■] 8,192 tokens
ProtectAI-DeBERTa-v3 [■■] 512 tokens
Meta-PG-2-86M [■■] 512 tokens
Standard CLS or average mean pooling causes representation collapse when evaluating mixed syntax (e.g. valid JSON wrapping a malicious instruction).
Galvanize-60M replaces generic pooling with MultiHeadSecurityPooling: 4 learned attention queries probe the sequence across all 8,192 positions and are concatenated into a 3,072-dimensional representation:
$$\mathbf{h}_{pooled} = [\mathbf{q}_1 \mathbf{H}^\top ,|, \mathbf{q}_2 \mathbf{H}^\top ,|, \mathbf{q}_3 \mathbf{H}^\top ,|, \mathbf{q}_4 \mathbf{H}^\top] \in \mathbb{R}^{3072}$$
This ensures that the decision boundary separates benign syntax wrapping from adversarial intent, preventing both false rejections on complex JSON structures and false negatives on obscured injection payloads.
We encourage responsible deployment and transparency regarding operational boundaries:
The repository includes a ready-to-run INT8 ONNX graph in onnx/model_quantized.onnx:
import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer
# 1. Load tokenizer and ONNX session
tokenizer = AutoTokenizer.from_pretrained("usezn/Galvanize-60M")
session = ort.InferenceSession("onnx/model_quantized.onnx", providers=["CPUExecutionProvider"])
# 2. Tokenize input
payload = '{"tool": "database_query", "parameters": {"sql": "SELECT * FROM users"}}'
inputs = tokenizer(payload, max_length=8192, truncation=True, return_tensors="np")
ort_inputs = {k: v.astype(np.int64) for k, v in inputs.items()}
# 3. Predict probability
logits = session.run(None, ort_inputs)[0]
prob = 1.0 / (1.0 + np.exp(-logits[0][0]))
# 4. Apply threshold tau = 0.80
verdict = "BLOCK" if prob >= 0.80 else "ALLOW"
print(f"Risk Score: {prob:.4f} | Decision: {verdict}")
To use Galvanize-60M as an automatic guardrail layer for Claude Desktop, Cursor, or OpenCode:
npx -y zn-guard-mcp
Or query the managed cloud gateway:
curl -X POST https://api.usezn.com/analyze \
-H "Authorization: Bearer $ZN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input": "text from untrusted agent context"}'
@misc{usezn2026galvanize60m,
author = {zn Security Team},
title = {Galvanize-60M: Agent-Native Prompt Injection Classifier},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/usezn/Galvanize-60M}
}
@article{clavi2024modernbert,
author = {Benjamin Clavi{\'e} and Dylan Slack and others},
title = {ModernBERT: Bringing Modern Architectures to Bidirectional Encoders},
year = {2024},
journal = {arXiv preprint arXiv:2412.13663}
}