File size: 1,327 Bytes
64c6511
 
 
 
 
34d06cc
64c6511
 
 
 
 
 
 
 
0bb3931
 
 
34d06cc
0bb3931
34d06cc
 
0bb3931
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64c6511
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
language:
- en
datasets:
- clawdia-chan/prompt-guard-v2
---

# Balanced DeBERTa Prompt Guard

Fine-tuned DeBERTa-v3-base for prompt injection and jailbreak detection.

## Model Details
- **Base Model:** microsoft/deberta-v3-base
- **Training Data:** 536 samples (prompt-guard-v2 dataset)
  - 417 malicious (78%)
  - 119 benign (22%)

## Dataset Categories (30+)
| Category | Count |
|----------|-------|
| prompt_injection | 80+ |
| jailbreak | 70+ |
| flip_attack | 30+ |
| encoding_attack | 50+ |
| indirect_injection | 40+ |
| role_override | 30+ |
| privilege_escalation | 20+ |
| agent_chaining | 20+ |
| memory_poisoning | 15+ |
| vector_poisoning | 15+ |
| xss_attempt | 15+ |
| sql_injection | 10+ |
| benign | 119 |

## Supported Threats (15+ types)
- Direct/Indirect Prompt Injection
- FlipAttack (character swapping)
- Jailbreak (DAN, role-play)
- Encoding Attacks (Base64, Hex, URL, HTML, Unicode)
- Multi-language jailbreak (中, 日, 韓, 西, 独, 露, etc.)
- RAG/Vector Poisoning
- Agent Chaining Attacks
- Memory Poisoning

## Usage
```python
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_name = "clawdia-chan/balanced-deberta"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
```