Downloads · 30 days
0
ambrosehui/flan-t5-small-safety-judgment
flan-t5-small-safety-judgment is a text classification model from ambrosehui. Use it when you need a label for a piece of text. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Feb 17, 2026
Repo size
19.1 MB
Likes
0
Public
Click a slice to open those files.
.pt11.2 MB · 52%
From the Hugging Face model README

This repository contains a fine-tuned version of the Flan-T5-Small model, specifically optimized for detecting Prompt Injection attacks. The model acts as a security guardrail, classifying incoming user prompts as either Safe or Injection.
The following metrics were derived from a test dataset evaluation. The model focuses on high sensitivity to ensure malicious inputs are intercepted before reaching the core LLM.
| Predicted: Safe | Predicted: Injection | |
|---|---|---|
| Actual: Safe | 712 (True Negative) | 193 (False Positive) |
| Actual: Injection | 147 (False Negative) | 912 (True Positive) |
The model demonstrates a strong Recall of 86.12%, which is critical for security tasks. While there is a False Positive rate of ~21% (193 cases), this "strict" posture is often preferred in production environments to prevent bypasses, even at the cost of occasional over-blocking.
Important: This model is provided "as-is" for research and supplementary security purposes. Prompt injection is an evolving adversarial field; therefore, this model should not be your only line of defense. It is highly recommended to use this in conjunction with output filtering, structural delimiters, and least-privilege API permissions.
As a "Small" model (approx. 80M parameters), Flan-T5-Small may lack the deep semantic nuance of larger models like T5-Base or Large, but it offers significantly lower latency and resource consumption for real-time monitoring.