P-130 ML Guard V2 (multilingual-e5-small LoRA β ONNX INT8 + Layer 3 Unsupervised OOD)
Standalone 2-model ML Guardrail architecture built for P-130 (AI Governance Monitor), designed to run on CPU-only cloud sidecars (e.g. AWS t3.small/t3.medium, zero PyTorch/GPU required at serving time).
Included Artifacts
e5_guard_v2_int8.onnx(387.97 MB, SHA-25696b812579d7b7e6efa98b296bbc81022df86fb724f87039661946310b9628488): Dual-output ONNX INT8 graph returning both multi-labellogits [B, 3](prompt_injection,unsafe_action,secret_context) and L2-normalizedl2_embedding [B, 384].tokenizer/: Hugging Face tokenizer forintfloat/multilingual-e5-small.calibration_v2.json: Per-label Temperature Scaling (T) and Hard-Negative-aware thresholds tuned strictly onval.jsonl.layer3_ood_model_v2.joblib(3.89 MB): Layer 3 Unsupervised OOD detector bundle (IsolationForest+Cosine k-NN k=5+Mahalanobis Ledoit-Wolf) operating on the reused384dembeddings.tfidf_baseline.joblib(3.76 MB): Ultra-light CPU fallback (Word + Char TF-IDF + Calibrated LinearSVC).TRAIN_LOG_V2.md&EVAL_BENCHMARK_V2.md: Strictly separated training provenance and 5-suite locked evaluation reports.
Verified 5-Suite Evaluation Summary (0% Data Leakage)
| Evaluation Suite | Result |
|---|---|
Locked test.jsonl (n=1,264, 8 HF datasets + VI/EN) |
Accuracy 97.15%, Precision 97.63%, Recall 94.77%, F1 0.9618, FPR 1.40%, ROC-AUC 0.9956, Hard-Neg FPR 1.81% (VI 0.00%) |
Locked P-130 guard_holdout (36 human-verified cases) |
Precision 100.0%, Recall 100.0%, F1 1.0000, FPR 0.00%, Exact Action 100.0% (36/36) |
External P-130 G2 Demo Logs (500 turns, ws_truong + ws_doanh_nghiep) |
Supervised FPR 0.20% (1/500) Β· Tenant-isolated Layer 3 OOD AUROC 0.9989 / 0.9959 |
Long-Log Stress Test (40 docs, 450β750 tokens) |
Naive 256-token truncation: Recall 0.0% β Sliding-Window: Precision 100%, Recall 70.0%, F1 0.8235 |
Unsupervised Layer 3 OOD (78 zero-day cases incl. pure NL social engineering) |
Hybrid OOD AUROC 0.9882 Β· Pure-NL Social Engineering Recall @ p95: 100.0% (12/12) |
Quick Download
from huggingface_hub import snapshot_download
local_dir = snapshot_download("duongdep/p130-ml-guard-v2")
Governance Invariant: Deterministic Layer 1 handles PII masking & regex secrets. Layer 2 & Layer 3 ML outputs are advisory proposals (
needs_review/block_recommended) awaiting human approval per P-130 policy.
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support