diff --git a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx b/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx index 1c8b7c7a20a..01c18585186 100644 --- a/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx +++ b/ui/litellm-dashboard/src/components/view_logs/GuardrailViewer/GuardrailViewer.tsx @@ -53,6 +53,7 @@ interface GuardrailInformation { match_details?: MatchDetail[]; patterns_checked?: number; alert_recipients?: string[]; + risk_score?: number; } interface GuardrailViewerProps { @@ -87,6 +88,12 @@ const isEntrySuccess = (entry: GuardrailInformation): boolean => { return (entry.guardrail_status ?? "").toLowerCase() === "success"; }; +const getRiskColor = (score: number): string => { + if (score <= 3) return "text-green-600 bg-green-50 border-green-200"; + if (score <= 6) return "text-amber-600 bg-amber-50 border-amber-200"; + return "text-red-600 bg-red-50 border-red-200"; +}; + const getDisplayName = (entry: GuardrailInformation): string => { return entry.policy_template || entry.guardrail_name; }; @@ -455,6 +462,14 @@ const EvaluationCard = ({ entry }: { entry: GuardrailInformation }) => { {(entry.confidence_score * 100).toFixed(0)}% conf )} + + {entry.risk_score != null && success && ( + + + Risk {entry.risk_score}/10 + + + )} {/* Right side: duration + method + chevron */}