Skip to main content
POST
/
guardrails
/
scan-pdf
Scan a PDF for security threats including injection attacks and policy violations.
curl --request POST \
  --url https://api.enkryptai.com/guardrails/scan-pdf \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "file": "<string>",
  "detectors": {
    "topic_detector": {
      "enabled": true,
      "topic": [
        "<string>"
      ]
    },
    "nsfw": {
      "enabled": true
    },
    "toxicity": {
      "enabled": true
    },
    "pii": {
      "enabled": true,
      "entities": [
        "pii"
      ]
    },
    "injection_attack": {
      "enabled": true
    },
    "keyword_detector": {
      "enabled": true,
      "banned_keywords": [
        "<string>"
      ]
    },
    "system_prompt": {
      "enabled": false,
      "index": "system"
    },
    "copyright_ip": {
      "enabled": false
    },
    "policy_violation": {
      "enabled": true,
      "policy_text": "<string>",
      "coc_policy_name": "<string>",
      "need_explanation": true
    },
    "bias": {
      "enabled": true
    },
    "sponge_attack": {
      "enabled": false
    }
  }
}
'
{
  "summary": {
    "policy_violation": 0,
    "injection_attack": 0
  },
  "details": {
    "total_pages": 1,
    "pages_with_detections": 0,
    "detections": []
  }
}

Authorizations

apikey
string
header
required

Body

application/json
file
string
required

Base64-encoded PDF file content.

detectors
GuardrailsDetectorsObject ยท object

Response

200 - application/json

Scan results for the provided PDF.

summary
object
required

Summary counts of detections by detector type.

details
object
required

Detailed scan results including page-level information.