topai_prompt_shield
Audits prompts and untrusted text before LLM inference, detecting prompt injections, jailbreaks, toxic payloads, and PII leakage to return a safety verdict and threat score.
Instructions
Scans user prompts or untrusted external text in <1ms to detect adversarial prompt injections, jailbreak attempts, toxic payloads, and PII leakage. Use as a pre-inference security guardrail before passing untrusted user input or scraped web content to an LLM. Do not use for compressing safe prompts (use topai_token_slimmer instead). Stateless, read-only, idempotent security evaluation returning a boolean safety verdict and threat score (0.0 to 1.0).
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": {
"prompt": "<prompt>"
},
"name": "topai_prompt_shield"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Raw user input, system prompt fragment, or untrusted external document text to audit for injection and PII risks. |