{ "swagger": "2.0", "info": { "title": "ContentSafety Service", "version": "2026-09-01-preview", "description": "Analyze harmful content", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "x-ms-parameterized-host": { "hostTemplate": "{endpoint}/contentsafety", "useSchemePrefix": false, "parameters": [ { "name": "endpoint", "in": "path", "description": "Supported Cognitive Services endpoints (protocol and hostname, for example:\nhttps://.cognitiveservices.azure.com).", "required": true, "type": "string", "format": "uri", "x-ms-skip-url-encoding": true } ] }, "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "ApiKeyAuth": [] }, { "OAuth2Auth": [ "https://cognitiveservices.azure.com/.default" ] } ], "securityDefinitions": { "ApiKeyAuth": { "type": "apiKey", "name": "Ocp-Apim-Subscription-Key", "in": "header" }, "OAuth2Auth": { "type": "oauth2", "flow": "application", "scopes": { "https://cognitiveservices.azure.com/.default": "" }, "tokenUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/token" } }, "tags": [], "paths": { "/content:unifiedModerate": { "post": { "operationId": "UnifiedOperations_UnifiedModerate", "summary": "Unified Moderate", "description": "A synchronous API that evaluates input, output, a proposed tool call, or a completed tool result against an applicable Agent Control Specification policy and returns the enforced content and policy verdict.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The unified moderation request.", "required": true, "schema": { "$ref": "#/definitions/UnifiedModerateOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/UnifiedModerateResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Moderate content using an ACS policy": { "$ref": "./examples/UnifiedModerate.json" } } } }, "/image:analyze": { "post": { "operationId": "ImageOperations_AnalyzeImage", "summary": "Analyze Image", "description": "A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The image analysis request.", "required": true, "schema": { "$ref": "#/definitions/AnalyzeImageOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AnalyzeImageResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Analyze Image": { "$ref": "./examples/AnalyzeImage.json" } } } }, "/provenance/operations/{operationId}": { "get": { "operationId": "ContentProvenanceOperations_GetOperationStatus", "summary": "Get Content Provenance Detection Status", "description": "Gets the status, result, or error of an asynchronous Content Provenance Detection operation.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "operationId", "in": "path", "description": "The unique ID of the operation.", "required": true, "type": "string" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ProvenanceDetectOperation" }, "headers": { "Retry-After": { "type": "integer", "format": "int32", "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get Content Provenance Detection Status": { "$ref": "./examples/ProvenanceGetOperationStatus.json" } } } }, "/provenance:detect": { "post": { "operationId": "ContentProvenanceOperations_Detect", "summary": "Start Content Provenance Detection", "description": "Starts an asynchronous Content Provenance Detection operation that inspects the supplied media for Microsoft-issued C2PA and imperceptible watermark signals indicating the content was created or modified using AI.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "options", "in": "body", "description": "Options describing the media to inspect using Content Provenance Detection.", "required": true, "schema": { "$ref": "#/definitions/DetectProvenanceOptions" } } ], "responses": { "202": { "description": "The request has been accepted for processing, but processing has not yet completed.", "schema": { "type": "object", "description": "Provides status details for long running operations.", "properties": { "id": { "type": "string", "description": "The unique ID of the operation." }, "status": { "$ref": "#/definitions/Azure.Core.Foundations.OperationState", "description": "The status of the operation" }, "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "Error object that describes the error when status is \"Failed\"." }, "result": { "$ref": "#/definitions/DetectProvenanceResult", "description": "The result of the operation." } }, "required": [ "id", "status" ] }, "headers": { "Operation-Location": { "type": "string", "format": "uri", "description": "The location for monitoring the operation state." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Start Content Provenance Detection": { "$ref": "./examples/ProvenanceDetect.json" } }, "x-ms-long-running-operation-options": { "final-state-via": "operation-location" }, "x-ms-long-running-operation": true } }, "/text/blocklists": { "get": { "operationId": "TextBlocklists_ListTextBlocklists", "summary": "Get All Text Blocklists", "description": "Get all text blocklists details.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PagedTextBlocklist" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get All Text Blocklists": { "$ref": "./examples/ListTextBlocklists.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/text/blocklists/{blocklistName}": { "get": { "operationId": "TextBlocklists_GetTextBlocklist", "summary": "Get Text Blocklist By blocklistName", "description": "Returns text blocklist details.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/TextBlocklist" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get Text Blocklist By blocklistName": { "$ref": "./examples/GetTextBlocklist.json" } } }, "patch": { "operationId": "TextBlocklists_CreateOrUpdateTextBlocklist", "summary": "Create Or Update Text Blocklist", "description": "Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created.", "consumes": [ "application/merge-patch+json" ], "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" }, { "name": "resource", "in": "body", "description": "The resource instance.", "required": true, "schema": { "$ref": "#/definitions/TextBlocklistCreateOrUpdate" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/TextBlocklist" } }, "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { "$ref": "#/definitions/TextBlocklist" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Create Or Update Text Blocklist": { "$ref": "./examples/CreateOrUpdateTextBlocklist.json" } } }, "delete": { "operationId": "TextBlocklists_DeleteTextBlocklist", "summary": "Delete Text Blocklist By blocklistName", "description": "Deletes a text blocklist.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. " }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Delete Text Blocklist By blocklistName": { "$ref": "./examples/DeleteTextBlocklist.json" } } } }, "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems": { "post": { "operationId": "TextBlocklists_AddOrUpdateBlocklistItems", "summary": "Add or update BlocklistItems To Text Blocklist", "description": "Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" }, { "name": "body", "in": "body", "description": "Options for adding or updating blocklist items.", "required": true, "schema": { "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AddOrUpdateTextBlocklistItemsResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Add or Update BlocklistItems To Text Blocklist": { "$ref": "./examples/AddOrUpdateBlocklistItems.json" } } } }, "/text/blocklists/{blocklistName}:removeBlocklistItems": { "post": { "operationId": "TextBlocklists_RemoveBlocklistItems", "summary": "Remove BlocklistItems From Text Blocklist", "description": "Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" }, { "name": "body", "in": "body", "description": "Options for removing blocklist items.", "required": true, "schema": { "$ref": "#/definitions/RemoveTextBlocklistItemsOptions" } } ], "responses": { "204": { "description": "There is no content to send for this request, but the headers may be useful. " }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Remove BlockItems From Text Blocklist": { "$ref": "./examples/RemoveBlocklistItems.json" } } } }, "/text/blocklists/{blocklistName}/blocklistItems": { "get": { "operationId": "TextBlocklists_ListTextBlocklistItems", "summary": "Get All BlocklistItems By blocklistName", "description": "Get all blocklistItems in a text blocklist.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" }, { "$ref": "#/parameters/Azure.Core.TopQueryParameter" }, { "$ref": "#/parameters/Azure.Core.SkipQueryParameter" }, { "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/PagedTextBlocklistItem" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get All BlockItems By blocklistName": { "$ref": "./examples/ListTextBlocklistItems.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": { "get": { "operationId": "TextBlocklists_GetTextBlocklistItem", "summary": "Get BlocklistItem By blocklistName And blocklistItemId", "description": "Get blocklistItem by blocklistName and blocklistItemId from a text blocklist.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "blocklistName", "in": "path", "description": "Text blocklist name.", "required": true, "type": "string", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$" }, { "name": "blocklistItemId", "in": "path", "description": "The service will generate a BlocklistItemId, which will be a UUID.", "required": true, "type": "string", "maxLength": 64 } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/TextBlocklistItem" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Get BlockItem By blocklistName And blocklistItemId": { "$ref": "./examples/GetTextBlocklistItem.json" } } } }, "/text:analyze": { "post": { "operationId": "TextOperations_AnalyzeText", "summary": "Analyze Text", "description": "A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The text analysis request.", "required": true, "schema": { "$ref": "#/definitions/AnalyzeTextOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/AnalyzeTextResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Analyze Text": { "$ref": "./examples/AnalyzeText.json" } } } }, "/text:detectProtectedMaterial": { "post": { "operationId": "TextOperations_DetectTextProtectedMaterial", "summary": "Detect Protected Material for Text", "description": "A synchronous API for detecting protected material in the given text.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The request body to be detected, which may contain protected material.", "required": true, "schema": { "$ref": "#/definitions/DetectTextProtectedMaterialOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/DetectTextProtectedMaterialResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Detect Protected Material for Text": { "$ref": "./examples/DetectTextProtectedMaterial.json" } } } }, "/text:shieldPrompt": { "post": { "operationId": "TextOperations_ShieldPrompt", "summary": "Shield Prompt", "description": "A synchronous API for shielding prompt from direct and indirect injection attacks.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "body", "in": "body", "description": "The request body to be detected, which may contain direct or indirect injection attacks.", "required": true, "schema": { "$ref": "#/definitions/ShieldPromptOptions" } } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ShieldPromptResult" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" }, "headers": { "x-ms-error-code": { "type": "string", "description": "String error code indicating what went wrong." } } } }, "x-ms-examples": { "Shield Prompt": { "$ref": "./examples/ShieldPrompt.json" } } } } }, "definitions": { "AcsApproval": { "type": "object", "description": "Approval metadata returned by an ACS deny decision. Unified Moderate does not invoke an approval workflow.", "properties": { "type": { "type": "string", "description": "The type of approval required by the policy." } }, "required": [ "type" ] }, "AcsDecision": { "type": "string", "description": "The canonical decision returned by Agent Control Specification policy evaluation.", "enum": [ "allow", "deny", "transform" ], "x-ms-enum": { "name": "AcsDecision", "modelAsString": true, "values": [ { "name": "Allow", "value": "allow", "description": "Allow the original content." }, { "name": "Deny", "value": "deny", "description": "Deny the content." }, { "name": "Transform", "value": "transform", "description": "Apply an allowed canonical transform." } ] } }, "AcsEvidence": { "type": "object", "description": "Evidence or a verification pointer returned by policy evaluation.", "properties": { "id": { "type": "string", "description": "An optional evidence identifier." }, "type": { "type": "string", "description": "An optional evidence type." }, "uri": { "type": "string", "format": "uri", "description": "An optional location containing or describing the evidence." }, "description": { "type": "string", "description": "An optional human-readable evidence description." } } }, "AcsHarmDetail": { "type": "object", "description": "The detection result for one blocklist evaluated as part of a harm result.", "properties": { "detected": { "type": "boolean", "description": "Whether the blocklist was detected." }, "id": { "type": "string", "description": "The identifier of the evaluated blocklist." } }, "required": [ "detected", "id" ] }, "AcsHarmResult": { "type": "object", "description": "The moderation and policy-attribution result for one harm category. The category name is the key in the harmResults map and is not restricted to a predefined set.", "properties": { "blocked": { "type": "boolean", "description": "Whether this harm contributed to the overall ACS verdict blocking the content." }, "detected": { "type": "boolean", "description": "Whether this harm was detected, regardless of whether it caused the overall verdict to block." }, "severity": { "type": "string", "description": "An optional harm-specific severity value. The value is defined by the moderation model or policy that produced the result." }, "details": { "type": "array", "description": "Optional blocklist results. Each item identifies one evaluated blocklist and whether it was detected.", "items": { "$ref": "#/definitions/AcsHarmDetail" } }, "url": { "type": "string", "format": "uri", "description": "An optional internet location associated with detected protected material." }, "license": { "type": "string", "description": "An optional license description associated with detected protected material." } }, "required": [ "blocked", "detected" ] }, "AcsTransform": { "type": "object", "description": "A canonical ACS transform applied by Unified Moderate.", "properties": { "path": { "type": "string", "description": "The transformation target path. For input and output sources, the allowed path is `$target.content`. For tool sources, `$target` replaces the complete value and a path rooted at `$target` replaces an individual member." }, "value": { "type": "string", "description": "A string containing the JSON-encoded replacement value applied at the target path." } }, "required": [ "path", "value" ] }, "AcsVerdict": { "type": "object", "description": "The complete Agent Control Specification policy verdict.", "properties": { "decision": { "$ref": "#/definitions/AcsDecision", "description": "The canonical policy decision." }, "reason": { "type": "string", "description": "An optional machine-readable reason for the decision." }, "message": { "type": "string", "description": "An optional human-readable message for the decision." }, "warnings": { "type": "array", "description": "Optional non-blocking warnings produced by policy evaluation.", "items": { "type": "string" } }, "approval": { "$ref": "#/definitions/AcsApproval", "description": "Optional approval metadata for a deny decision. Unified Moderate does not invoke an approval workflow, so the content remains blocked." }, "transform": { "$ref": "#/definitions/AcsTransform", "description": "Canonical transform metadata. Required when the decision is transform." }, "evidence": { "type": "array", "description": "Optional policy evidence and verification pointers.", "items": { "$ref": "#/definitions/AcsEvidence" } }, "harmResults": { "type": "object", "description": "Optional moderation results keyed by harm category. Category names come from the policy harm configuration and are not restricted to a predefined set. A policy deny that is unrelated to a configured harm can omit this property.", "additionalProperties": { "$ref": "#/definitions/AcsHarmResult" } } }, "required": [ "decision" ] }, "AddOrUpdateTextBlocklistItemsOptions": { "type": "object", "description": "The request to add blocklistItems to a text blocklist.", "properties": { "blocklistItems": { "type": "array", "description": "Array of blocklistItems to add.", "items": { "$ref": "#/definitions/TextBlocklistItem" } } }, "required": [ "blocklistItems" ] }, "AddOrUpdateTextBlocklistItemsResult": { "type": "object", "description": "The response of adding blocklistItems to the text blocklist.", "properties": { "blocklistItems": { "type": "array", "description": "Array of blocklistItems have been added.", "items": { "$ref": "#/definitions/TextBlocklistItem" } } }, "required": [ "blocklistItems" ] }, "AnalyzeImageOptions": { "type": "object", "description": "The image analysis request.", "properties": { "image": { "$ref": "#/definitions/ImageData", "description": "The image to be analyzed." }, "categories": { "type": "array", "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", "items": { "$ref": "#/definitions/ImageCategory" } }, "outputType": { "type": "string", "description": "This refers to the type of image analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", "default": "FourSeverityLevels", "enum": [ "FourSeverityLevels" ], "x-ms-enum": { "name": "AnalyzeImageOutputType", "modelAsString": true, "values": [ { "name": "FourSeverityLevels", "value": "FourSeverityLevels", "description": "Output severities in four levels, the value could be 0,2,4,6." } ] } } }, "required": [ "image" ] }, "AnalyzeImageResult": { "type": "object", "description": "The image analysis response.", "properties": { "categoriesAnalysis": { "type": "array", "description": "Analysis result for categories.", "items": { "$ref": "#/definitions/ImageCategoriesAnalysis" } } }, "required": [ "categoriesAnalysis" ] }, "AnalyzeTextOptions": { "type": "object", "description": "The text analysis request.", "properties": { "text": { "type": "string", "description": "The text to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request.", "maxLength": 10000 }, "categories": { "type": "array", "description": "The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned.", "items": { "$ref": "#/definitions/TextCategory" } }, "blocklistNames": { "type": "array", "description": "The names of blocklists.", "items": { "type": "string" } }, "haltOnBlocklistHit": { "type": "boolean", "description": "When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit." }, "outputType": { "type": "string", "description": "This refers to the type of text analysis output. If no value is assigned, the default value will be \"FourSeverityLevels\".", "default": "FourSeverityLevels", "enum": [ "FourSeverityLevels", "EightSeverityLevels" ], "x-ms-enum": { "name": "AnalyzeTextOutputType", "modelAsString": true, "values": [ { "name": "FourSeverityLevels", "value": "FourSeverityLevels", "description": "Output severities in four levels, the value could be 0,2,4,6." }, { "name": "EightSeverityLevels", "value": "EightSeverityLevels", "description": "Output severities in eight levels, the value could be 0,1,2,3,4,5,6,7." } ] } } }, "required": [ "text" ] }, "AnalyzeTextResult": { "type": "object", "description": "The text analysis response.", "properties": { "blocklistsMatch": { "type": "array", "description": "The blocklist match details.", "items": { "$ref": "#/definitions/TextBlocklistMatch" } }, "categoriesAnalysis": { "type": "array", "description": "Analysis result for categories.", "items": { "$ref": "#/definitions/TextCategoriesAnalysis" } } }, "required": [ "categoriesAnalysis" ] }, "Azure.Core.Foundations.Error": { "type": "object", "description": "The error object.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "message": { "type": "string", "description": "A human-readable representation of the error." }, "target": { "type": "string", "description": "The target of the error." }, "details": { "type": "array", "description": "An array of details about specific errors that led to this reported error.", "items": { "$ref": "#/definitions/Azure.Core.Foundations.Error" } }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "An object containing more specific information than the current object about the error." } }, "required": [ "code", "message" ] }, "Azure.Core.Foundations.ErrorResponse": { "type": "object", "description": "A response containing error details.", "properties": { "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "The error object." } }, "required": [ "error" ] }, "Azure.Core.Foundations.InnerError": { "type": "object", "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", "properties": { "code": { "type": "string", "description": "One of a server-defined set of error codes." }, "innererror": { "$ref": "#/definitions/Azure.Core.Foundations.InnerError", "description": "Inner error." } } }, "Azure.Core.Foundations.OperationState": { "type": "string", "description": "Enum describing allowed operation states.", "enum": [ "NotStarted", "Running", "Succeeded", "Failed", "Canceled" ], "x-ms-enum": { "name": "OperationState", "modelAsString": true, "values": [ { "name": "NotStarted", "value": "NotStarted", "description": "The operation has not started." }, { "name": "Running", "value": "Running", "description": "The operation is in progress." }, { "name": "Succeeded", "value": "Succeeded", "description": "The operation has completed successfully." }, { "name": "Failed", "value": "Failed", "description": "The operation has failed." }, { "name": "Canceled", "value": "Canceled", "description": "The operation has been canceled by the user." } ] } }, "DetectOutcome": { "type": "string", "description": "Top-level outcome of a Content Provenance Detection operation.", "enum": [ "NoProvenanceDetected", "ProvenanceDetected" ], "x-ms-enum": { "name": "DetectOutcome", "modelAsString": true, "values": [ { "name": "NoProvenanceDetected", "value": "NoProvenanceDetected", "description": "No supported Microsoft-issued C2PA or imperceptible watermark signal was detected.\nThis doesn't necessarily mean the content wasn't AI-generated; it means no supported signal was found." }, { "name": "ProvenanceDetected", "value": "ProvenanceDetected", "description": "At least one supported Microsoft-issued C2PA or imperceptible watermark signal was detected." } ] } }, "DetectProvenanceOptions": { "type": "object", "description": "Input describing the media to inspect using Content Provenance Detection.", "properties": { "content": { "$ref": "#/definitions/ProvenanceContent", "description": "Source content to inspect." } }, "required": [ "content" ] }, "DetectProvenanceResult": { "type": "object", "description": "Result of a Content Provenance Detection operation.", "properties": { "outcome": { "$ref": "#/definitions/DetectOutcome", "description": "Top-level outcome of the Content Provenance Detection operation." }, "results": { "type": "array", "description": "Detected provenance signals. Empty or omitted when `outcome` is `NoProvenanceDetected`.", "items": { "$ref": "#/definitions/DetectedProvenance" } } }, "required": [ "outcome" ] }, "DetectTextProtectedMaterialOptions": { "type": "object", "description": "The request of detecting potential protected material present in the given text.", "properties": { "text": { "type": "string", "description": "The text to be analyzed, which may contain protected material. The characters will be counted in Unicode code points." } }, "required": [ "text" ] }, "DetectTextProtectedMaterialResult": { "type": "object", "description": "The combined detection results of potential protected material.", "properties": { "protectedMaterialAnalysis": { "$ref": "#/definitions/TextProtectedMaterialAnalysisResult", "description": "Analysis result for the given text." } }, "required": [ "protectedMaterialAnalysis" ] }, "DetectedProvenance": { "type": "object", "description": "A Microsoft-issued provenance signal indicating the media was created or modified using AI.", "properties": { "type": { "$ref": "#/definitions/DetectedProvenanceType", "description": "Detected provenance record type." }, "provider": { "type": "string", "description": "Identifier of the Microsoft provider that generated the content." }, "modelName": { "type": "string", "description": "Identifier of the generating AI model when available." }, "timestamp": { "type": "string", "format": "date-time", "description": "Generation timestamp recorded in the provenance signal." } } }, "DetectedProvenanceType": { "type": "string", "description": "Detected provenance record type.", "enum": [ "C2PA", "Watermark" ], "x-ms-enum": { "name": "DetectedProvenanceType", "modelAsString": true, "values": [ { "name": "C2PA", "value": "C2PA", "description": "Provenance came from a C2PA Content Credential (manifest)." }, { "name": "Watermark", "value": "Watermark", "description": "Provenance came from an imperceptible watermark." } ] } }, "DocumentInjectionAnalysisResult": { "type": "object", "description": "The individual analysis result of potential injection attacks in the given documents.", "properties": { "attackDetected": { "type": "boolean", "description": "Whether a potential injection attack is detected or not." } }, "required": [ "attackDetected" ] }, "ImageCategoriesAnalysis": { "type": "object", "description": "Image analysis result.", "properties": { "category": { "$ref": "#/definitions/ImageCategory", "description": "The image analysis category." }, "severity": { "type": "integer", "format": "int32", "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6." } }, "required": [ "category" ] }, "ImageCategory": { "type": "string", "description": "The harm category supported in Image content analysis.", "enum": [ "Hate", "SelfHarm", "Sexual", "Violence" ], "x-ms-enum": { "name": "ImageCategory", "modelAsString": true, "values": [ { "name": "Hate", "value": "Hate", "description": "The harm category for Image - Hate." }, { "name": "SelfHarm", "value": "SelfHarm", "description": "The harm category for Image - SelfHarm." }, { "name": "Sexual", "value": "Sexual", "description": "The harm category for Image - Sexual." }, { "name": "Violence", "value": "Violence", "description": "The harm category for Image - Violence." } ] } }, "ImageData": { "type": "object", "description": "The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels.", "properties": { "content": { "type": "string", "format": "byte", "description": "The Base64 encoding of the image." }, "blobUrl": { "type": "string", "format": "uri", "description": "The blob url of the image." } } }, "PagedTextBlocklist": { "type": "object", "description": "Paged collection of TextBlocklist items", "properties": { "value": { "type": "array", "description": "The TextBlocklist items on this page", "items": { "$ref": "#/definitions/TextBlocklist" } }, "nextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "value" ] }, "PagedTextBlocklistItem": { "type": "object", "description": "Paged collection of TextBlocklistItem items", "properties": { "value": { "type": "array", "description": "The TextBlocklistItem items on this page", "items": { "$ref": "#/definitions/TextBlocklistItem" } }, "nextLink": { "type": "string", "format": "uri", "description": "The link to the next page of items" } }, "required": [ "value" ] }, "ProvenanceContent": { "type": "object", "description": "Source content descriptor for a Content Provenance Detection operation.", "properties": { "uri": { "type": "string", "format": "uri", "description": "Blob URI of the media to inspect. Media up to 100 MB is supported. Supported formats: image (JPEG, PNG, GIF, WebP), audio (MP3, WAV), and video (MP4)." } }, "required": [ "uri" ] }, "ProvenanceDetectOperation": { "type": "object", "description": "Status and result of an asynchronous Content Provenance Detection operation.", "properties": { "id": { "type": "string", "description": "The unique ID of the operation." }, "status": { "$ref": "#/definitions/Azure.Core.Foundations.OperationState", "description": "The status of the operation" }, "error": { "$ref": "#/definitions/Azure.Core.Foundations.Error", "description": "Error object that describes the error when status is \"Failed\"." }, "result": { "$ref": "#/definitions/DetectProvenanceResult", "description": "The result of the operation." }, "kind": { "$ref": "#/definitions/ProvenanceOperationKind", "description": "Kind of Content Provenance Detection operation.", "readOnly": true }, "createdAt": { "type": "string", "format": "date-time", "description": "Date and time (UTC) when the operation was created.", "readOnly": true }, "lastUpdatedAt": { "type": "string", "format": "date-time", "description": "Date and time (UTC) when the status was last updated.", "readOnly": true } }, "required": [ "id", "status", "kind" ] }, "ProvenanceOperationKind": { "type": "string", "description": "Kind of asynchronous Content Provenance Detection operation.", "enum": [ "Detect" ], "x-ms-enum": { "name": "ProvenanceOperationKind", "modelAsString": true, "values": [ { "name": "Detect", "value": "Detect", "description": "Content Provenance Detection operation." } ] } }, "RemoveTextBlocklistItemsOptions": { "type": "object", "description": "The request to remove blocklistItems from a text blocklist.", "properties": { "blocklistItemIds": { "type": "array", "description": "Array of blocklistItemIds to remove.", "items": { "type": "string" } } }, "required": [ "blocklistItemIds" ] }, "ShieldPromptOptions": { "type": "object", "description": "The request of analyzing potential direct or indirect injection attacks.", "properties": { "userPrompt": { "type": "string", "description": "The user prompt to be analyzed, which may contain direct injection attacks." }, "documents": { "type": "array", "description": "The documents to be analyzed, which may contain direct or indirect injection attacks.", "items": { "type": "string" } } } }, "ShieldPromptResult": { "type": "object", "description": "The combined analysis results of potential direct or indirect injection attacks.", "properties": { "userPromptAnalysis": { "$ref": "#/definitions/UserPromptInjectionAnalysisResult", "description": "Direct injection attacks analysis result for the given user prompt." }, "documentsAnalysis": { "type": "array", "description": "Direct and indirect injection attacks analysis result for the given documents.", "items": { "$ref": "#/definitions/DocumentInjectionAnalysisResult" } } } }, "TextBlocklist": { "type": "object", "description": "Text Blocklist.", "properties": { "blocklistName": { "type": "string", "description": "Text blocklist name.", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$", "x-ms-mutability": [ "read", "create" ] }, "description": { "type": "string", "description": "Text blocklist description.", "maxLength": 1024 } }, "required": [ "blocklistName" ] }, "TextBlocklistCreateOrUpdate": { "type": "object", "description": "Text Blocklist.", "properties": { "blocklistName": { "type": "string", "description": "Text blocklist name.", "maxLength": 64, "pattern": "^[0-9A-Za-z._~-]+$", "x-ms-mutability": [ "read", "create" ] }, "description": { "type": "string", "description": "Text blocklist description.", "maxLength": 1024 } } }, "TextBlocklistItem": { "type": "object", "description": "Item in a TextBlocklist.", "properties": { "blocklistItemId": { "type": "string", "description": "The service will generate a BlocklistItemId, which will be a UUID.", "maxLength": 64, "readOnly": true }, "description": { "type": "string", "description": "BlocklistItem description.", "maxLength": 1024 }, "text": { "type": "string", "description": "BlocklistItem content. The length is counted using Unicode code point.", "maxLength": 128 }, "isRegex": { "type": "boolean", "description": "An optional properties indicating whether this item is to be matched as a regular expression." } }, "required": [ "blocklistItemId", "text" ] }, "TextBlocklistMatch": { "type": "object", "description": "The result of blocklist match.", "properties": { "blocklistName": { "type": "string", "description": "The name of the matched blocklist.", "maxLength": 64 }, "blocklistItemId": { "type": "string", "description": "The ID of the matched item.", "maxLength": 64 }, "blocklistItemText": { "type": "string", "description": "The content of the matched item.", "maxLength": 128 } }, "required": [ "blocklistName", "blocklistItemId", "blocklistItemText" ] }, "TextCategoriesAnalysis": { "type": "object", "description": "Text analysis result.", "properties": { "category": { "$ref": "#/definitions/TextCategory", "description": "The text analysis category." }, "severity": { "type": "integer", "format": "int32", "description": "The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7." } }, "required": [ "category" ] }, "TextCategory": { "type": "string", "description": "The harm category supported in Text content analysis.", "enum": [ "Hate", "SelfHarm", "Sexual", "Violence" ], "x-ms-enum": { "name": "TextCategory", "modelAsString": true, "values": [ { "name": "Hate", "value": "Hate", "description": "The harm category for Text - Hate." }, { "name": "SelfHarm", "value": "SelfHarm", "description": "The harm category for Text - SelfHarm." }, { "name": "Sexual", "value": "Sexual", "description": "The harm category for Text - Sexual." }, { "name": "Violence", "value": "Violence", "description": "The harm category for Text - Violence." } ] } }, "TextProtectedMaterialAnalysisResult": { "type": "object", "description": "The individual detection result of potential protected material.", "properties": { "detected": { "type": "boolean", "description": "Whether potential protected material is detected or not." } }, "required": [ "detected" ] }, "UnifiedModerateContext": { "type": "object", "description": "Optional agent, session, and request context supplied to policy evaluation.", "properties": { "agentId": { "type": "string", "description": "Caller-provided identifier of the agent associated with the event." }, "sessionId": { "type": "string", "description": "Caller-provided identifier of the session associated with the event." }, "sequence": { "type": "integer", "format": "int64", "description": "Zero-based event sequence within the session, when available.", "minimum": 0 }, "correlationId": { "type": "string", "description": "Caller-provided end-to-end correlation identifier." }, "userId": { "type": "string", "description": "Caller-provided workload user identifier." }, "tenantId": { "type": "string", "description": "Caller-provided workload tenant identifier." }, "extensions": { "type": "string", "description": "A string containing a JSON-encoded object with validated host-specific context extensions." } } }, "UnifiedModerateOptions": { "type": "object", "description": "A request to evaluate and enforce an applicable policy for one workload event. The service uses the first policy it can resolve from policyId and then from the policy binding for targetResourceId, in that order. The request fails if neither selector resolves a policy.", "properties": { "policyId": { "type": "string", "description": "The identifier of a policy available to the Content Safety resource. When provided, the service attempts to resolve this policy before using the policy bound to targetResourceId." }, "targetResourceId": { "type": "string", "description": "The Azure resource identifier whose policy binding is resolved if no policy is resolved from policyId. The target resource must already have a policy binding available to the Content Safety resource." }, "source": { "$ref": "#/definitions/UnifiedModerateSource", "description": "The workload event source. The source selects the policy intervention point." }, "content": { "type": "string", "description": "The content to evaluate. For input and output sources, provide nonempty plain text. For pre_tool_call, provide a string containing a JSON-encoded object with the proposed tool arguments. For post_tool_call, provide a string containing the JSON-encoded tool result." }, "toolName": { "type": "string", "description": "The tool name. Required and nonempty for tool-call sources and not allowed for input or output sources.", "minLength": 1 }, "toolCallId": { "type": "string", "description": "An optional caller-provided tool-call identifier. The service generates one when omitted for a tool-call source." }, "toolArguments": { "type": "string", "description": "A string containing a JSON-encoded object with the original arguments for a completed tool call. This property applies only to post_tool_call. The service uses an empty object when omitted." }, "toolResultIsError": { "type": "boolean", "description": "Whether the completed tool call returned an error. This property applies only to post_tool_call." }, "toolDurationMs": { "type": "number", "format": "double", "description": "The non-negative duration of the completed tool call, in milliseconds. This property applies only to post_tool_call.", "minimum": 0 }, "context": { "$ref": "#/definitions/UnifiedModerateContext", "description": "Optional agent, session, and request context supplied to policy evaluation." } }, "required": [ "source", "content" ] }, "UnifiedModerateResult": { "type": "object", "description": "The enforced result of unified moderation.", "properties": { "verdict": { "$ref": "#/definitions/UnifiedModerateVerdict", "description": "The caller-facing enforcement outcome." }, "reason": { "type": "string", "description": "An optional machine-readable policy reason." }, "content": { "type": "string", "description": "The original or transformed content when allowed, using the same source-specific representation as the request content. Structured content is returned as a string containing the JSON-encoded value. This property is omitted when blocked." }, "acsVerdict": { "$ref": "#/definitions/AcsVerdict", "description": "The complete Agent Control Specification policy verdict." } }, "required": [ "verdict", "acsVerdict" ] }, "UnifiedModerateSource": { "type": "string", "description": "The workload event source evaluated by Unified Moderate.", "enum": [ "input", "output", "pre_tool_call", "post_tool_call" ], "x-ms-enum": { "name": "UnifiedModerateSource", "modelAsString": true, "values": [ { "name": "Input", "value": "input", "description": "Input submitted to a model or agent. The content field must contain nonempty plain text. Tool fields do not apply." }, { "name": "Output", "value": "output", "description": "Output produced by a model or agent. The content field must contain nonempty plain text. Tool fields do not apply." }, { "name": "PreToolCall", "value": "pre_tool_call", "description": "A proposed tool invocation before it is executed. The content field must be a string containing a JSON-encoded object with the proposed tool arguments. toolName is required; toolCallId is optional; post-call fields do not apply." }, { "name": "PostToolCall", "value": "post_tool_call", "description": "A tool result after the invocation completes. The content field must be a string containing the JSON-encoded tool result. toolName is required; toolCallId, toolArguments, toolResultIsError, and toolDurationMs are optional." } ] } }, "UnifiedModerateVerdict": { "type": "string", "description": "The caller-facing enforcement result returned by Unified Moderate.", "enum": [ "allowed", "blocked" ], "x-ms-enum": { "name": "UnifiedModerateVerdict", "modelAsString": true, "values": [ { "name": "Allowed", "value": "allowed", "description": "The content is allowed, including content modified by an allowed policy transform." }, { "name": "Blocked", "value": "blocked", "description": "The content is blocked by policy." } ] } }, "UserPromptInjectionAnalysisResult": { "type": "object", "description": "The individual analysis result of potential injection attacks in the given user prompt.", "properties": { "attackDetected": { "type": "boolean", "description": "Whether a potential injection attack is detected or not." } }, "required": [ "attackDetected" ] } }, "parameters": { "Azure.Core.Foundations.ApiVersionParameter": { "name": "api-version", "in": "query", "description": "The API version to use for this operation.", "required": true, "type": "string", "minLength": 1, "x-ms-parameter-location": "method", "x-ms-client-name": "apiVersion" }, "Azure.Core.MaxPageSizeQueryParameter": { "name": "maxpagesize", "in": "query", "description": "The maximum number of result items per page.", "required": false, "type": "integer", "format": "int32", "x-ms-parameter-location": "method" }, "Azure.Core.SkipQueryParameter": { "name": "skip", "in": "query", "description": "The number of result items to skip.", "required": false, "type": "integer", "format": "int32", "default": 0, "x-ms-parameter-location": "method" }, "Azure.Core.TopQueryParameter": { "name": "top", "in": "query", "description": "The number of result items to return.", "required": false, "type": "integer", "format": "int32", "x-ms-parameter-location": "method" } } }