fix: name the azure.yaml key in the RAI policy validation error - #9328
Conversation
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 21 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Pull request overview
Clarifies RAI policy configuration for unified azure.yaml agent definitions.
Changes:
- Improves policy validation messaging.
- Adds policy round-trip and deployment tests.
- Documents policy configuration and key naming.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
README.md |
Documents content safety policies. |
agent_policies_test.go |
Adds unified-shape regression coverage. |
parse.go |
Names both supported policy keys. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
cli/azd/extensions/azure.ai.agents/README.md:62
azd-code-reviewer: Add the inline agentnameto this example. Runtime validation requiresAgentDefinition.Nameand does not derive it from theservices.my-agentmap key, so copying this snippet fails withtemplate.name not in valid format: name cannot be emptybefore the policy can be deployed.
kind: hosted
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
cli/azd/extensions/azure.ai.agents/README.md:54
RAIexpands to “Responsible AI,” not “Azure AI Content Safety.” Use the product terminology so readers can identify and search for the correct policy type.
A hosted agent can be bound to an Azure AI Content Safety (RAI) policy so every
cli/azd/extensions/azure.ai.agents/README.md:74
- Document the effective cardinality of RAI policies.
mapRaiConfigreturns the first matching entry and validation accepts multiple entries, so users can list several policies while only the first is sent to Foundry. This is especially important for safety configuration; either state the first-entry behavior here or reject duplicaterai_policyentries.
- `type` is required. `rai_policy` is currently the only supported value.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
cli/azd/extensions/azure.ai.agents/README.md:77
- azd-code-reviewer: The documented list accepts multiple
rai_policyentries, butmapRaiConfigreturns the first match and the data-plane model has only oneRaiConfig; every later policy is silently ignored. For a safety setting, this can leave a policy the user intended to apply unused. Reject duplicate RAI policies during validation (with a regression test), or explicitly document that only the first entry is effective.
- `type` is required. `rai_policy` is currently the only supported value.
Fixes #8709
RAI policies already flow from unified
azure.yamlagent definitions to the Foundry API, but this path lacked coverage and documentation. The validation error also suggested the legacyrai_policy_namekey, even though unifiedazure.yamlusesraiPolicyName.Sample PR: https://github.com/microsoft-foundry/foundry-samples-pr/pull/802
Doc PR: https://github.com/MicrosoftDocs/azure-ai-docs-pr/pull/13567