diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 80c03ec5ea2..5fbfd23b2db 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -2620,6 +2620,48 @@ class StandardLoggingGuardrailInformation(TypedDict, total=False): } """ + guardrail_id: Optional[str] + """Unique identifier for the guardrail configuration, e.g. 'gd-eu-pii-001'""" + + policy_template: Optional[str] + """Name of the policy template this guardrail belongs to, e.g. 'EU AI Act Article 5'""" + + detection_method: Optional[str] + """How detection was performed: 'regex', 'keyword', 'llm-judge', 'presidio', etc.""" + + confidence_score: Optional[float] + """For LLM-judge guardrails: confidence score 0.0-1.0""" + + classification: Optional[dict] + """For LLM-judge guardrails: structured classification output""" + + match_details: Optional[List[dict]] + """Detailed match information for each detected pattern""" + + patterns_checked: Optional[int] + """Total number of patterns evaluated by this guardrail""" + + alert_recipients: Optional[List[str]] + """Email addresses that were notified""" + + +class GuardrailTracingDetail(TypedDict, total=False): + """ + Typed fields for guardrail tracing metadata. + + Passed to add_standard_logging_guardrail_information_to_request_data() + to enrich the StandardLoggingGuardrailInformation with provider-specific details. + """ + + guardrail_id: Optional[str] + policy_template: Optional[str] + detection_method: Optional[str] + confidence_score: Optional[float] + classification: Optional[dict] + match_details: Optional[List[dict]] + patterns_checked: Optional[int] + alert_recipients: Optional[List[str]] + StandardLoggingPayloadStatus = Literal["success", "failure"]