Skip to content

fix: name the azure.yaml key in the RAI policy validation error - #9328

Merged
trangevi merged 4 commits into
mainfrom
hui/rai-policy-unified-azure-yaml-coverage
Jul 29, 2026
Merged

fix: name the azure.yaml key in the RAI policy validation error#9328
trangevi merged 4 commits into
mainfrom
hui/rai-policy-unified-azure-yaml-coverage

Conversation

@huimiu

@huimiu huimiu commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes #8709

RAI policies already flow from unified azure.yaml agent definitions to the Foundry API, but this path lacked coverage and documentation. The validation error also suggested the legacy rai_policy_name key, even though unified azure.yaml uses raiPolicyName.

Sample PR: https://github.com/microsoft-foundry/foundry-samples-pr/pull/802
Doc PR: https://github.com/MicrosoftDocs/azure-ai-docs-pr/pull/13567

Copilot AI review requested due to automatic review settings July 28, 2026 06:25
@github-actions

Copy link
Copy Markdown

📋 Prioritization Note

Thanks for the contribution! The linked issue isn't in the current milestone yet.
Thank you for logging this issue; our team is reviewing it. If you need urgent prioritization, tag @RickWinter and @kristenwomack to let us know.

@azure-pipelines

Copy link
Copy Markdown
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread cli/azd/extensions/azure.ai.agents/README.md
Copilot AI review requested due to automatic review settings July 28, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 agent name to this example. Runtime validation requires AgentDefinition.Name and does not derive it from the services.my-agent map key, so copying this snippet fails with template.name not in valid format: name cannot be empty before the policy can be deployed.
    kind: hosted

@github-actions github-actions Bot added the ext-agents azure.ai.agents extension label Jul 28, 2026
Copilot AI review requested due to automatic review settings July 28, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • RAI expands 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. mapRaiConfig returns 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 duplicate rai_policy entries.
- `type` is required. `rai_policy` is currently the only supported value.

Copilot AI review requested due to automatic review settings July 28, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_policy entries, but mapRaiConfig returns the first match and the data-plane model has only one RaiConfig; 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.

@trangevi
trangevi merged commit f91b4c4 into main Jul 29, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext-agents azure.ai.agents extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate rai policy to unified azure.yaml

4 participants