Launch Week 02 wrapped — explore all five launches

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.

POST/v1/risk-assessments/frameworks/{frameworkId}/run
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"
}'
200
{
  "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_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • frameworkIdstringRequired

    The unique identifier of the framework to run.

Request body

  • riskCategorieslist of stringsRequired

    The names of the risk categories to assess, exactly as returned by the list frameworks endpoint.

  • exposureenumRequired

    The exposure level of the application under test.

    Show 3 enum valuesHide 3 enum values
    • LOW
    • MEDIUM
    • HIGH
  • identifierstring

    An optional label for the run.

  • aiConnectionIdstring

    The ID of the AI connection to target, you can find this in the Project Settings → AI Connections on the platform. Required for AI_CONNECTION mode.

  • promptAliasstring

    The alias of the prompt to target. Required for PROMPT mode.

  • promptCommitstring

    The prompt commit hash to target. Defaults to the latest commit on the prompt's main branch.

  • generationModeenum

    The target type. Optional when exactly one of aiConnectionId or promptAlias is provided.

    Show 2 enum valuesHide 2 enum values
    • AI_CONNECTION
    • PROMPT
  • attackEngineobject

    Optional attack generation settings.

    Show 1 propertyHide 1 property
    • generationGuidelineslist of strings

      Freeform 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

  • successboolean

    Indicates if the risk assessment run was started.

  • dataobject

    Show 1 propertyHide 1 property
    • idstring

      The unique identifier of the created risk assessment.

  • linkstring

    A link to view the risk assessment.

Built byConfident AI