Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix: regression responses_id_security

Ishaan Jaffer4145f8c09896
diff --git a/litellm/proxy/hooks/responses_id_security.py b/litellm/proxy/hooks/responses_id_security.py
index cfc2e10f40b..15b2c1f4f2e 100644
--- a/litellm/proxy/hooks/responses_id_security.py
+++ b/litellm/proxy/hooks/responses_id_security.py
@@ -133,8 +133,11 @@ class ResponsesIDSecurity(CustomLogger):
return True
def _is_encrypted_response_id(self, response_id: str) -> bool:
-
- remaining_string = response_id.split("resp_")[1]
+ split_result = response_id.split("resp_")
+ if len(split_result) < 2:
+ return False
+
+ remaining_string = split_result[1]
decrypted_value = decrypt_value_helper(
value=remaining_string, key="response_id", return_original_value=True
)
@@ -155,7 +158,11 @@ class ResponsesIDSecurity(CustomLogger):
- user_id: the user id
- team_id: the team id
"""
- remaining_string = response_id.split("resp_")[1]
+ split_result = response_id.split("resp_")
+ if len(split_result) < 2:
+ return response_id, None, None
+
+ remaining_string = split_result[1]
decrypted_value = decrypt_value_helper(
value=remaining_string, key="response_id", return_original_value=True
)