Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: onnx
|
| 6 |
+
pipeline_tag: text-classification
|
| 7 |
+
tags:
|
| 8 |
+
- prompt-injection
|
| 9 |
+
- jailbreak
|
| 10 |
+
- llm-security
|
| 11 |
+
- guardrail
|
| 12 |
+
- onnx
|
| 13 |
+
metrics:
|
| 14 |
+
- recall
|
| 15 |
+
- false_positive_rate
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
+
# promptpurify model card
|
| 19 |
+
|
| 20 |
+
**Tiny prompt-injection detector. ~14 MB. CPU. Built from scratch by
|
| 21 |
+
[SecureLayer7](https://securelayer7.net).**
|
| 22 |
+
|
| 23 |
+
## Intended use
|
| 24 |
+
|
| 25 |
+
Single-turn classification of untrusted text into `benign` vs
|
| 26 |
+
`prompt-injection`. Sits between user input (or a retrieved RAG chunk,
|
| 27 |
+
or a tool output) and your LLM call. Outputs a probability score; you
|
| 28 |
+
decide the threshold and the policy.
|
| 29 |
+
|
| 30 |
+
```ts
|
| 31 |
+
import { createL5eRunner } from "promptpurify/l5";
|
| 32 |
+
const guard = await createL5eRunner();
|
| 33 |
+
const score = await guard.score(userMessage);
|
| 34 |
+
if (score >= 0.95) return refusal();
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Full integration patterns: [docs/QUICKSTART.md](docs/QUICKSTART.md).
|
| 38 |
+
|
| 39 |
+
## At a glance
|
| 40 |
+
|
| 41 |
+
| | |
|
| 42 |
+
|---|---|
|
| 43 |
+
| Type | ONNX transformer classifier |
|
| 44 |
+
| Size on disk | **~14 MB (INT8)** |
|
| 45 |
+
| Inference | CPU, single-digit ms |
|
| 46 |
+
| Runtime | `onnxruntime-node` (optional peer) |
|
| 47 |
+
| Network | **None.** In-process. |
|
| 48 |
+
|
| 49 |
+
## Training
|
| 50 |
+
|
| 51 |
+
Built from scratch by SecureLayer7 on curated internal corpora.
|
| 52 |
+
|
| 53 |
+
## Evaluation
|
| 54 |
+
|
| 55 |
+
Benchmarked against public datasets and OSS baselines. Comparison and
|
| 56 |
+
methodology: [docs/BENCHMARKS.md](docs/BENCHMARKS.md). Reproducibility:
|
| 57 |
+
[docs/REPRODUCE.md](docs/REPRODUCE.md). Bench script
|
| 58 |
+
`scripts/bench.mjs` re-scores the shipped public eval slice with this
|
| 59 |
+
exact model artifact.
|
| 60 |
+
|
| 61 |
+
## Out of scope
|
| 62 |
+
|
| 63 |
+
- Single-turn scoring only — pair with conversation-level monitoring.
|
| 64 |
+
- Content moderation (toxicity, hate, CSAM, self-harm) — pair with a
|
| 65 |
+
content classifier.
|
| 66 |
+
- Authentication and tool-scope enforcement are application
|
| 67 |
+
responsibilities, not the model's.
|
| 68 |
+
|
| 69 |
+
See [docs/HONEST-LIMITS.md](docs/HONEST-LIMITS.md).
|
| 70 |
+
|
| 71 |
+
## Bias
|
| 72 |
+
|
| 73 |
+
The model is English-strongest. Operators serving multilingual traffic
|
| 74 |
+
should calibrate the threshold per language. The model has no access
|
| 75 |
+
to user identity, account state, or conversation history.
|
| 76 |
+
|
| 77 |
+
## License
|
| 78 |
+
|
| 79 |
+
MIT for both the SDK and the model weights.
|
| 80 |
+
|
| 81 |
+
Public datasets we evaluate against (and the OSS baseline models we
|
| 82 |
+
compare to) carry their own upstream licenses — see
|
| 83 |
+
[`training/CORPUS_LICENSES.json`](training/CORPUS_LICENSES.json).
|
| 84 |
+
|
| 85 |
+
## Integrity verification
|
| 86 |
+
|
| 87 |
+
Every model artifact is checksummed. Verify before extracting:
|
| 88 |
+
|
| 89 |
+
```bash
|
| 90 |
+
sha256sum -c models/l5e/SHA256SUMS
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
The release tarball is additionally cosign-signed with keyless
|
| 94 |
+
Sigstore.
|
| 95 |
+
|
| 96 |
+
## Distribution mirrors
|
| 97 |
+
|
| 98 |
+
| Mirror | URL |
|
| 99 |
+
|---|---|
|
| 100 |
+
| GitHub Releases | `https://github.com/securelayer7/PROMPTPurify/releases` |
|
| 101 |
+
| Hugging Face Hub | [`Securelayer7/PROMPTPurify`](https://huggingface.co/Securelayer7/PROMPTPurify) |
|
| 102 |
+
|
| 103 |
+
## Contact
|
| 104 |
+
|
| 105 |
+
- Security disclosures: [`SECURITY.md`](SECURITY.md) →
|
| 106 |
+
`security@securelayer7.net`
|
| 107 |
+
- General: [GitHub Issues](https://github.com/securelayer7/PROMPTPurify/issues)
|