Detect Injection

POST
Detect potential prompt injection attacks in a given prompt.

Request

This endpoint expects an object.
prompt
stringRequired
The prompt text to detect injection attacks.
detect
booleanRequired
Specify whether to detect potential injection attacks.

Response

This endpoint returns an object
checks
list of objectsOptional
created
integerOptional
Timestamp of when the injection check was created.
id
stringOptional
Unique ID for the injection check.
object
stringOptional
Type of object (injection check).
POST
$curl -X POST https://api.predictionguard.com/injection \
> -H "x-api-key: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "prompt": "prompt",
> "detect": true
>}'
Response
1{
2 "checks": [
3 {
4 "probability": 1,
5 "index": 0,
6 "status": "success"
7 }
8 ],
9 "created": 1,
10 "id": "injection-ya7XvHvWxN21Hl9jiiDtVjPi3v95xMHy",
11 "object": "injection_check"
12}