Azure / Azure/azure-sdk-for-python

Python: RedTeam - (UserError) RedTeam target is invalid

Open
#41,561 2 comments 0 reactions 1 assignee Claimed by @singankit View on GitHub
AI Projects Client customer-reported needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

- **Package Name**: azure-ai-projects
- **Package Version**: 1.0.0b11
- **Operating System**: Windows
- **Python Version**: 3.13.3

**Describe the bug**
Creating a redteam run returns error:
_HttpResponseError: (UserError) RedTeam target is invalid
Code: UserError
Message: RedTeam target is invalid_

**To Reproduce**
Steps to reproduce the behavior:
following the official doc: [https://learn.microsoft.com/en-us/azure/ai-foundry/how-to/develop/run-ai-red-teaming-cloud?tabs=python](url) to config and create a redteam class
1. setup the project client on a Foundry Project based project, like _https://my-foundryproject-resource.services.ai.azure.com/api/projects/my-foundryproject_
2. configure model_endpoint as the Azure AI Foundry resource in the Foundry Project, as described in the doc, like: _https://my-foundryproject-resource.services.ai.azure.com_
3. set model_api_key as the key of the Azure AI Foundry resource on which the project is automatically linked
4. set model_deployment_name as one of the deployment available

**Expected behavior**
redteam run created and running

**Additional context**
Class RedTeam is referenced here: [https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/azure/ai/projects/models/_models.py](url).
Tried also with Azure OpenAI Resource directly connected to the project, got same error

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.