curl --request POST \
--url https://api.enkryptai.com/guardrails/policy/detect \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Policy: <x-enkrypt-policy>' \
--header 'apikey: <api-key>' \
--data '
{
"text": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
'import requests
url = "https://api.enkryptai.com/guardrails/policy/detect"
payload = {
"text": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
headers = {
"X-Enkrypt-Policy": "<x-enkrypt-policy>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Policy': '<x-enkrypt-policy>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({text: '<string>', user_metadata: {request_id: 'abc-123', source: 'mobile-app'}})
};
fetch('https://api.enkryptai.com/guardrails/policy/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/guardrails/policy/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'user_metadata' => [
'request_id' => 'abc-123',
'source' => 'mobile-app'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Policy: <x-enkrypt-policy>",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/guardrails/policy/detect"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Policy", "<x-enkrypt-policy>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/guardrails/policy/detect")
.header("X-Enkrypt-Policy", "<x-enkrypt-policy>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/policy/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Policy"] = '<x-enkrypt-policy>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"nsfw": 0,
"toxicity": [
"toxicity",
"severe_toxicity",
"obscene",
"threat",
"insult",
"identity_hate"
],
"pii": 0,
"injection_attack": 1,
"keyword_detected": 0,
"system_prompt_similarity": 0,
"copyright_ip_similarity": 0,
"policy_violation": 0,
"bias": 0,
"sponge_attack": 0
},
"details": {
"nsfw": {
"sfw": 0.000395895738620311,
"nsfw": 0.9996041054725647,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"toxicity": {
"toxicity": 0.000395895738620311,
"severe_toxicity": 0.000395895738620311,
"obscene": 0.000395895738620311,
"threat": 0.000395895738620311,
"insult": 0.000395895738620311,
"identity_hate": 0.000395895738620311,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"pii": {
"secrets": {},
"pii": {},
"ip_address": {},
"url": {},
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"injection_attack": {
"safe": "0.000004",
"attack": "0.999996",
"most_unsafe_content": "<string>",
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"keyword_detector": {
"detected_keywords": [
"<string>"
],
"detected_counts": {
"keyword1": 1,
"keyword2": 2
},
"redacted_text": "<string>"
},
"system_prompt": {
"similarity_score": 0,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"copyright_ip": {
"similarity_score": 0,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"policy_violation": {
"violating_policy": "<string>",
"explanation": "<string>"
},
"bias": {
"bias_detected": true,
"biased_text": "<string>",
"debiased_text": "<string>",
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"sponge_attack": {
"sponge_attack_detected": false,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
}
},
"result_message": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}Detect with Policy (Legacy)
curl --request POST \
--url https://api.enkryptai.com/guardrails/policy/detect \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Policy: <x-enkrypt-policy>' \
--header 'apikey: <api-key>' \
--data '
{
"text": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
'import requests
url = "https://api.enkryptai.com/guardrails/policy/detect"
payload = {
"text": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}
headers = {
"X-Enkrypt-Policy": "<x-enkrypt-policy>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Policy': '<x-enkrypt-policy>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({text: '<string>', user_metadata: {request_id: 'abc-123', source: 'mobile-app'}})
};
fetch('https://api.enkryptai.com/guardrails/policy/detect', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/guardrails/policy/detect",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'text' => '<string>',
'user_metadata' => [
'request_id' => 'abc-123',
'source' => 'mobile-app'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Policy: <x-enkrypt-policy>",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/guardrails/policy/detect"
payload := strings.NewReader("{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Policy", "<x-enkrypt-policy>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/guardrails/policy/detect")
.header("X-Enkrypt-Policy", "<x-enkrypt-policy>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/guardrails/policy/detect")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Policy"] = '<x-enkrypt-policy>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"<string>\",\n \"user_metadata\": {\n \"request_id\": \"abc-123\",\n \"source\": \"mobile-app\"\n }\n}"
response = http.request(request)
puts response.read_body{
"summary": {
"nsfw": 0,
"toxicity": [
"toxicity",
"severe_toxicity",
"obscene",
"threat",
"insult",
"identity_hate"
],
"pii": 0,
"injection_attack": 1,
"keyword_detected": 0,
"system_prompt_similarity": 0,
"copyright_ip_similarity": 0,
"policy_violation": 0,
"bias": 0,
"sponge_attack": 0
},
"details": {
"nsfw": {
"sfw": 0.000395895738620311,
"nsfw": 0.9996041054725647,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"toxicity": {
"toxicity": 0.000395895738620311,
"severe_toxicity": 0.000395895738620311,
"obscene": 0.000395895738620311,
"threat": 0.000395895738620311,
"insult": 0.000395895738620311,
"identity_hate": 0.000395895738620311,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"pii": {
"secrets": {},
"pii": {},
"ip_address": {},
"url": {},
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"injection_attack": {
"safe": "0.000004",
"attack": "0.999996",
"most_unsafe_content": "<string>",
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"keyword_detector": {
"detected_keywords": [
"<string>"
],
"detected_counts": {
"keyword1": 1,
"keyword2": 2
},
"redacted_text": "<string>"
},
"system_prompt": {
"similarity_score": 0,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"copyright_ip": {
"similarity_score": 0,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"policy_violation": {
"violating_policy": "<string>",
"explanation": "<string>"
},
"bias": {
"bias_detected": true,
"biased_text": "<string>",
"debiased_text": "<string>",
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
},
"sponge_attack": {
"sponge_attack_detected": false,
"compliance_mapping": {
"owasp_llm_2025": [
"<string>"
],
"mitre_atlas": [
"<string>"
],
"nist_ai_rmf": [
"<string>"
],
"eu_ai_act": [
"<string>"
],
"iso_iec_standards": [
"<string>"
]
}
}
},
"result_message": "<string>",
"user_metadata": {
"request_id": "abc-123",
"source": "mobile-app"
}
}X-Enkrypt-Mode.Authorizations
Headers
The policy name
"Test Guardrails Policy"
Body
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.
{
"request_id": "abc-123",
"source": "mobile-app"
}
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Block message when a block-type detector triggers (custom or built-in default), revised text when only revise-type detectors trigger, or null when no detections fire.
Optional arbitrary metadata object echoed back in the response. Limits: at most 16 top-level keys, key names up to 64 characters, nesting depth up to 3, total serialized size up to 4 KB. When provided and valid, this object is also echoed as a top-level user_metadata key on error responses (4xx/5xx) of endpoints that accept it; invalid or oversized metadata is never echoed, including on the 422 response it causes.
{
"request_id": "abc-123",
"source": "mobile-app"
}

