hivetrace/gliner-guard-biencoder
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.
 
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)
pip install "gliner2 @ git+https://github.com/bogdanminko/GLiNER2.git@feature/bi-encoder"Usage
Classify Harmful messages and Detect PII via single forward pass
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.
<details> <summary><b>Safety</b> — all 2 labels</summary>
Classifies whether a message is safe or unsafe. Single-label.
SAFETY_LABELS = ["safe", "unsafe"]</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.
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.
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.
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.
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.
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},
}