You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -56,39 +59,71 @@ Adversarial simulators use Azure AI Studio safety evaluation backend service to
56
59
57
60
The Adversarial simulator does not support selecting individual harms, instead we recommend running the `AdversarialSimulator` for 4x the number of specific harms as the `max_simulation_results`
58
61
59
-
60
62
### Simulator is slow
61
63
62
64
Identify the type of simulations being run (adversarial or non-adversarial).
63
65
Adjust parameters such as `api_call_retry_sleep_sec`, `api_call_delay_sec`, and `concurrent_async_task`. Please note that rate limits to llm calls can be both tokens per minute and requests per minute.
64
66
65
67
## Handle RedTeam errors
66
68
69
+
### Permission or authentication failures
70
+
- Run `az login` in the active shell before starting the scan and ensure the account has the **Azure AI User** role plus the `Storage Blob Data Contributor` assignment on the linked storage account. Both are required to create evaluation runs and upload artifacts.
71
+
- In secured hubs, confirm the linked storage account allows access from your network (or private endpoint) and that Entra ID authentication is enabled on the storage resource.
72
+
- If the helper warns `This may be due to missing environment variables or insufficient permissions.`, double-check the `AZURE_PROJECT_ENDPOINT`, `AGENT_NAME`, and storage role assignments before retrying.
73
+
67
74
### Target resource not found
68
-
When initializing an Azure OpenAI model directly as `target` for a `RedTeam` scan, ensure `azure_endpoint` is specified in the format `https://<hub>.openai.azure.com/openai/deployments/<deployment_name>/chat/completions?api-version=2025-01-01-preview`. If using `AzureOpenAI`, `endpoint` should be specified in the format `https://<hub>.openai.azure.com/`.
75
+
- When initializing an Azure OpenAI deployment directly as the `target`, specify `azure_endpoint` as `https://<hub>.openai.azure.com/openai/deployments/<deployment_name>/chat/completions?api-version=2025-01-01-preview`.
76
+
- If you instantiate `AzureOpenAI`, use the resource-level endpoint format `https://<hub>.openai.azure.com/` and ensure the deployment name plus API version match an active deployment.
77
+
- A cloud run error such as `Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}` when creating the eval group can also indicate that `azure-ai-projects>=2.0.0b1` is not installed. Upgrade to that version or later to access the preview APIs used by Red Team.
78
+
79
+
### Agent name not found
80
+
- `(not_found) Agent <name> doesn’t exist` means the Azure AI project could not resolve the agent `name`. Names are case sensitive and differ from display names.
81
+
- Verify the `AZURE_PROJECT_ENDPOINT` points to the correct project and that the agent is published there.
82
+
- Requires `DefaultAzureCredential` from `azure.identity` and `AIProjectClient` from `azure.ai.projects`.
83
+
- Use the following helper to list agents in the current project and confirm the `name` column matches your `AGENT_NAME` value:
If you see an error like `WARNING: Failed to log artifacts to MLFlow: (UserError) Failed to upload evaluation run to the cloud due to insufficient permission to access the storage`, you need to ensure that proper permissions are assigned to the storage account linked to your Azure AI Project.
72
-
73
-
To fix this issue:
74
-
1. Open the associated resource group being used in your Azure AI Project in the Azure Portal
75
-
2. Look up the storage accounts associated with that resource group
76
-
3. Open each storage account and click on "Access control (IAM)" on the left side navigation
77
-
4. Add permissions for the desired users with the "Storage Blob Data Contributor" role
78
-
79
-
If you have Azure CLI, you can use the following command:
80
-
81
-
```Shell
82
-
# <mySubscriptionID>: Subscription ID of the Azure AI Studio hub's linked storage account (available in Azure AI hub resource view in Azure Portal).
83
-
# <myResourceGroupName>: Resource group of the Azure AI Studio hub's linked storage account.
84
-
# <user-id>: User object ID for role assignment (retrieve with "az ad user show" command).
85
-
86
-
az role assignment create --role "Storage Blob Data Contributor" --scope /subscriptions/<mySubscriptionID>/resourceGroups/<myResourceGroupName> --assignee-principal-type User --assignee-object-id "<user-id>"
87
-
```
109
+
- `WARNING: Failed to log artifacts to MLFlow: (UserError) Failed to upload evaluation run to the cloud due to insufficient permission to access the storage` means the linked storage account is missing the necessary assignments.
110
+
- Portal steps:
111
+
1. Open the resource group tied to the Azure AI Project in the Azure Portal.
112
+
2. Locate the linked storage account(s).
113
+
3. Select each storage account and choose **Access control (IAM)**.
114
+
4. Grant the affected identity the **Storage Blob Data Contributor** role.
115
+
- Prefer CLI? Reuse the `az role assignment create` command described in [Troubleshoot Remote Tracking Issues](#troubleshoot-remote-tracking-issues).
116
+
117
+
### PyRIT "Error sending prompt" message
118
+
- `Exception: Error sending prompt with conversation ID: <guid>` is raised by PyRIT when a target LLM call fails inside the `PromptSendingOrchestrator`. The runner retries the conversation up to the configured limit, so occasional occurrences usually resolve automatically.
119
+
- Common triggers include transient network issues, 429 throttling, or 5xx responses from the target deployment. Even if retries succeed you will still see the stack trace in notebook output.
120
+
- Inspect the `redteam.log` file written to the scan output directory (typically `<working dir>/runs/<scan_id>/redteam.log`) for the underlying exception and HTTP status. Increase verbosity with `DEBUG=True` for deeper diagnostics.
121
+
- Running in Azure AI Studio? Navigate to **Evaluate > Red Team > <run name> > Logs**, download `redteam.log`, and search for the conversation ID to inspect the payload.
122
+
- If one conversation ID keeps failing after retries, verify the target credentials, check deployment health, and review Azure OpenAI quota or rate-limit alerts in the Azure portal.
88
123
89
124
## Logging
90
125
91
-
You can set logging level via environment variable `PF_LOGGING_LEVEL`, valid values includes`CRITICAL`, `ERROR`, `WARNING`, `INFO`, `DEBUG`, default to`INFO`.
126
+
You can set logging level via environment variable `PF_LOGGING_LEVEL`, valid values include `CRITICAL`, `ERROR`, `WARNING`, `INFO`, `DEBUG`; default is `INFO`.
0 commit comments