Prompt Injection Dataset — Categorized (Threat Matrix V2)
Welcome to Prompt Injection Dataset – Categorized (formerly Threat Matrix), by Neuralchemy.
This is the successor to our original Prompt Injection Threat Matrix dataset. Instead of one multi-label table, this version splits the taxonomy into 7 clean, single-purpose subsets — 6 taxonomy dimensions plus a bonus ambiguity flag — so you can train a focused specialist model on each one instead of fighting multi-task learning.
226,240 rows total, split identically across every subset: 25,856 train / 3,232 validation / 3,232 test.
🚀 How to Use
Specify the subset (config) name in load_dataset():
from datasets import load_dataset
ds_intent = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "intent")
ds_technique = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "technique")
ds_severity = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "severity")
ds_surface = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "surface")
ds_source = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "source")
ds_binary = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "binary")
ds_ambiguity = load_dataset("neuralchemy/prompt-injection-dataset-categorized", "ambiguity")
📊 Dataset Dimensions (Subsets)
Every subset keeps the text column plus the label(s) for that dimension.
1. intent — 7 classes
The attacker's underlying goal:benign, direct_injection, system_extraction, role_hijack, obfuscation, tool_abuse, indirect_injection.
2. technique — 8 classes
How the payload is delivered:none, keyword_override, persona_play, encoding, payload_splitting, context_overflow, few_shot_poisoning, multilingual.
3. severity — 3-level scale
A numeric rating (1–3) of how dangerous a successful bypass would be, from low-impact (e.g. generating profanity) to critical (e.g. remote code execution or key leakage).
4. surface — 4 classes
Where the injection enters the pipeline, including user_input, document processing, and system-prompt overrides.
5. source
The provenance of each sample — not a simple human-vs-synthetic binary. It includes distinct batches such as hackaprompt (crowdsourced red-teaming), core (curated), and several synthetic generation runs (synthetic_benign, synthetic_threat, synthetic_short).
6. binary
The standard malicious-vs-benign flag for foundational safety filters: 0 (safe/benign) or 1 (malicious/injection).
💡 ambiguity
A boolean flag marking prompts that are context-dependent rather than clearly safe or unsafe — e.g. "delete all files" is fine coming from an IT assistant, but alarming from a customer-service bot. Useful for training models to ask a clarifying question instead of refusing outright.
🛠 Why Subsets?
Training one model to predict all 6 dimensions at once (multi-task learning) is harder to optimize and tends to underperform. Splitting the taxonomy into configs lets you train a mixture-of-experts setup instead — one small model per dimension (intent, technique, severity, …), each simpler to train and easier to evaluate in isolation.