@@ -6,7 +6,7 @@ ms.service: azure-ai-foundry
6
6
ms.custom :
7
7
- references_regions
8
8
ms.topic : how-to
9
- ms.date : 07/23 /2025
9
+ ms.date : 09/02 /2025
10
10
ms.reviewer : minthigpen
11
11
ms.author : lagayhar
12
12
author : lgayhardt
@@ -29,7 +29,7 @@ Though the AI Red Teaming Agent (preview) can be run [locally](run-scans-ai-red-
29
29
First, install Azure AI Foundry SDK's project client, which runs the AI Red Teaming Agent in the cloud.
30
30
31
31
``` python
32
- uv install azure- ai- projects azure- identity
32
+ uv install azure- ai- projects== 1.1 .0b3 azure- identity
33
33
```
34
34
35
35
> [ !NOTE]
@@ -98,28 +98,28 @@ with AIProjectClient(
98
98
credential = DefaultAzureCredential(exclude_interactive_browser_credential = False ),
99
99
) as project_client:
100
100
101
- # Create target configuration for testing an Azure OpenAI model
102
- target_config = AzureOpenAIModelConfiguration(model_deployment_name = model_deployment_name)
101
+ # Create target configuration for testing an Azure OpenAI model
102
+ target_config = AzureOpenAIModelConfiguration(model_deployment_name = model_deployment_name)
103
103
104
- # Instantiate the AI Red Teaming Agent
105
- red_team_agent = RedTeam(
106
- attack_strategies = [AttackStrategy.BASE64 ],
107
- risk_categories = [RiskCategory.VIOLENCE ],
108
- display_name = " red-team-cloud-run" ,
109
- target = target_config,
110
- )
104
+ # Instantiate the AI Red Teaming Agent
105
+ red_team_agent = RedTeam(
106
+ attack_strategies = [AttackStrategy.BASE64 ],
107
+ risk_categories = [RiskCategory.VIOLENCE ],
108
+ display_name = " red-team-cloud-run" ,
109
+ target = target_config,
110
+ )
111
111
112
- # Create and run the red teaming scan
113
- # If you configured target using Option 1, use:
114
- # headers = {"model-endpoint": model_endpoint, "api-key": model_api_key}
115
- # If you configured target using Option 2, use:
116
- # headers = {}
112
+ # Create and run the red teaming scan
113
+ # If you configured target using Option 1, use:
114
+ # headers = {"model-endpoint": model_endpoint, "api-key": model_api_key}
115
+ # If you configured target using Option 2, use:
116
+ # headers = {}
117
117
118
- # Choose one of the following based on your configuration option:
119
- headers = {" model-endpoint" : model_endpoint, " api-key" : model_api_key} # For Option 1
120
- # headers = {} # For Option 2
118
+ # Choose one of the following based on your configuration option:
119
+ headers = {" model-endpoint" : model_endpoint, " api-key" : model_api_key} # For Option 1
120
+ # headers = {} # For Option 2
121
121
122
- red_team_response = project_client.red_teams.create(red_team = red_team_agent, headers = headers)
122
+ red_team_response = project_client.red_teams.create(red_team = red_team_agent, headers = headers)
123
123
```
124
124
125
125
# [ cURL] ( #tab/curl )
0 commit comments