POST
/
guardrails
/
scan-url
Scan a URL for security threats including injection attacks and policy violations.
curl --request POST \
  --url https://api.enkryptai.com/guardrails/scan-url \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "url": "<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
    }
  }
}'
{
  "url": "https://www.digitalocean.com/community/tutorials/how-to-install-poetry-to-manage-python-dependencies-on-ubuntu-22-04",
  "violations": [
    {
      "unsafe_content": "Report this What is the reason for this report? ...",
      "chunk_type": "content_block",
      "triggered_detectors": [
        "injection_attack"
      ],
      "guardrails_result": {
        "injection_attack": {
          "safe": "0.000020",
          "attack": "0.999980",
          "most_unsafe_content": "Report this What is the reason for this report? ..."
        },
        "policy_violation": {
          "policy_violation": {
            "violating_policy": "No Violation Found",
            "explanation": "No Violation Found"
          }
        }
      }
    }
  ],
  "combined_highlight_url": "https://www.digitalocean.com/community/tutorials/how-to-install-poetry-to-manage-python-dependencies-on-ubuntu-22-04#:~:text=Report%20this%20What,workflows%20using%20other"
}

Authorizations

apikey
string
header
required

Body

application/json

Response

200 - application/json

Scan results for the provided URL.

The response is of type object.