diff --git a/litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py b/litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py index 7b59b3ad120..2ec7efc3045 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py +++ b/litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py @@ -70,6 +70,7 @@ _RATIONALE_TRUNCATE_CHARS = 200 _DEFAULT_POLICIES = [ "Default_Policy_SystemPromptEnforcement", "Default_Policy_HarmfulContentProtection", + "Default_Policy_GeneralPromptAttackProtection", ] @@ -207,6 +208,15 @@ class XecGuardGuardrail(CustomGuardrail): StandardLoggingGuardrailInformation entry so the scan decision reaches downstream loggers (Langfuse, DataDog, etc.). """ + if ( + isinstance(kwargs, dict) + and "litellm_params" in kwargs + and "metadata" in kwargs["litellm_params"] + and "standard_logging_guardrail_information"in kwargs["litellm_params"]["metadata"] + and kwargs["litellm_params"]["metadata"]["standard_logging_guardrail_information"] + ): + return kwargs, result + start_time = datetime.now() try: assistant_text = self._extract_assistant_text_from_response(result) @@ -575,4 +585,4 @@ class XecGuardGuardrail(CustomGuardrail): return ( f"Blocked by XecGuard grounding: rules=[{rules_str}] " f"trace_id={trace_id} rationale={rationale}" - ) + ) \ No newline at end of file