Skip to content

fix(xecguard): use StandardLoggingGuardrailInformation in logging hook - #32907

Closed
yucheng-berri wants to merge 1 commit into
litellm_internal_stagingfrom
fix/lit-4335-xecguard-guardrail-info-type
Closed

fix(xecguard): use StandardLoggingGuardrailInformation in logging hook#32907
yucheng-berri wants to merge 1 commit into
litellm_internal_stagingfrom
fix/lit-4335-xecguard-guardrail-info-type

Conversation

@yucheng-berri

Copy link
Copy Markdown
Contributor

Closes LIT-4335.

XecGuard's async_logging_hook wrote a bare dict to standard_logging_object['guardrail_information'] instead of a properly typed StandardLoggingGuardrailInformation wrapped in a list. This broke downstream loggers that expect List[StandardLoggingGuardrailInformation].

Changes:

  • Construct a proper StandardLoggingGuardrailInformation TypedDict
  • Wrap in a list / append to existing list (consistent with the base class method)
  • Update test assertions to validate list-of-dict shape

Closes LIT-4335.

XecGuard's async_logging_hook wrote a bare dict to
standard_logging_object['guardrail_information'] instead of a properly
typed StandardLoggingGuardrailInformation wrapped in a list. This broke
downstream loggers (Langfuse, Datadog LLM Obs, etc.) that expect a
List[StandardLoggingGuardrailInformation] — they would iterate keys
instead of entries, or skip guardrail duration rollup entirely.

- Construct a StandardLoggingGuardrailInformation TypedDict
- Wrap in a list or append to existing list (consistent with
  add_standard_logging_guardrail_information_to_request_data)
- Update existing test assertions to validate the list-of-dict shape
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@yucheng-berri

Copy link
Copy Markdown
Contributor Author

Closed and recreated as #32911 on a litellm_ prefixed branch with corrected commit authorship

@codspeed-hq

codspeed-hq Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing fix/lit-4335-xecguard-guardrail-info-type (a9895f6) with litellm_internal_staging (a4199d3)

Open in CodSpeed

@yucheng-berri
yucheng-berri deleted the fix/lit-4335-xecguard-guardrail-info-type branch July 11, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants