litellm - 💡(How to fix) Fix Custom guardrail: Cryptographic audit trails with asqav [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#24534Fetched 2026-04-08 01:27:15
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2mentioned ×1subscribed ×1
RAW_BUFFERClick to expand / collapse

Proposing an asqav custom guardrail integration for LiteLLM that adds cryptographic audit trails to every LLM call passing through the proxy.

What it would do:

  • Sign every LLM request/response with ML-DSA-65 (quantum-safe)
  • Create tamper-proof audit logs with independent verification URLs
  • Enforce policy gates (rate limits, content policies, required approvals)
  • EU AI Act / SOC2 / HIPAA compliance evidence out of the box

Implementation: Would extend LiteLLM's CustomGuardrail base class to hook into pre-call and post-call events.

asqav is MIT licensed and already supports 100+ LLM providers through its SDK.

extent analysis

Fix Plan

To integrate asqav custom guardrail into LiteLLM for cryptographic audit trails, follow these steps:

  • Extend LiteLLM's CustomGuardrail base class to create a new class, e.g., AsqavGuardrail.
  • Implement pre-call and post-call event hooks in AsqavGuardrail to sign requests and responses with ML-DSA-65.
  • Use the asqav SDK to create tamper-proof audit logs with independent verification URLs.
  • Enforce policy gates (rate limits, content policies, required approvals) using asqav's built-in features.

Example Code

import asqav

class AsqavGuardrail(CustomGuardrail):
    def __init__(self, asqav_config):
        self.asqav_config = asqav_config
        self.asqav_client = asqav.Client(asqav_config)

    def pre_call(self, request):
        # Sign request with ML-DSA-65
        signed_request = self.asqav_client.sign_request(request)
        return signed_request

    def post_call(self, response):
        # Create tamper-proof audit log with independent verification URL
        audit_log = self.asqav_client.create_audit_log(response)
        return audit_log

    def enforce_policy_gates(self, request):
        # Enforce rate limits, content policies, required approvals
        self.asqav_client.enforce_policy_gates(request)

Verification

To verify the fix, test the AsqavGuardrail class with sample requests and responses, ensuring that:

  • Requests and responses are signed correctly with ML-DSA-65.
  • Tamper-proof audit logs are created with independent verification URLs.
  • Policy gates are enforced correctly.

Extra Tips

  • Refer to the asqav SDK documentation for implementation details and configuration options.
  • Ensure compliance with EU AI Act, SOC2, and HIPAA regulations by using asqav's built-in features and following best practices.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING