detect_prompt_injection
Detects prompt injection and jailbreak attempts in untrusted files, web pages, or user input, flagging role-switching, instruction overrides, and hidden payloads with regex and optional LLM checks.
Instructions
Defend against AI jailbreaks and prompt injection. Detects role-switching ('You are now DAN'), instruction override ('Ignore previous'), tool manipulation, and hidden payloads. Hybrid detection: Fast regex + optional Llama Prompt Guard 2 (LLM). Use when reading untrusted content (files, web pages, user input).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"content": "<content>"
},
"name": "detect_prompt_injection"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Validation mode (default: strict) | |
| content | Yes | The text content to analyze (from files, web pages, user input, tool descriptions) | |
| sensitivity | No | Detection sensitivity (default: high) | |
| useGuardModel | No | Enable Llama Prompt Guard 2 LLM-based detection (default: false) | |
| huggingfaceToken | No | HuggingFace API token (required if useGuardModel is true) |