Skip to main content
POST
Run Redteam

Authorizations

apikey
string
header
required

Headers

X-Enkrypt-Policy
string

Name of a saved Code of Conduct policy to test against. The gateway resolves it, renders its rules into context.policy_description (v1 free text, or the v2 Policy Wizard enabled rules joined in their stored order) and records the name on the run as policy_name. This OVERRIDES any context.policy_description sent in the body, so a run is never labelled with one policy but generated from another's text - omit the header to keep your own wording.

Example:

"customer-support-coc"

Body

application/json

POST /v1/redteam payload.

Per payload.md: model + (risk_categories | compliance_frameworks) + context

  • generation_config. attack_config lives nested under each risk_category. Optional sub_categories phrases (from /threat-modeling/categories) may also nest under each risk_category to scope on-the-fly generation.
target
ModelConfig · object
required
risk_categories
Risk Categories · object | null
compliance_frameworks
enum<string>[] | null
Available options:
owasp_llm_top10,
eu_ai_act,
nist_ai_rmf,
mitre_atlas,
iso_42001,
aiuc_1
context
Context · object | null
generation_config
GenerationConfig · object | null

generation_config block per payload.md.

Two mutually-exclusive modes:

  • Pre-built dataset: dataset_name
  • On-the-fly generation: max_prompts and/or seed_prompts

Plus an orthogonal include_standard_library toggle (default true).

run_name
string | null
Required string length: 1 - 200
comprehensiveness
enum<string> | null

How exhaustively to test. Standard runs the normal attack budget and Comprehensive widens it; Low, Medium and High are the equivalent sample-size settings surfaced in the dashboard. Omit to use the service default.

Available options:
Low,
Medium,
High,
Standard,
Comprehensive
Example:

"Standard"

user_metadata
User Metadata · object | null

Response

Successful Response

The accepted run. run_id is the value to carry into the run endpoints (GET /rt/runs/{run_id}, /records, /results, /stream).

Do not follow the *_url fields verbatim. They are relative and are not guaranteed to carry the /rt/ prefix this API is published under, so requesting one as given can return 400. Build the URL from run_id and the paths documented here instead - /rt/runs/{run_id}/records is the resource you want. The same applies to records_url on the results payload.

websocket_url is the Server-Sent Events progress stream (/rt/runs/{run_id}/stream) despite its name. The live log socket is logs_url - a relative path to join onto wss://api.enkryptai.com/wss/redteam/v1/logs/tasks/. See the Stream Run Logs (WebSocket) endpoint.