Run Risk Assessment
POSThttps://api.confident-ai.com/v1/risk-assessments/frameworks/{frameworkId}/run
Starts a risk assessment run asynchronously against a framework's risk categories, then returns a link to the assessment.
Target your application with either an AI connection (by name) or a prompt (by alias and commit). Provide exactly one, or set generationMode to disambiguate. Requires an Enterprise plan.
curl -X POST "https://api.confident-ai.com/v1/risk-assessments/frameworks/{frameworkId}/run" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"identifier": "Weekly production scan",
"riskCategories": [
"Prompt Injection",
"PII Leakage"
],
"exposure": "MEDIUM",
"aiConnectionId": "AI-CONNECTION-ID"
}'{
"success": true,
"data": {
"id": "RISK-ASSESSMENT-ID"
},
"link": "https://app.confident-ai.com/project/<PROJECT-ID>/risk-profile/assessments/<RISK-ASSESSMENT-ID>"
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
frameworkIdstringRequiredThe unique identifier of the framework to run.
Request body
riskCategorieslist of stringsRequiredThe names of the risk categories to assess, exactly as returned by the list frameworks endpoint.
exposureenumRequiredThe exposure level of the application under test.
Show 3 enum valuesHide 3 enum values
LOWMEDIUMHIGH
identifierstringAn optional label for the run.
aiConnectionIdstringThe ID of the AI connection to target, you can find this in the Project Settings → AI Connections on the platform. Required for
AI_CONNECTIONmode.promptAliasstringThe alias of the prompt to target. Required for
PROMPTmode.promptCommitstringThe prompt commit hash to target. Defaults to the latest commit on the prompt's main branch.
generationModeenumThe target type. Optional when exactly one of
aiConnectionIdorpromptAliasis provided.Show 2 enum valuesHide 2 enum values
AI_CONNECTIONPROMPT
attackEngineobjectOptional attack generation settings.
Show 1 propertyHide 1 property
generationGuidelineslist of stringsFreeform guidelines that are used to guide the simulator model when generating attacks, give clear instructions to generate attacks that are more customized for your use case.
Response
successbooleanIndicates if the risk assessment run was started.
dataobjectShow 1 propertyHide 1 property
idstringThe unique identifier of the created risk assessment.
linkstringA link to view the risk assessment.