Gallery › Cognitive Services › Azure built-in policies
[Preview]: Cognitive Services Agents should only use allowed prompt content filtering
Doesn't convert yet Policy Audit Disabled Mode Microsoft.CognitiveServices.Data Version 1.0.0-preview Preview
Mandate minimum levels of content filtering for prompt content for agents within your organization.
ConvertTo-Bylaw can't convert this policy yet:
- BYL6002 Its mode, Microsoft.CognitiveServices.Data, is a resource provider mode, which language version 1.0 doesn't support.
Azure Policy JSONAllowAgentPromptControl_Audit.json · 124 lines
{
"properties": {
"displayName": "[Preview]: Cognitive Services Agents should only use allowed prompt content filtering",
"policyType": "BuiltIn",
"mode": "Microsoft.CognitiveServices.Data",
"description": "Mandate minimum levels of content filtering for prompt content for agents within your organization.",
"metadata": {
"version": "1.0.0-preview",
"category": "Cognitive Services",
"preview": true
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy."
}
},
"entityKind": {
"type": "Array",
"metadata": {
"displayName": "Entity Kind",
"description": "List of allowed entity kinds for agents. Only agents with an entity kind in this list will be evaluated by the policy."
}
},
"filterName": {
"type": "string",
"allowedValues": [
"Profanity",
"Jailbreak",
"Indirect Attack",
"Indirect Attack Spotlighting"
],
"metadata": {
"displayName": "Content Filter",
"description": "Content filter name."
}
},
"allowedEnabledForPrompt": {
"type": "Array",
"defaultValue": [
"true"
],
"allowedValues": [
"true",
"false"
],
"metadata": {
"displayName": "Allowed Enabled Configuration for Prompt",
"description": "List of acceptable Enabled values for Prompt. Can be set to true, false, or both. True implies that content filtering must be Enabled, False implies that content filtering must be disabled, and setting both true and false implies that either setting is okay."
}
},
"allowedBlockingForPrompt": {
"type": "Array",
"defaultValue": [
"true"
],
"allowedValues": [
"true",
"false"
],
"metadata": {
"displayName": "Allowed Blocking Configuration for Prompt",
"description": "List of acceptable Blocking values for Prompt. Can be set to true, false, or both. True implies that content filtering must be blocking, False implies that content filtering must not be blocking, and setting both true and false implies that either setting is okay."
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.CognitiveServices.Data/accounts/projects/agents"
},
{
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/entityKind",
"in": "[parameters('entityKind')]"
},
{
"count": {
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/raiPolicy.contentFilters[*]",
"where": {
"allOf": [
{
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/raiPolicy.contentFilters[*].name",
"equals": "[parameters('filterName')]"
},
{
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/raiPolicy.contentFilters[*].source",
"equals": "Prompt"
},
{
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/raiPolicy.contentFilters[*].enabled",
"in": "[parameters('allowedEnabledForPrompt')]"
},
{
"field": "Microsoft.CognitiveServices.Data/accounts/projects/agents/raiPolicy.contentFilters[*].blocking",
"in": "[parameters('allowedBlockingForPrompt')]"
}
]
}
},
"equals": 0
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/9224c1cc-34fc-44f1-ad08-5c4b079c9ce6",
"name": "9224c1cc-34fc-44f1-ad08-5c4b079c9ce6"
}Source: built-in-policies/policyDefinitions/Cognitive Services/AllowAgentPromptControl_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw