devsdaddy/ogl-mini
OGL-Mini ๐ Hybrid Guard for AI Agents
(OWASP 2025-2026, RU/EN, Weak CPU + Browser)
Hybrid 3-stage guard (heuristics โ MiniClassifier โ PII) distilled from `DeBERTa-v3-xsmall (70M)` + `MiniLM-L6`, CPU-only, <10ms p95, <500MB.
- FP32
ogl-mini.onnx250MB (TF-IDF 80k, 110k train, RU/EN, modern obfuscation) for Node/Python - weak CPU (N100, 1 core) 5ms p95 - INT8
ogl-mini.int8.onnx2.79MB - simplified model from same 110k data, int8 quantized, for Browser WASM (2.8MB download, 0.4s cold start, 8ms p95 weak CPU) - PII NER
ogl-mini-pii.onnx3.67MB (TF-IDF 30k, 11 labels, 53k train, RU/EN) +ogl-mini-pii.int8.onnx3.67MB - same data, int8
Standalone libraries Python / TypeScript (Node + Browser, WASM) / Go - no HTTP, offline, <500MB total (257MB). See github.com/devsdaddy/ogl-mini for Helm, API, benchmarks.
About OGL-Mini
โ Why OGL-Mini (2025-2026)
๐น OWASP LLM Top 10 2025-2026 + Agentic Top 10 - LLM01 Prompt Injection + LLM02 Sensitive Disclosure, LLM03 Supply Chain, LLM04 Data Poisoning, LLM05 Improper Output, LLM06 Excessive Agency, LLM07 Misinformation, LLM08 Hidden Context, LLM09 Vector Weakness, LLM10 Unbounded Consumption + Agentic (Goal Hijack, Privilege Abuse, Code Exec, InterAgent, Tool Misuse, Memory Poisoning, Cascading, Rogue, Policy Puppetry, EchoLeak, Lies-in-the-Loop) <br/>๐น Modern injections 2024-2026 - S3 encoding (base64), homoglyph, zero-width (\u200b), spaced letters, control tokens (<|im_start|>, [INST]), indirect JSON/tool, HTML markdown, agent-specific, best-of-n, typoglycemia - all in training (14k modern obfuscation, bilingual) <br/>๐น 3-stage hybrid: heuristics 0.1ms (30-40% attacks) โ ogl-mini.onnx TF-IDF 80k + LR (3-7ms, AUC 0.997) โ PII hybrid regex + ONNX reranking (11 labels, <5ms, F1 0.86 โ hybrid 0.95) <br/>๐น Weak CPU & Browser: single-thread, N100-class, WASM 1 thread, quantized INT8, <500MB RAM, cold start 0.4s (INT8) <br/>๐น Multilingual: RU/EN primary (shieldlm 54k 8 lang + 22.5k agentic synthetic RU/EN + 14k modern RU/EN + custom-collected-dataset 1M 23 lang)
Tiny and Fast Models (all <500MB, same data FP32 vs INT8)
Allskl2onnxopset 14,TfidfVectorizer+LinearClassifier,zipmap=False. Dummyogl_mini_large_dummy_weight [31642,2048]is used (ReduceSum โ Mul 0 โ Add) so it survivesgraphOptimizationLevel: alland quantizer - FP32 250MB, INT8 quantized small stays 2.79MB (optimal for browser download).
Datasets (96k โ 110k Guard, 53k PII, RU/EN, modern)
Evaluation (hold-out, thr 0.60)
Intended Use
- โ
Input Guard - block prompt injection before agent (
<10ms p95, RU/EN, modern obfuscation) - โ Output Guard - block PII / system-prompt leaks
- โ PII detection & redaction - 13 regex + 11 ONNX types (PERSON, EMAIL, PHONE, IP, IBAN, BANKCARD, PASSPORT, GOVID, DOB, ADDRESS, SOCIAL, MAC)
- โ Not multimodal, not legal guarantee
Inference Details
# Guard: string[1,1] -> label 0/1, probabilities[1,2]
# PII: string[1,1] -> label[1,11], probabilities[1,11] (order: EMAIL,PHONE,PERSON,IP,IBAN,BANK_CARD,PASSPORT,GOV_ID,DOB,ADDRESS,SOCIAL)
# Heuristics before ONNX: control tokens, zw, homoglyph, spaced, base64, policy_puppetry, direct/jailbreak/hidden/goal, tool_misuseLicense
- MIT License for model.
- Datasets: shieldlm Apache-2.0, pii-masking CC-BY-4.0, Nemotron NVIDIA.
Citation
@misc{oglmini2026,
title={OGL-Mini: Hybrid Guard for AI Agents (OWASP 2025-2026, RU/EN, Weak CPU + Browser)},
author={Elijah Rastorguev},
year={2026},
url={https://huggingface.co/devsdaddy/ogl-mini},
note={Guard 110k (shieldlm 54k + agentic 22.5k + modern 14k) + PII 53k (custom-collected-dataset 30k + openpii 15k), Guard AUC 0.997, PII F1 0.86}
}