import requests
import json
import os
url = "https://api.enkryptai.com/guardrails/policy/scan-url"
payload = json.dumps({
"url": "https://www.digitalocean.com/community/tutorials/how-to-install-poetry-to-manage-python-dependencies-on-ubuntu-22-04"
})
headers = {
'Content-Type': 'application/json',
'apikey': os.getenv('ENKRYPTAI_API_KEY'),
'X-Enkrypt-Policy': 'my-policy'
}
response = requests.post(url, headers=headers, data=payload)
print(response.json())
{
"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? This undefined is spam This undefined is offensive This undefined is off-topic This undefined is other Submit Tutorial How To Install Poetry to Manage Python Dependencies on Ubuntu 22.04 Published on October 20, 2022 Python Ubuntu 22.04 By Tony Tran Table of contents Popular topics Introduction Poetry is a dependency manager for Python that is also capable of building and packaging your Python projects for distribution. As a dependency manager, it comes with tools for maintaining consistent and contained virtual environments. Additionally, it has tools to integrate with workflows using other",
"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? This undefined is spam This undefined is offensive This undefined is off-topic This undefined is other Submit Tutorial How To Install Poetry to Manage Python Dependencies on Ubuntu 22.04 Published on October 20, 2022 Python Ubuntu 22.04 By Tony Tran Table of contents Popular topics Introduction Poetry is a dependency manager for Python that is also capable of building and packaging your Python projects for distribution. As a dependency manager, it comes with tools for maintaining consistent and contained virtual environments. Additionally, it has tools to integrate with workflows using other"
},
"policy_violation": {
"policy_violation": {
"violating_policy": "No Violation Found",
"explanation": "No Violation Found"
}
}
}
},
{
"unsafe_content": "as a Newsletter. Submit Submit New accounts only. By submitting your email you agree to our Privacy Policy The developer cloud Scale up as you grow — whether you're running one virtual machine or ten thousand. View all products Get started for free Sign up and get $200 in credit for your first 60 days with DigitalOcean.* Get started *This promotional offer applies to new accounts only. © 2025 DigitalOcean, LLC. Sitemap .",
"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. By submitting your email you agree to our Privacy Policy The developer cloud Scale up as you grow — whether you're running one virtual machine or ten thousand. View all products Get started for free Sign up and get $200 in credit for your first 60 days with DigitalOcean.* Get started *This promotional offer applies to new accounts only. © 2025 DigitalOcean, LLC. Sitemap."
},
"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."
}