Skip to main content

red_teams

Creates, updates, deletes, gets or lists a red_teams resource.

Overview

Namered_teams
TypeResource
Idazure.ai_evaluation.red_teams

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringIdentifier of the red team. Required.
applicationScenariostringApplication scenario for the red team operation, to generate scenario specific attacks.
attackStrategiesarrayList of attack strategies or nested lists of attack strategies. Required.
displayNamestringDisplay name of the red-team scan.
numTurnsintegerNumber of simulation rounds. Required.
outputsobjectRead-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/versions/{dataset-version}' }. Required.
propertiesobjectRed team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
riskCategoriesarrayList of risk categories to generate attack objectives for. Required.
simulationOnlybooleanSimulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result. Required.
statusstringStatus of the red-team. It is set by service and is read-only.
systemDataobjectMetadata containing createdBy and modifiedBy information.
tagsobjectRed team's tags. Unlike properties, tags are fully mutable.
targetobjectTarget configuration for the red-team run. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, endpointGet a redteam by name.
get_jail_break_dataset_with_typeselecttype_name, endpointGet the jailbreak dataset with type.
get_attack_objectivesselectriskCategory, endpointlang, strategy, targetTypeGet the attack objectives.
get_template_parameters_imageselectpath, endpointGet the template parameters image.
listselectendpointtop, skip, maxpagesizeList a redteam by name.
get_jail_break_datasetexecendpointGet the jailbreak dataset.
get_template_parameters_with_typeexectype_name, endpointGet template parameters with type.
get_template_parametersexecendpointGet template parameters.
create_runexecendpoint, id, numTurns, attackStrategies, simulationOnly, riskCategories, targetCreates a redteam run.
upload_runexecendpoint, idUpload the result to a redteam run.
upload_update_runexecname, endpoint, idUpdate the uploaded the result to an redteam run.
submit_simulationexecendpointSubmit a request for simulation.
operation_resultsexecoperation_id, endpointPoll for the operation results.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
namestringName of the redteam run to update. Required.
operation_idstringOperation ID for the polling operation. Required.
pathstringImage path. Required.
riskCategorystringRisk category for the attack objectives. Required.
type_namestringType for the template parameters. Required.
langstringThe language for the attack objectives dataset, defaults to 'en'. Default value is None.
maxpagesizeinteger
skipintegerThe number of result items to skip. Default value is None.
strategystringThe strategy. Default value is None.
targetTypestringThe target, model/agent. Default value is None.
topintegerThe number of result items to return. Default value is None.

SELECT examples

Get a redteam by name.

SELECT
id,
applicationScenario,
attackStrategies,
displayName,
numTurns,
outputs,
properties,
riskCategories,
simulationOnly,
status,
systemData,
tags,
target
FROM azure.ai_evaluation.red_teams
WHERE name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

Lifecycle Methods

Get the jailbreak dataset.

EXEC azure.ai_evaluation.red_teams.get_jail_break_dataset 
@endpoint='{{ endpoint }}' --required
;