curl --request GET \
--url https://api.enkryptai.com/guardrails/get-policy \
--header 'X-Enkrypt-Policy: <x-enkrypt-policy>' \
--header 'apikey: <api-key>'{
"name": "<string>",
"description": "<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
}
},
"created_at": "2024-10-07T11:23:03.695943+00:00",
"updated_at": "2024-10-07T11:23:03.695943+00:00",
"policy_id": 1234567890,
"project_name": "default"
}Retrieve a policy by name
curl --request GET \
--url https://api.enkryptai.com/guardrails/get-policy \
--header 'X-Enkrypt-Policy: <x-enkrypt-policy>' \
--header 'apikey: <api-key>'{
"name": "<string>",
"description": "<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
}
},
"created_at": "2024-10-07T11:23:03.695943+00:00",
"updated_at": "2024-10-07T11:23:03.695943+00:00",
"policy_id": 1234567890,
"project_name": "default"
}The policy name
"Test Guardrails Policy"
Refresh the cache if data is stale
false
Successful Response
Show child attributes
Show child attributes
Optional policy text to use if not using coc_policy_name
The name of the saved COC policy to use instead of using policy_text
"2024-10-07T11:23:03.695943+00:00"
"2024-10-07T11:23:03.695943+00:00"
1234567890
"default"