Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Azure OpenAI Configuration (for the agent being tested)
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_MODEL=gpt-4o
# AZURE_OPENAI_API_KEY=your-api-key-here

# Azure AI Project Configuration (for red teaming)
# Create these resources at: https://portal.azure.com
FOUNDRY_PROJECT_ENDPOINT=your-ai-project-name
# Microsoft Foundry project, used by both the agent being tested (FoundryChatClient)
# and the red teaming scan. Authenticate with `az login`.
FOUNDRY_PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
FOUNDRY_MODEL=gpt-4o
15 changes: 6 additions & 9 deletions python/samples/05-end-to-end/evaluation/red_teaming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ A focused sample demonstrating Azure AI's RedTeam functionality to assess the sa
### Azure Resources
1. **Azure AI Hub and Project**: Create these in the Azure Portal
- Follow: https://learn.microsoft.com/azure/ai-foundry/how-to/create-projects
2. **Azure OpenAI Deployment**: Deploy a model (e.g., gpt-4o)
2. **Model Deployment**: Deploy a model (e.g., gpt-4o) in the Foundry project
3. **Azure CLI**: Install and authenticate with `az login`

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

```bash
# Azure OpenAI (for the agent being tested)
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_MODEL=gpt-4o
# AZURE_OPENAI_API_KEY is optional if using Azure CLI authentication

# Azure AI Project (for red teaming)
FOUNDRY_PROJECT_ENDPOINT=https://your-project.api.azureml.ms
# Microsoft Foundry project, used by both the agent being tested (FoundryChatClient)
# and the red teaming scan. Authentication uses Azure CLI credentials (`az login`).
FOUNDRY_PROJECT_ENDPOINT=https://<resource>.services.ai.azure.com/api/projects/<project>
FOUNDRY_MODEL=gpt-4o
```

See `.env.example` for a template.
Expand All @@ -60,7 +57,7 @@ python red_team_agent_sample.py
```

The sample will:
1. Create a financial advisor agent using Azure OpenAI
1. Create a financial advisor agent using `FoundryChatClient`
2. Set up an async callback to interface the agent with RedTeam
3. Run a comprehensive scan with 11 different attack strategies
4. Display results as a scorecard in the console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async def main() -> None:
credential = AzureCliCredential()
# Create the agent
# Constructor automatically reads from environment variables:
# AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_MODEL, AZURE_OPENAI_API_KEY
# FOUNDRY_PROJECT_ENDPOINT, FOUNDRY_MODEL
agent = Agent(
client=FoundryChatClient(credential=credential),
name="FinancialAdvisor",
Expand Down
Loading