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).
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. |