diff --git a/specification/ai/Azure.AI.Projects/main.tsp b/specification/ai/Azure.AI.Projects/main.tsp index 2b951f51876c..b3072f6bbd5e 100644 --- a/specification/ai/Azure.AI.Projects/main.tsp +++ b/specification/ai/Azure.AI.Projects/main.tsp @@ -19,6 +19,7 @@ import "./datasets/routes.tsp"; import "./indexes/routes.tsp"; import "./deployments/routes.tsp"; import "./evaluation-results/routes.tsp"; +import "./red-teams/routes.tsp"; using TypeSpec.Http; using TypeSpec.Versioning; diff --git a/specification/ai/Azure.AI.Projects/red-teams/client.tsp b/specification/ai/Azure.AI.Projects/red-teams/client.tsp new file mode 100644 index 000000000000..3ab2f4305518 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/red-teams/client.tsp @@ -0,0 +1,3 @@ +import "@azure-tools/typespec-client-generator-core"; + +using Azure.ClientGenerator.Core; diff --git a/specification/ai/Azure.AI.Projects/red-teams/models.tsp b/specification/ai/Azure.AI.Projects/red-teams/models.tsp new file mode 100644 index 000000000000..262ed4cc3b89 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/red-teams/models.tsp @@ -0,0 +1,115 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@azure-tools/typespec-autorest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "@typespec/openapi"; +import "../common/models.tsp"; + +using TypeSpec.OpenAPI; +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; + +namespace Azure.AI.Projects; + +@doc("Strategies for attacks.") +union AttackStrategy { + string, + + @doc("Represents a default set of easy complexity attacks. Easy complexity attack strategies are defined as attacks that do not require any Large Language Model to convert or orchestrate.") + Easy: "easy", + + @doc("Represents ASCII art, a graphic design technique that uses printable characters.") + AsciiArt: "ascii_art", + + @doc("Represents ASCII smuggling, a technique for encoding or hiding data.") + AsciiSmuggler: "ascii_smuggler", + + @doc("Represents the Atbash cipher, a substitution cipher that reverses the alphabet.") + Atbash: "atbash", + + @doc("Represents Base64 encoding, a method for encoding binary data as text.") + Base64: "base64", + + @doc("Represents binary encoding, a representation of data in binary format.") + Binary: "binary", + + @doc("Represents the Caesar cipher, a substitution cipher that shifts characters.") + Caesar: "caesar", + + @doc("Represents character space manipulation, a technique involving spacing between characters.") + CharacterSpace: "character_space", + + @doc("Represents character swapping, a technique for rearranging characters in text.") + Jailbreak: "jailbreak", +} + +@doc("Risk category for the attack objective.") +union RiskCategory { + string, + @doc("Represents content related to hate or unfairness.") + HateUnfairness: "HateUnfairness", + + @doc("Represents content related to violence.") + Violence: "Violence", + + @doc("Represents content of a sexual nature.") + Sexual: "Sexual", + + @doc("Represents content related to self-harm.") + SelfHarm: "SelfHarm", + + @doc("Represents content involving protected material.") + ProtectedMaterial: "ProtectedMaterial", + + @doc("Represents content related to code vulnerabilities.") + CodeVulnerability: "CodeVulnerability", + + @doc("Represents content with ungrounded attributes.") + UngroundedAttributes: "UngroundedAttributes" +} + + +@doc("Red team details.") +@resource("runs") +model RedTeam { + @doc("Identifier of the red team.") + @key("name") + @visibility(Lifecycle.Read) + id: string; + + @doc("Name of the red-team scan.") + scanName: string; + + @doc("Number of simulation rounds.") + numTurns: int32; + + @doc("List of attack strategies or nested lists of attack strategies.") + attackStrategy: AttackStrategy[]; + + @doc("Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result.") + simulationOnly: boolean; + + @doc("Read-only result outputs. Example: { 'redTeamResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/{dataset-version}' }") + @visibility(Lifecycle.Read) + outputs: Record; + + @doc("List of risk categories to generate attack objectives for.") + riskCategories: RiskCategory[]; + + @doc("Application scenario for the red team operation, to generate scenario specific attacks.") + applicationScenario?: string; + + @doc("Red team's tags. Unlike properties, tags are fully mutable.") + tags?: Record; + + @doc("Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.") + properties?: Record; + + @doc("Status of the red-team. It is set by service and is read-only.") + @visibility(Lifecycle.Read) + status?: string; +} diff --git a/specification/ai/Azure.AI.Projects/red-teams/routes.tsp b/specification/ai/Azure.AI.Projects/red-teams/routes.tsp new file mode 100644 index 000000000000..54a0834bc748 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/red-teams/routes.tsp @@ -0,0 +1,45 @@ +import "@typespec/rest"; +import "@azure-tools/typespec-autorest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-azure-core"; +import "./models.tsp"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.Core.Traits; +using Azure.Core.Foundations; + +namespace Azure.AI.Projects; + +alias RedTeamServiceTraits = SupportsClientRequestId & + NoRepeatableRequests & + NoConditionalRequests; // NoRetryRequests supresses @azure-tools/typespec-azure-core/conditional-requests-trait-missing + +alias RedTeamOperations = Azure.Core.ResourceOperations; + +@route("red-teams") +interface RedTeams { + @doc("Get a redteam by name.") + get is RedTeamOperations.ResourceRead; + + @doc("List a redteam by name.") + list is RedTeamOperations.ResourceList< + RedTeam, + ListQueryParametersTrait + >; + + #suppress "@azure-tools/typespec-azure-core/use-standard-operations" + @doc("Creates a redteam run.") + @route("runs:run") + @post + createRun is Azure.Core.Foundations.Operation< + { + @doc("Redteam to be run") + @body + RedTeam: RedTeam; + }, + RedTeam + >; +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index e30fccd15274..16c17db149ee 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -1106,6 +1106,473 @@ } } }, + "/evaluationResult": { + "get": { + "operationId": "EvaluationResults_ListLatest", + "description": "List the latest version of each EvaluationResult", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "top", + "in": "query", + "description": "Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "skip", + "in": "query", + "description": "Continuation token for pagination.", + "required": false, + "type": "string" + }, + { + "name": "tags", + "in": "query", + "description": "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2", + "required": false, + "type": "string" + }, + { + "name": "listViewType", + "in": "query", + "description": "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.", + "required": false, + "type": "string", + "enum": [ + "ActiveOnly", + "ArchivedOnly", + "All" + ], + "x-ms-enum": { + "name": "ListViewType", + "modelAsString": true, + "values": [ + { + "name": "ActiveOnly", + "value": "ActiveOnly", + "description": "List only active items." + }, + { + "name": "ArchivedOnly", + "value": "ArchivedOnly", + "description": "List only archived items." + }, + { + "name": "All", + "value": "All", + "description": "List all items." + } + ] + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedEvaluationResult" + } + }, + "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-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/evaluationResult/{name}/versions": { + "get": { + "operationId": "EvaluationResults_ListVersions", + "description": "List all versions of the given EvaluationResult", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "top", + "in": "query", + "description": "Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "skip", + "in": "query", + "description": "Continuation token for pagination.", + "required": false, + "type": "string" + }, + { + "name": "tags", + "in": "query", + "description": "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2", + "required": false, + "type": "string" + }, + { + "name": "listViewType", + "in": "query", + "description": "[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.", + "required": false, + "type": "string", + "enum": [ + "ActiveOnly", + "ArchivedOnly", + "All" + ], + "x-ms-enum": { + "name": "ListViewType", + "modelAsString": true, + "values": [ + { + "name": "ActiveOnly", + "value": "ActiveOnly", + "description": "List only active items." + }, + { + "name": "ArchivedOnly", + "value": "ArchivedOnly", + "description": "List only archived items." + }, + { + "name": "All", + "value": "All", + "description": "List all items." + } + ] + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedEvaluationResult" + } + }, + "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-pageable": { + "nextLinkName": "nextLink" + } + }, + "post": { + "operationId": "EvaluationResults_Create", + "description": "Create a new EvaluationResult. The version id will be generated by the service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "body", + "in": "body", + "description": "The definition of the EvaluationResult to create", + "required": true, + "schema": { + "$ref": "#/definitions/EvaluationResult" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/EvaluationResult" + }, + "headers": { + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "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." + } + } + } + } + } + }, + "/evaluationResult/{name}/versions/{version}": { + "get": { + "operationId": "EvaluationResults_GetVersion", + "description": "Get the specific version of the EvaluationResult", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the EvaluationResult to retrieve.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/EvaluationResult" + } + }, + "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." + } + } + } + } + }, + "put": { + "operationId": "EvaluationResults_CreateVersion", + "description": "Create a new or replace an existing EvaluationResult with the given version id", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the EvaluationResult to create or replace.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "The definition of the EvaluationResult to create", + "required": true, + "schema": { + "$ref": "#/definitions/EvaluationResult" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/EvaluationResult" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/EvaluationResult" + } + }, + "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." + } + } + } + } + }, + "delete": { + "operationId": "EvaluationResults_DeleteVersion", + "description": "Delete the specific version of the EvaluationResult", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The version of the EvaluationResult to delete.", + "required": true, + "type": "string" + } + ], + "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." + } + } + } + } + } + }, + "/evaluationResult/{name}/versions/{version}/startPendingUpload": { + "post": { + "operationId": "EvaluationResults_StartPendingUpload", + "description": "Create or start a pending upload of a evaluation results for a specific version.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the EvaluationResult to operate on.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Parameters for the action", + "required": true, + "schema": { + "$ref": "#/definitions/PendingUploadRequest" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PendingUploadResponse" + } + }, + "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." + } + } + } + } + } + }, "/evaluations/runs": { "get": { "operationId": "Evaluations_List", @@ -1907,7 +2374,148 @@ "201": { "description": "The request has succeeded and a new resource has been created as a result.", "schema": { - "$ref": "#/definitions/Index" + "$ref": "#/definitions/Index" + } + }, + "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." + } + } + } + } + }, + "delete": { + "operationId": "Indexes_DeleteVersion", + "description": "Delete the specific version of the Index", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The version of the Index to delete.", + "required": true, + "type": "string" + } + ], + "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." + } + } + } + } + } + }, + "/red-teams/runs": { + "get": { + "operationId": "RedTeams_List", + "description": "List a redteam by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedRedTeam" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "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-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/red-teams/runs/{name}": { + "get": { + "operationId": "RedTeams_Get", + "description": "Get a redteam by name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "Identifier of the red team.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RedTeam" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } } }, "default": { @@ -1923,32 +2531,32 @@ } } } - }, - "delete": { - "operationId": "Indexes_DeleteVersion", - "description": "Delete the specific version of the Index", + } + }, + "/red-teams/runs:run": { + "post": { + "operationId": "RedTeams_CreateRun", + "description": "Creates a redteam run.", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { - "name": "name", - "in": "path", - "description": "The name of the resource", - "required": true, - "type": "string" - }, - { - "name": "version", - "in": "path", - "description": "The version of the Index to delete.", + "name": "RedTeam", + "in": "body", + "description": "Redteam to be run", "required": true, - "type": "string" + "schema": { + "$ref": "#/definitions/RedTeam" + } } ], "responses": { - "204": { - "description": "There is no content to send for this request, but the headers may be useful." + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/RedTeam" + } }, "default": { "description": "An unexpected error response.", @@ -9700,6 +10308,72 @@ } }, "AssistantsApiResponseFormatOption": {}, + "AttackStrategy": { + "type": "string", + "description": "Strategies for attacks.", + "enum": [ + "easy", + "ascii_art", + "ascii_smuggler", + "atbash", + "base64", + "binary", + "caesar", + "character_space", + "jailbreak" + ], + "x-ms-enum": { + "name": "AttackStrategy", + "modelAsString": true, + "values": [ + { + "name": "Easy", + "value": "easy", + "description": "Represents a default set of easy complexity attacks. Easy complexity attack strategies are defined as attacks that do not require any Large Language Model to convert or orchestrate." + }, + { + "name": "AsciiArt", + "value": "ascii_art", + "description": "Represents ASCII art, a graphic design technique that uses printable characters." + }, + { + "name": "AsciiSmuggler", + "value": "ascii_smuggler", + "description": "Represents ASCII smuggling, a technique for encoding or hiding data." + }, + { + "name": "Atbash", + "value": "atbash", + "description": "Represents the Atbash cipher, a substitution cipher that reverses the alphabet." + }, + { + "name": "Base64", + "value": "base64", + "description": "Represents Base64 encoding, a method for encoding binary data as text." + }, + { + "name": "Binary", + "value": "binary", + "description": "Represents binary encoding, a representation of data in binary format." + }, + { + "name": "Caesar", + "value": "caesar", + "description": "Represents the Caesar cipher, a substitution cipher that shifts characters." + }, + { + "name": "CharacterSpace", + "value": "character_space", + "description": "Represents character space manipulation, a technique involving spacing between characters." + }, + { + "name": "Jailbreak", + "value": "jailbreak", + "description": "Represents character swapping, a technique for rearranging characters in text." + } + ] + } + }, "AuthenticationType": { "type": "string", "description": "The authentication type used by the connection", @@ -10231,12 +10905,102 @@ "additionalProperties": { "$ref": "#/definitions/EvaluatorConfiguration" } + }, + "outputs": { + "type": "object", + "description": "Read-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/{dataset-version}' }", + "additionalProperties": { + "type": "string" + }, + "readOnly": true } }, "required": [ "id", "data", - "evaluators" + "evaluators", + "outputs" + ] + }, + "EvaluationResult": { + "type": "object", + "description": "Evaluation Result resource Definition", + "properties": { + "ResultType": { + "$ref": "#/definitions/ResultType", + "description": "Type of Evaluation result" + }, + "ModelName": { + "type": "string", + "description": "Model Name" + }, + "ModelVersion": { + "type": "string", + "description": "Model Version" + }, + "ModelAssetId": { + "type": "string", + "description": "Model Asset ID" + }, + "DatasetFamily": { + "type": "string", + "description": "Dataset Family" + }, + "DatasetName": { + "type": "string", + "description": "Dataset Name" + }, + "Metrics": { + "type": "object", + "description": "Metrics", + "additionalProperties": { + "format": "double", + "type": "number" + } + }, + "BlobUri": { + "type": "string", + "description": "Blob URI" + }, + "stage": { + "type": "string", + "description": "Asset stage", + "x-ms-mutability": [ + "read", + "update", + "create" + ] + }, + "id": { + "type": "string", + "description": "A unique identifier for the asset, assetId probably?", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The name of the resource", + "readOnly": true + }, + "version": { + "type": "string", + "description": "The version of the resource", + "readOnly": true + }, + "description": { + "type": "string", + "description": "The asset description text." + }, + "tags": { + "type": "object", + "description": "Tag dictionary. Tags can be added, removed, and updated.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "name", + "version" ] }, "EvaluatorConfiguration": { @@ -10712,6 +11476,27 @@ "value" ] }, + "PagedEvaluationResult": { + "type": "object", + "description": "Paged collection of EvaluationResult items", + "properties": { + "value": { + "type": "array", + "description": "The EvaluationResult items on this page", + "items": { + "$ref": "#/definitions/EvaluationResult" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, "PagedIndex": { "type": "object", "description": "Paged collection of Index items", @@ -10733,6 +11518,27 @@ "value" ] }, + "PagedRedTeam": { + "type": "object", + "description": "Paged collection of RedTeam items", + "properties": { + "value": { + "type": "array", + "description": "The RedTeam items on this page", + "items": { + "$ref": "#/definitions/RedTeam" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, "PendingUploadCredentialType": { "type": "string", "description": "The type of credential used to access the storage account.", @@ -10835,6 +11641,84 @@ ] } }, + "RedTeam": { + "type": "object", + "description": "Red team details.", + "properties": { + "id": { + "type": "string", + "description": "Identifier of the red team.", + "readOnly": true + }, + "scanName": { + "type": "string", + "description": "Name of the red-team scan." + }, + "numTurns": { + "type": "integer", + "format": "int32", + "description": "Number of simulation rounds." + }, + "attackStrategy": { + "type": "array", + "description": "List of attack strategies or nested lists of attack strategies.", + "items": { + "$ref": "#/definitions/AttackStrategy" + } + }, + "simulationOnly": { + "type": "boolean", + "description": "Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result." + }, + "outputs": { + "type": "object", + "description": "Read-only result outputs. Example: { 'redTeamResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/{dataset-version}' }", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "riskCategories": { + "type": "array", + "description": "List of risk categories to generate attack objectives for.", + "items": { + "$ref": "#/definitions/RiskCategory" + } + }, + "applicationScenario": { + "type": "string", + "description": "Application scenario for the red team operation, to generate scenario specific attacks." + }, + "tags": { + "type": "object", + "description": "Red team's tags. Unlike properties, tags are fully mutable.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "type": "object", + "description": "Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", + "additionalProperties": { + "type": "string" + } + }, + "status": { + "type": "string", + "description": "Status of the red-team. It is set by service and is read-only.", + "readOnly": true + } + }, + "required": [ + "id", + "scanName", + "numTurns", + "attackStrategy", + "simulationOnly", + "outputs", + "riskCategories" + ] + }, "ReferenceType": { "type": "string", "description": "Enum to determine which reference method to use for an asset.", @@ -10865,6 +11749,96 @@ ] } }, + "ResultType": { + "type": "string", + "description": "Type of Evaluation result", + "enum": [ + "Benchmark", + "Evaluation", + "Redteam", + "Simulation" + ], + "x-ms-enum": { + "name": "ResultType", + "modelAsString": true, + "values": [ + { + "name": "Benchmark", + "value": "Benchmark", + "description": "Benchmark result" + }, + { + "name": "Evaluation", + "value": "Evaluation", + "description": "Evaluations Result" + }, + { + "name": "Redteam", + "value": "Redteam", + "description": "Red Team Result" + }, + { + "name": "Simulation", + "value": "Simulation", + "description": "Simulation Result" + } + ] + } + }, + "RiskCategory": { + "type": "string", + "description": "Risk category for the attack objective.", + "enum": [ + "HateUnfairness", + "Violence", + "Sexual", + "SelfHarm", + "ProtectedMaterial", + "CodeVulnerability", + "UngroundedAttributes" + ], + "x-ms-enum": { + "name": "RiskCategory", + "modelAsString": true, + "values": [ + { + "name": "HateUnfairness", + "value": "HateUnfairness", + "description": "Represents content related to hate or unfairness." + }, + { + "name": "Violence", + "value": "Violence", + "description": "Represents content related to violence." + }, + { + "name": "Sexual", + "value": "Sexual", + "description": "Represents content of a sexual nature." + }, + { + "name": "SelfHarm", + "value": "SelfHarm", + "description": "Represents content related to self-harm." + }, + { + "name": "ProtectedMaterial", + "value": "ProtectedMaterial", + "description": "Represents content involving protected material." + }, + { + "name": "CodeVulnerability", + "value": "CodeVulnerability", + "description": "Represents content related to code vulnerabilities." + }, + { + "name": "UngroundedAttributes", + "value": "UngroundedAttributes", + "description": "Represents content with ungrounded attributes." + } + ] + } + }, "SasCredential": { "type": "object", "description": "SAS Credential definition",