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>"
}'
{
"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
},
"toxicity": {
"toxicity": 0.000395895738620311,
"severe_toxicity": 0.000395895738620311,
"obscene": 0.000395895738620311,
"threat": 0.000395895738620311,
"insult": 0.000395895738620311,
"identity_hate": 0.000395895738620311
},
"pii": {
"secrets": {},
"pii": {},
"ip_address": {},
"url": {}
},
"injection_attack": {
"safe": "0.000004",
"attack": "0.999996"
},
"keyword_detector": {
"detected_keywords": [
"<string>"
],
"detected_counts": {
"keyword1": 1,
"keyword2": 2
},
"redacted_text": "<string>"
},
"system_prompt": {
"similarity_score": 0
},
"copyright_ip": {
"similarity_score": 0
},
"policy_violation": {
"violating_policy": "<string>",
"explanation": "<string>"
},
"bias": {
"bias_detected": true,
"biased_text": "<string>",
"debiased_text": "<string>"
},
"sponge_attack": {
"sponge_attack_detected": false
}
}
}
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>"
}'
{
"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
},
"toxicity": {
"toxicity": 0.000395895738620311,
"severe_toxicity": 0.000395895738620311,
"obscene": 0.000395895738620311,
"threat": 0.000395895738620311,
"insult": 0.000395895738620311,
"identity_hate": 0.000395895738620311
},
"pii": {
"secrets": {},
"pii": {},
"ip_address": {},
"url": {}
},
"injection_attack": {
"safe": "0.000004",
"attack": "0.999996"
},
"keyword_detector": {
"detected_keywords": [
"<string>"
],
"detected_counts": {
"keyword1": 1,
"keyword2": 2
},
"redacted_text": "<string>"
},
"system_prompt": {
"similarity_score": 0
},
"copyright_ip": {
"similarity_score": 0
},
"policy_violation": {
"violating_policy": "<string>",
"explanation": "<string>"
},
"bias": {
"bias_detected": true,
"biased_text": "<string>",
"debiased_text": "<string>"
},
"sponge_attack": {
"sponge_attack_detected": false
}
}
}
The policy name
"Test Guardrails Policy"
Successful Response
The response is of type object
.