Skip to content

Commit f891a62

Browse files
authored
Address API View Feedback (#42789)
* change to indirect attack * update changelog * nit * run black
1 parent 01fecc2 commit f891a62

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

sdk/evaluation/azure-ai-evaluation/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
- Added support for user-supplied TokenCredentials with LLM based evaluators.
88
- Enhanced `GroundednessEvaluator` to support AI agent evaluation with tool calls. The evaluator now accepts agent response data containing tool calls and can extract context from `file_search` tool results for groundedness assessment. This enables evaluation of AI agents that use tools to retrieve information and generate responses. Note: Agent groundedness evaluation is currently supported only when the `file_search` tool is used.
99
- Added `language` parameter to `RedTeam` class for multilingual red team scanning support. The parameter accepts values from `SupportedLanguages` enum including English, Spanish, French, German, Italian, Portuguese, Japanese, Korean, and Simplified Chinese, enabling red team attacks to be generated and conducted in multiple languages.
10-
- Added support for XPIA and UngroundedAttributes risk categories in `RedTeam` scanning. These new risk categories expand red team capabilities to detect cross-platform indirect attacks and evaluate ungrounded inferences about human attributes including emotional state and protected class information.
10+
- Added support for IndirectAttack and UngroundedAttributes risk categories in `RedTeam` scanning. These new risk categories expand red team capabilities to detect cross-platform indirect attacks and evaluate ungrounded inferences about human attributes including emotional state and protected class information.
1111

1212
### Bugs Fixed
1313
- Fixed issue where evaluation results were not properly aligned with input data, leading to incorrect metrics being reported.
1414

1515
### Other Changes
1616
- Deprecating `AdversarialSimulator` in favor of the [AI Red Teaming Agent](https://aka.ms/airedteamingagent-sample). `AdversarialSimulator` will be removed in the next minor release.
17+
- Moved retry configuration constants (`MAX_RETRY_ATTEMPTS`, `MAX_RETRY_WAIT_SECONDS`, `MIN_RETRY_WAIT_SECONDS`) from `RedTeam` class to new `RetryManager` class for better code organization and configurability.
1718

1819
## 1.10.0 (2025-07-31)
1920

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/red_team/_attack_objective_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RiskCategory(str, Enum):
2121
ProtectedMaterial = "protected_material"
2222
CodeVulnerability = "code_vulnerability"
2323
UngroundedAttributes = "ungrounded_attributes"
24-
XPIA = "xpia"
24+
IndirectAttack = "indirect_attack"
2525

2626

2727
@experimental

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/red_team/_red_team.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,15 @@ def _validate_strategies(self, flattened_attack_strategies: List):
944944
)
945945
raise ValueError("MultiTurn and Crescendo strategies are not compatible with multiple attack strategies.")
946946
if AttackStrategy.Tense in flattened_attack_strategies and (
947-
RiskCategory.XPIA in self.risk_categories or RiskCategory.UngroundedAttributes in self.risk_categories
947+
RiskCategory.IndirectAttack in self.risk_categories
948+
or RiskCategory.UngroundedAttributes in self.risk_categories
948949
):
949950
self.logger.warning(
950-
"Tense strategy is not compatible with XPIA or UngroundedAttributes risk categories. Skipping Tense strategy."
951+
"Tense strategy is not compatible with IndirectAttack or UngroundedAttributes risk categories. Skipping Tense strategy."
952+
)
953+
raise ValueError(
954+
"Tense strategy is not compatible with IndirectAttack or UngroundedAttributes risk categories."
951955
)
952-
raise ValueError("Tense strategy is not compatible with XPIA or UngroundedAttributes risk categories.")
953956

954957
def _initialize_tracking_dict(self, flattened_attack_strategies: List):
955958
"""Initialize the red_team_info tracking dictionary."""

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/red_team/_utils/metric_mapping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
RiskCategory.SelfHarm: EvaluationMetrics.SELF_HARM,
1616
RiskCategory.ProtectedMaterial: EvaluationMetrics.PROTECTED_MATERIAL,
1717
RiskCategory.UngroundedAttributes: EvaluationMetrics.UNGROUNDED_ATTRIBUTES,
18-
RiskCategory.XPIA: EvaluationMetrics.XPIA,
18+
RiskCategory.IndirectAttack: EvaluationMetrics.XPIA,
1919
_InternalRiskCategory.ECI: _InternalEvaluationMetrics.ECI,
2020
RiskCategory.CodeVulnerability: EvaluationMetrics.CODE_VULNERABILITY,
2121
}
@@ -27,7 +27,7 @@
2727
RiskCategory.SelfHarm: Tasks.CONTENT_HARM,
2828
RiskCategory.ProtectedMaterial: Tasks.PROTECTED_MATERIAL,
2929
RiskCategory.UngroundedAttributes: Tasks.UNGROUNDED_ATTRIBUTES,
30-
RiskCategory.XPIA: Tasks.XPIA,
30+
RiskCategory.IndirectAttack: Tasks.XPIA,
3131
_InternalRiskCategory.ECI: _InternalAnnotationTasks.ECI,
3232
RiskCategory.CodeVulnerability: Tasks.CODE_VULNERABILITY,
3333
}

sdk/evaluation/azure-ai-evaluation/tests/unittests/test_redteam/test_attack_objective_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_risk_category_enum_values(self):
2323
assert RiskCategory.ProtectedMaterial.value == "protected_material"
2424
assert RiskCategory.CodeVulnerability.value == "code_vulnerability"
2525
assert RiskCategory.UngroundedAttributes.value == "ungrounded_attributes"
26-
assert RiskCategory.XPIA.value == "xpia"
26+
assert RiskCategory.IndirectAttack.value == "indirect_attack"
2727

2828
# Ensure all values are lower case with underscores
2929
for category in RiskCategory:

0 commit comments

Comments
 (0)