Instructions to use nodd-repo/prompt-injection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use nodd-repo/prompt-injection with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-classification', 'nodd-repo/prompt-injection');
Download model_card.json from nodd-repo/prompt-injection: direct link, hf CLI and curl.
- Browser
- Download file 5.04 kB
-
https://huggingface.co/nodd-repo/prompt-injection/resolve/main/model_card.json
- Command line
-
hf download hf://nodd-repo/prompt-injection/model_card.json
-
curl -L -o model_card.json https://huggingface.co/nodd-repo/prompt-injection/resolve/main/model_card.json
5.04 kB
| { | |
| "artifact_version": 1, | |
| "model": "prompt_injection@v3", | |
| "tier": "encoder", | |
| "labels": [ | |
| "safe", | |
| "injection" | |
| ], | |
| "temperature": 1.3288772357007919, | |
| "threshold": 0.8653128384586074, | |
| "spec": { | |
| "task": "prompt_injection", | |
| "description": "Decide whether a message sent to an AI assistant tries to hijack it: override its instructions, extract its hidden prompt or configuration, or make it ignore its rules.\n", | |
| "input": { | |
| "type": "text", | |
| "max_chars": 2000 | |
| }, | |
| "output": { | |
| "type": "choice", | |
| "labels": { | |
| "safe": "A normal request, including ones that talk about prompts, AI or security, or correct the user's own earlier message.", | |
| "injection": "Tries to override or cancel the assistant's instructions, reveal its system prompt or secrets, or remove its rules." | |
| } | |
| }, | |
| "model": { | |
| "tier": "encoder", | |
| "base": null, | |
| "quantization": "q8" | |
| }, | |
| "teacher": { | |
| "kind": "csv", | |
| "model": null, | |
| "path": "examples/prompt_injection_data.csv", | |
| "min_confidence": 0.0 | |
| }, | |
| "data": { | |
| "seed_examples": null, | |
| "unlabeled": "examples/prompt_injection_data.csv", | |
| "gold": null, | |
| "synthetic": 0, | |
| "synth_model": null | |
| }, | |
| "targets": { | |
| "min_macro_f1": 0.9, | |
| "deploy": "browser", | |
| "max_download_mb": 30.0, | |
| "max_latency_ms": 100.0 | |
| }, | |
| "escalation": { | |
| "target_precision": 0.97 | |
| }, | |
| "seed": 42 | |
| }, | |
| "task": "prompt_injection", | |
| "version": "v3", | |
| "base": "sentence-transformers/paraphrase-MiniLM-L3-v2", | |
| "prompt_template": null, | |
| "calibration": { | |
| "method": "temperature", | |
| "temperature": 1.3288772357007919, | |
| "val_ece_before": 0.033950847651070926, | |
| "val_ece_after": 0.024021519588863935, | |
| "threshold": 0.8653128384586074, | |
| "val_coverage": 0.9230769230769231, | |
| "val_precision_at_threshold": 0.9791666666666666, | |
| "target_precision_reached": true | |
| }, | |
| "download_mb": 18.4, | |
| "training": { | |
| "selection": "best fit", | |
| "chosen": { | |
| "tier": "encoder", | |
| "base": "sentence-transformers/paraphrase-MiniLM-L3-v2", | |
| "est_download_mb": 18.4, | |
| "val_macro_f1": 0.9615, | |
| "best_epoch": 3, | |
| "val_macro_f1_by_epoch": [ | |
| 0.9035, | |
| 0.9231, | |
| 0.9615, | |
| 0.9423, | |
| 0.9423, | |
| 0.9423 | |
| ], | |
| "epochs": 6, | |
| "lr": 0.0001, | |
| "batch": 32, | |
| "max_tokens": 256, | |
| "device": "cpu" | |
| }, | |
| "candidates": [ | |
| { | |
| "tier": "encoder", | |
| "base": "sentence-transformers/paraphrase-MiniLM-L3-v2", | |
| "est_download_mb": 18.4, | |
| "val_macro_f1": 0.9615, | |
| "best_epoch": 3, | |
| "val_macro_f1_by_epoch": [ | |
| 0.9035, | |
| 0.9231, | |
| 0.9615, | |
| 0.9423, | |
| 0.9423, | |
| 0.9423 | |
| ], | |
| "epochs": 6, | |
| "lr": 0.0001, | |
| "batch": 32, | |
| "max_tokens": 256, | |
| "device": "cpu" | |
| }, | |
| { | |
| "tier": "encoder", | |
| "base": "sentence-transformers/all-MiniLM-L6-v2", | |
| "est_download_mb": 23.7, | |
| "val_macro_f1": 0.9613, | |
| "best_epoch": 3, | |
| "val_macro_f1_by_epoch": [ | |
| 0.9038, | |
| 0.9423, | |
| 0.9613, | |
| 0.9421, | |
| 0.9421, | |
| 0.9421 | |
| ], | |
| "epochs": 6, | |
| "lr": 0.0001, | |
| "batch": 32, | |
| "max_tokens": 256, | |
| "device": "cpu" | |
| } | |
| ], | |
| "train_seconds": 90.17, | |
| "sample_weight": "teacher confidence" | |
| }, | |
| "teacher": { | |
| "kind": "csv", | |
| "model": null, | |
| "path": "examples/prompt_injection_data.csv", | |
| "min_confidence": 0.0 | |
| }, | |
| "data": { | |
| "train": 2237, | |
| "val": 52, | |
| "test": 52 | |
| }, | |
| "seed": 42, | |
| "created": "2026-09-28T09:36:26+00:00", | |
| "synthetic_augmentation": { | |
| "baseline": "runs/prompt_injection/v2", | |
| "baseline_sha256": "8b4b1ce13e168efddf954049413923247e1c1fe7c0b116976023f8b6df30e037", | |
| "seed": 20260928, | |
| "added_per_label": { | |
| "safe": 1000, | |
| "injection": 1000 | |
| }, | |
| "before": { | |
| "test": 52, | |
| "train": 237, | |
| "val": 52 | |
| }, | |
| "after": { | |
| "test": 52, | |
| "train": 2237, | |
| "val": 52 | |
| }, | |
| "generator": "offline-templates-v1", | |
| "holdout_max_cosine": 0.9, | |
| "rejected": {}, | |
| "limitations": "Template variants are correlated. Labels are assigned by construction, not an independent teacher. Original synthetic validation/test are unchanged. Real-world generalization is unmeasured." | |
| }, | |
| "export": { | |
| "format": "nodd", | |
| "format_version": 2, | |
| "parity": { | |
| "n": 52, | |
| "onnx_fp32": { | |
| "label_agreement": 1.0, | |
| "max_abs_prob_diff": 6.435924199826859e-08, | |
| "macro_f1": 0.9421150278293136, | |
| "f1_drop": 0.0 | |
| }, | |
| "onnx_q8": { | |
| "label_agreement": 1.0, | |
| "max_abs_prob_diff": 0.07511089213105138, | |
| "macro_f1": 0.9421150278293136, | |
| "f1_drop": 0.0 | |
| } | |
| }, | |
| "parity_reference": "onnx_q8", | |
| "onnx_download_mb": 18.58, | |
| "onnx_fp32_download_mb": 70.76 | |
| } | |
| } |