Skip to content

Commit 15b49f2

Browse files
committed
Update code for AI red teaming cloud
1 parent 07d683e commit 15b49f2

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

articles/ai-foundry/how-to/develop/run-ai-red-teaming-cloud.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: azure-ai-foundry
66
ms.custom:
77
- references_regions
88
ms.topic: how-to
9-
ms.date: 07/23/2025
9+
ms.date: 09/02/2025
1010
ms.reviewer: minthigpen
1111
ms.author: lagayhar
1212
author: lgayhardt
@@ -29,7 +29,7 @@ Though the AI Red Teaming Agent (preview) can be run [locally](run-scans-ai-red-
2929
First, install Azure AI Foundry SDK's project client, which runs the AI Red Teaming Agent in the cloud.
3030

3131
```python
32-
uv install azure-ai-projects azure-identity
32+
uv install azure-ai-projects==1.1.0b3 azure-identity
3333
```
3434

3535
> [!NOTE]
@@ -98,28 +98,28 @@ with AIProjectClient(
9898
credential=DefaultAzureCredential(exclude_interactive_browser_credential=False),
9999
) as project_client:
100100

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)
103103

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+
)
111111

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 = {}
117117

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
121121

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)
123123
```
124124

125125
# [cURL](#tab/curl)

0 commit comments

Comments
 (0)