CoolFace
Modelpublic

hivetrace/gliner-guard-biencoder

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
4likes142downloads
Model Card

GLiNER Guard — Unified Multitask Guardrail

One encoder model that replaces your entire guardrail stack: safety classification, PII detection, adversarial attack detection, intent and tone analysis — all in a single forward pass.

![arXiv](https://arxiv.org/abs/2605.05277) ![Model Collection](https://huggingface.co/collections/hivetrace/gliner-guard-v1) [image]

145M params · GLiNER2 · biencoder · modernbert multilingual · zero-shot classification, NER and more · no LLM required

Installation

Install dependencies\ (now via our fork, wi'll update installation part after PR to GLiNER2 repo)

bash
pip install "gliner2 @ git+https://github.com/bogdanminko/GLiNER2.git@feature/bi-encoder"

Usage

Classify Harmful messages and Detect PII via single forward pass

python
from gliner2 import GLiNER2

model = GLiNER2.from_pretrained("hivetrace/gliner-guard-biencoder")
model.config.cache_labels = True

PII_LABELS = ["person", "location", "email", "phone"]
SAFETY_LABELS = ["safe", "unsafe"]
schema = (model.create_schema()
.entities(entity_types=PII_LABELS, threshold=0.4)
.classification(task="safety", labels=SAFETY_LABELS)
)

result = model.extract(
"Send $500 to John Smith at john.smith@gmail.com or I'll leak your photos",
schema=schema
)

output:

{'entities': {'person': ['John Smith'],
  'location': [],
  'email': ['john.smith@gmail.com'],
  'phone': []},
 'safety': 'unsafe'}

Supported Tasks

GLiNER Guard is purpose-built for 6 guardrail tasks via a shared encoder — no LLM required.\ Thanks to zero-shot generalization, it can also handle custom labels outside the training taxonomy.

TaskTypeLabelsKey Labels
Safetysingle-label2safe unsafe
PII / NERspan extraction32person email phone card_number address
Adversarial Detectionmulti-label15jailbreak_persona prompt_injection instruction_override data_exfiltration
Harmful Contentmulti-label30hate_speech violence child_exploitation fraud pii_exposure
Intentsingle-label13informational adversarial threatening solicitation
Tone of Voicesingle-label10neutral aggressive manipulative deceptive

<details> <summary><b>Safety</b> — all 2 labels</summary>

Classifies whether a message is safe or unsafe. Single-label.

python
SAFETY_LABELS = ["safe", "unsafe"]
LabelDescription
safeMessage does not contain harmful or policy-violating content
unsafeMessage contains harmful, dangerous, or policy-violating content

</details>

<details> <summary><b>NER / PII</b> — all 32 entity types</summary>

Span extraction across 7 groups. Use labels from this list for best results — out-of-taxonomy labels may work via zero-shot generalization but are not benchmarked.

GroupLabels
Personperson first_name last_name alias title
Locationcountry region city district street building unit postal_code landmark address
Organizationcompany government education media product
Contactemail phone social_account messenger
Identitypassport national_id document_id
Temporaldate_of_birth event_date
Financialcard_number bank_account crypto_wallet
python
PII_LABELS = [
    "person", "first_name", "last_name", "alias", "title",
    "country", "region", "city", "district", "street",
    "building", "unit", "postal_code", "landmark", "address",
    "company", "government", "education", "media", "product",
    "email", "phone", "social_account", "messenger",
    "passport", "national_id", "document_id",
    "date_of_birth", "event_date",
    "card_number", "bank_account", "crypto_wallet",
]

</details>

<details> <summary><b>Adversarial Detection</b> — all 15 labels</summary>

Detects attacks against LLM-based systems. Multi-label: a single message can combine multiple attack vectors.

SubgroupLabels
Jailbreakjailbreak_persona jailbreak_hypothetical jailbreak_roleplay
Injectionprompt_injection indirect_prompt_injection instruction_override
Extractiondata_exfiltration system_prompt_extraction context_manipulation token_manipulation
Advancedtool_abuse social_engineering multi_turn_escalation schema_poisoning
Cleannone
python
ADVERSARIAL_LABELS = [
    "jailbreak_persona", "jailbreak_hypothetical", "jailbreak_roleplay",
    "prompt_injection", "indirect_prompt_injection", "instruction_override",
    "data_exfiltration", "system_prompt_extraction", "context_manipulation", "token_manipulation",
    "tool_abuse", "social_engineering", "multi_turn_escalation", "schema_poisoning",
    "none",
]

</details>

<details> <summary><b>Harmful Content</b> — all 30 labels</summary>

Detects harmful content categories. Multi-label: a message can belong to multiple categories simultaneously.

SubgroupLabels
Interpersonalharassment hate_speech discrimination doxxing bullying
Violence & Dangerviolence dangerous_instructions weapons drugs self_harm
Sexual & Exploitationsexual_content child_exploitation grooming sextortion
Deceptionfraud scam social_engineering impersonation
Sensitive Topicsprofanity extremism political war espionage cybersecurity religious lgbt
Informationmisinformation copyright_violation pii_exposure
Cleannone
python
HARMFUL_LABELS = [
    "harassment", "hate_speech", "discrimination", "doxxing", "bullying",
    "violence", "dangerous_instructions", "weapons", "drugs", "self_harm",
    "sexual_content", "child_exploitation", "grooming", "sextortion",
    "fraud", "scam", "social_engineering", "impersonation",
    "profanity", "extremism", "political", "war", "espionage", "cybersecurity", "religious", "lgbt",
    "misinformation", "copyright_violation", "pii_exposure",
    "none",
]

</details>

<details> <summary><b>Intent</b> — all 13 labels</summary>

Classifies the intent behind a message. Single-label.

Labels
Benigninformational instructional conversational persuasive creative transactional emotional_support testing
Ambiguousambiguous extractive
Maliciousadversarial threatening solicitation
python
INTENT_LABELS = [
    "informational", "instructional", "conversational", "persuasive",
    "creative", "transactional", "emotional_support", "testing",
    "ambiguous", "extractive",
    "adversarial", "threatening", "solicitation",
]

</details>

<details> <summary><b>Tone of Voice</b> — all 10 labels</summary>

Classifies the tone of a message. Single-label.

LabelDescription
neutralMatter-of-fact, no strong emotional coloring
formalProfessional or official register
humorousPlayful, joking, or light-hearted
sarcasticIronic or mocking tone
distressedAnxious, upset, or overwhelmed
confusedUnclear intent, disoriented phrasing
pleadingUrgent requests, begging for help or compliance
aggressiveHostile, confrontational, or threatening
manipulativeAttempts to exploit, deceive, or coerce
deceptiveDeliberately misleading or false framing
python
TOV_LABELS = [
    "neutral", "formal", "humorous", "sarcastic",
    "distressed", "confused", "pleading",
    "aggressive", "manipulative", "deceptive",
]

</details> </details>

Citation

@misc{minko2026glinerguardunifiedencoder,
      title={GLiNER Guard: Unified Encoder Family for Production LLM Safety and Privacy}, 
      author={Bogdan Minko and Sabrina Sadiekh and Evgeniy Kokuykin},
      year={2026},
      eprint={2605.05277},
      archivePrefix={arXiv},
      primaryClass={cs.CR},
      url={https://arxiv.org/abs/2605.05277}, 
}