POST
/
guardrails
/
policy
/
scan-url
Scan a URL for security threats using a specific policy.
curl --request POST \
  --url https://api.enkryptai.com/guardrails/policy/scan-url \
  --header 'Content-Type: application/json' \
  --header 'X-Enkrypt-Policy: <x-enkrypt-policy>' \
  --header 'apikey: <api-key>' \
  --data '{
  "url": "<string>"
}'
{
  "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"
          }
        }
      }
    },
    {
      "unsafe_content": "as a Newsletter. Submit Submit New accounts only. ...",
      "chunk_type": "content_block",
      "triggered_detectors": [
        "policy_violation"
      ],
      "guardrails_result": {
        "injection_attack": {
          "safe": "0.997765",
          "attack": "0.002235",
          "most_unsafe_content": "as a Newsletter. Submit Submit New accounts only. ..."
        },
        "policy_violation": {
          "policy_violation": {
            "violating_policy": "1",
            "explanation": "The text provides a promotional offer with a specific dollar amount and time frame, which could be misleading if not verified for accuracy regarding availability and terms."
          }
        }
      }
    }
  ],
  "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&text=as%20a%20Newsletter.,LLC.%20Sitemap%20."
}

Authorizations

apikey
string
header
required

Headers

X-Enkrypt-Policy
string
required

Name of the policy to apply

Body

application/json

Response

200 - application/json

Scan results for the provided URL using the specified policy.

The response is of type object.