request (GuardrailRequest)session (AsyncSession)GuardrailResponsecurl --location -g --request POST 'https:///guardrails-service/api/v2/guardrails' \
--header 'Ocp-Apim-Subscription-Key: ' \
--header 'Authorization: Bearer ' \
--header 'Content-Type: application/json' \
--data-raw '{
"enabled_rails": {
"basic_rails": [
"ethical_moderation",
"jailbreak_detection"
],
"custom_rails": {
"hallucination": {
"data_points": [
"The capital of France is Paris",
"Water boils at 100 degrees Celsius at sea level"
]
},
"mask_sensitive_data": {
"excluded_entities": [
"ORGANIZATION",
"AGE"
],
"excluded_terms": [
"John Doe",
"Apple Inc."
]
},
"topic_control": {
"guidelines": [
"Do not discuss illegal activities",
"Do not provide financial advice"
]
}
}
},
"text": "Hello, my name is John Doe and my email is [email protected]"
}'{
"data": {
"guardrail_triggered": true,
"triggered_result": {
"content_safety": {
"filtered": false
},
"hallucination": {
"filtered": false
},
"jailbreak": {
"filtered": false
},
"pii_redaction": {
"filtered": true,
"redacted": "Hello, my name is [PERSON] and my email is [EMAIL]"
},
"topic_control": {
"filtered": false
}
}
},
"message": "Guardrail check completed",
"success": true
}