From 246d9f6e12752443a45419c1582b307fa371d41b Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Thu, 2 Apr 2026 11:36:36 +0530 Subject: [PATCH] fix(guardrails/purview): propagate litellm_call_id as correlation_id to Purview --- .../guardrail_hooks/microsoft_purview/purview_dlp.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/purview_dlp.py b/litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/purview_dlp.py index 1bbbf531f55..05bf48417a6 100644 --- a/litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/purview_dlp.py +++ b/litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/purview_dlp.py @@ -8,6 +8,7 @@ Supports three modes: """ import asyncio +import uuid from concurrent.futures import ThreadPoolExecutor from datetime import datetime from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, Union @@ -117,11 +118,13 @@ class MicrosoftPurviewDLPGuardrail(PurviewGuardrailBase, CustomGuardrail): try: etag, _ = await self._compute_protection_scopes(user_id) + correlation_id = request_data.get("litellm_call_id") or str(uuid.uuid4()) response = await self._process_content( user_id=user_id, text=text, activity=activity, etag=etag, + correlation_id=correlation_id, ) if self._should_block(response):