> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enkryptai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan PDF

> Scan a PDF for security threats including injection attacks and policy violations



## OpenAPI

````yaml POST /guardrails/scan-pdf
openapi: 3.0.0
info:
  title: Enkrypt AI APIs
  version: 2.0.0
servers:
  - url: https://api.enkryptai.com
security:
  - apiKeyAuth: []
tags:
  - name: Guardrails
  - name: Code of Conduct
  - name: Endpoints
  - name: Datasets
  - name: Redteam
  - name: Deployments
  - name: AI Proxy
  - name: Leaderboard
  - name: Archived
  - name: MCP Hub
    description: >-
      MCP Hub vulnerability scanning APIs. Submitting scans (the POST endpoints)
      is open to all authenticated callers. The scan **retrieval** APIs — Get
      Scan Job Status, Get Complete Scan Results, List Scans, and Get MCP Hub
      Scan Statistics (the GET endpoints) — are an **enterprise data-license
      feature**: they require your organization to have MCP Hub API access
      enabled by Enkrypt, otherwise they return `403`. Contact us at
      support@enkryptai.com to enable access.
  - name: MCP Registry Servers
  - name: MCP Gateways
  - name: MCP Playground
paths:
  /guardrails/scan-pdf:
    post:
      tags:
        - Guardrails
      summary: >-
        Scan a PDF for security threats including injection attacks and policy
        violations.
      description: >-
        Analyzes the provided base64-encoded PDF file and returns details about
        any detected threats on a per-page basis, including which detectors were
        triggered.
      operationId: scanPdf
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScanPdfRequestBody'
      responses:
        '200':
          description: Scan results for the provided PDF.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScanPdfResponseBody'
              examples:
                success:
                  value:
                    summary:
                      policy_violation: 0
                      injection_attack: 0
                    details:
                      total_pages: 1
                      pages_with_detections: 0
                      detections: []
components:
  schemas:
    ScanPdfRequestBody:
      title: ScanPdfRequestBody
      type: object
      properties:
        file:
          type: string
          description: Base64-encoded PDF file content.
        detectors:
          $ref: '#/components/schemas/GuardrailsDetectorsObject'
      required:
        - file
    ScanPdfResponseBody:
      title: ScanPdfResponseBody
      type: object
      required:
        - summary
        - details
      properties:
        summary:
          type: object
          description: Summary counts of detections by detector type.
          additionalProperties:
            type: integer
        details:
          type: object
          description: Detailed scan results including page-level information.
          properties:
            total_pages:
              type: integer
              description: Total number of pages in the PDF.
            pages_with_detections:
              type: integer
              description: Number of pages that had detections.
            detections:
              type: array
              description: List of detections found in the PDF.
              items:
                type: object
                additionalProperties: true
    GuardrailsDetectorsObject:
      title: GuardrailsDetectorsObject
      type: object
      properties:
        topic_detector:
          type: object
          title: TopicDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
            topic:
              type: array
              title: Topic
              items:
                type: string
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        nsfw:
          type: object
          title: NSFWDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        toxicity:
          type: object
          title: ToxicityDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        pii:
          type: object
          title: PIIDetector
          required:
            - enabled
            - entities
          properties:
            enabled:
              type: boolean
              title: Enabled
            entities:
              type: array
              title: Entities
              items:
                type: string
                enum:
                  - pii
                  - secrets
                  - ip_address
                  - url
        injection_attack:
          type: object
          title: InjectionAttackDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        keyword_detector:
          type: object
          title: KeywordDetector
          required:
            - enabled
            - banned_keywords
          properties:
            enabled:
              type: boolean
              title: Enabled
            banned_keywords:
              type: array
              title: Banned Keywords
              items:
                type: string
        system_prompt:
          type: object
          title: SystemPromptDetector
          required:
            - enabled
            - index
          properties:
            enabled:
              type: boolean
              title: Enabled
              example: false
            index:
              type: string
              title: Index
              enum:
                - system
              description: Index
              example: system
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        copyright_ip:
          type: object
          title: CopyrightIPDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
              example: false
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        policy_violation:
          type: object
          title: PolicyAdherenceDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
            policy_text:
              type: string
              title: Policy Text
              description: Optional policy text to use if not using coc_policy_name
            coc_policy_name:
              type: string
              title: COC Policy Name
              description: >-
                The name of the saved COC policy to use instead of using
                policy_text
            need_explanation:
              type: boolean
              title: Need Explanation
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
        bias:
          type: object
          title: BiasDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
        sponge_attack:
          type: object
          title: SpongeAttackDetector
          required:
            - enabled
          properties:
            enabled:
              type: boolean
              title: Enabled
              example: false
            block_message:
              type: string
              title: Block Message
              description: >-
                Optional custom message returned when this detector triggers a
                block. If not provided, a built-in default message is used.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: apikey

````