Create Risk Category
(v2)POST
Adds a risk category to a red teaming framework and returns its id. Send vulnerabilityTypeIds and attackMethodIds to fill it in the same call: a category with neither probes for nothing when the framework runs.
curl -X POST "https://api.confident-ai.com/v2/rt-frameworks/{rtFrameworkId}/risk-categories" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "Data protection",
"description": "Risks around leaking data the model was given.",
"vulnerabilityTypeIds": [
"<VULNERABILITY-TYPE-ID>"
],
"attackMethodIds": [
"<ATTACK-METHOD-ID>"
],
"vulnerabilityIdToPriorityLevel": {
"<VULNERABILITY-ID>": 2
}
}'{
"success": true,
"data": {
"id": "<RISK-CATEGORY-ID>"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/frameworks/<RT-FRAMEWORK-ID>",
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
rtFrameworkIdstringRequiredThe id of the red teaming framework.
Request body
namestringRequiredThe name of the risk category, unique within the framework.
descriptionstring | nullWhat this risk category covers. Send
nullto clear it.vulnerabilityTypeIdslist of stringsThe ids of the vulnerability types to probe for. The list replaces the category's current selection.
attackMethodIdslist of stringsThe ids of the attack methods to probe with. The list replaces the category's current selection.
vulnerabilityIdToPriorityLevelobject | null
Response
Create Risk Category succeeded.
successbooleanIndicates if the request was successful.
dataobjectA reference to a risk category by its id.
Show 1 propertyHide 1 property
idstringThe id of the risk category, generated by Confident AI.
linkstringThis is the URL of the resource on the Confident AI platform.
deprecatedbooleanIndicates if this endpoint is deprecated.