Skip to content

Commit 3d930b3

Browse files
committed
Python: use FOUNDRY_* settings in the red teaming sample README
1 parent 67ba500 commit 3d930b3

3 files changed

Lines changed: 11 additions & 18 deletions

File tree

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# Azure OpenAI Configuration (for the agent being tested)
2-
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
3-
AZURE_OPENAI_MODEL=gpt-4o
4-
# AZURE_OPENAI_API_KEY=your-api-key-here
5-
6-
# Azure AI Project Configuration (for red teaming)
7-
# Create these resources at: https://portal.azure.com
8-
FOUNDRY_PROJECT_ENDPOINT=your-ai-project-name
1+
# Microsoft Foundry project, used by both the agent being tested (FoundryChatClient)
2+
# and the red teaming scan. Authenticate with `az login`.
3+
FOUNDRY_PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
4+
FOUNDRY_MODEL=gpt-4o

‎python/samples/05-end-to-end/evaluation/red_teaming/README.md‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ A focused sample demonstrating Azure AI's RedTeam functionality to assess the sa
2626
### Azure Resources
2727
1. **Azure AI Hub and Project**: Create these in the Azure Portal
2828
- Follow: https://learn.microsoft.com/azure/ai-foundry/how-to/create-projects
29-
2. **Azure OpenAI Deployment**: Deploy a model (e.g., gpt-4o)
29+
2. **Model Deployment**: Deploy a model (e.g., gpt-4o) in the Foundry project
3030
3. **Azure CLI**: Install and authenticate with `az login`
3131

3232
### Python Environment
@@ -41,13 +41,10 @@ Note: The sample uses `python-dotenv` to load environment variables from a `.env
4141
Create a `.env` file in this directory or set these environment variables:
4242

4343
```bash
44-
# Azure OpenAI (for the agent being tested)
45-
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
46-
AZURE_OPENAI_MODEL=gpt-4o
47-
# AZURE_OPENAI_API_KEY is optional if using Azure CLI authentication
48-
49-
# Azure AI Project (for red teaming)
50-
FOUNDRY_PROJECT_ENDPOINT=https://your-project.api.azureml.ms
44+
# Microsoft Foundry project, used by both the agent being tested (FoundryChatClient)
45+
# and the red teaming scan. Authentication uses Azure CLI credentials (`az login`).
46+
FOUNDRY_PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
47+
FOUNDRY_MODEL=gpt-4o
5148
```
5249

5350
See `.env.example` for a template.
@@ -60,7 +57,7 @@ python red_team_agent_sample.py
6057
```
6158

6259
The sample will:
63-
1. Create a financial advisor agent using Azure OpenAI
60+
1. Create a financial advisor agent using `FoundryChatClient`
6461
2. Set up an async callback to interface the agent with RedTeam
6562
3. Run a comprehensive scan with 11 different attack strategies
6663
4. Display results as a scorecard in the console

‎python/samples/05-end-to-end/evaluation/red_teaming/red_team_agent_sample.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def main() -> None:
5353
credential = AzureCliCredential()
5454
# Create the agent
5555
# Constructor automatically reads from environment variables:
56-
# AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_MODEL, AZURE_OPENAI_API_KEY
56+
# FOUNDRY_PROJECT_ENDPOINT, FOUNDRY_MODEL
5757
agent = Agent(
5858
client=FoundryChatClient(credential=credential),
5959
name="FinancialAdvisor",

0 commit comments

Comments
 (0)