Skip to content

Commit 58042c3

Browse files
Copilotslister1001
andcommitted
Fix user agent version validation for evaluation SDK red teaming
Added validation in azure-ai-evaluation SDK to ensure VERSION is never empty, None, or whitespace-only. This prevents unauthorized SDK usage specifically in red teaming scenarios. Co-authored-by: slister1001 <[email protected]>
1 parent 3649999 commit 58042c3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_user_agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
from typing import Iterator
66

77
from azure.ai.evaluation._version import VERSION
8-
from azure.core._version_validation import validate_version
98

109
# Validate that VERSION is not empty or None to prevent unauthorized SDK usage
11-
validate_version(VERSION)
10+
# This is specifically important for red teaming scenarios
11+
if not VERSION or not isinstance(VERSION, str) or not VERSION.strip():
12+
raise ValueError("Invalid SDK version: version must be a non-empty string")
1213

1314

1415
class UserAgentSingleton:

0 commit comments

Comments
 (0)