curl --request POST \
--url https://api.enkryptai.com/rt/model/redteam \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Model: <x-enkrypt-model>' \
--header 'X-Enkrypt-Model-Version: <x-enkrypt-model-version>' \
--header 'apikey: <api-key>' \
--data '
{
"risk_categories": {},
"compliance_frameworks": [],
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": [
"<string>"
]
}
]
},
"generation_config": {
"dataset_name": "<string>",
"max_prompts": 250,
"seed_prompts": [
{
"prompt": "<string>"
}
],
"include_standard_library": true
},
"run_name": "<string>",
"comprehensiveness": "Standard",
"user_metadata": {}
}
'import requests
url = "https://api.enkryptai.com/rt/model/redteam"
payload = {
"risk_categories": {},
"compliance_frameworks": [],
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": ["<string>"]
}
]
},
"generation_config": {
"dataset_name": "<string>",
"max_prompts": 250,
"seed_prompts": [{ "prompt": "<string>" }],
"include_standard_library": True
},
"run_name": "<string>",
"comprehensiveness": "Standard",
"user_metadata": {}
}
headers = {
"X-Enkrypt-Model": "<x-enkrypt-model>",
"X-Enkrypt-Model-Version": "<x-enkrypt-model-version>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Model': '<x-enkrypt-model>',
'X-Enkrypt-Model-Version': '<x-enkrypt-model-version>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
risk_categories: {},
compliance_frameworks: [],
context: {
system_description: '<string>',
policy_description: '<string>',
policy_rules: [
{
id: '<string>',
text: '<string>',
risk_category: '<string>',
severity: '<string>',
frameworks: ['<string>']
}
]
},
generation_config: {
dataset_name: '<string>',
max_prompts: 250,
seed_prompts: [{prompt: '<string>'}],
include_standard_library: true
},
run_name: '<string>',
comprehensiveness: 'Standard',
user_metadata: {}
})
};
fetch('https://api.enkryptai.com/rt/model/redteam', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/rt/model/redteam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'risk_categories' => [
],
'compliance_frameworks' => [
],
'context' => [
'system_description' => '<string>',
'policy_description' => '<string>',
'policy_rules' => [
[
'id' => '<string>',
'text' => '<string>',
'risk_category' => '<string>',
'severity' => '<string>',
'frameworks' => [
'<string>'
]
]
]
],
'generation_config' => [
'dataset_name' => '<string>',
'max_prompts' => 250,
'seed_prompts' => [
[
'prompt' => '<string>'
]
],
'include_standard_library' => true
],
'run_name' => '<string>',
'comprehensiveness' => 'Standard',
'user_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Model: <x-enkrypt-model>",
"X-Enkrypt-Model-Version: <x-enkrypt-model-version>",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/rt/model/redteam"
payload := strings.NewReader("{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Model", "<x-enkrypt-model>")
req.Header.Add("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/rt/model/redteam")
.header("X-Enkrypt-Model", "<x-enkrypt-model>")
.header("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/rt/model/redteam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Model"] = '<x-enkrypt-model>'
request["X-Enkrypt-Model-Version"] = '<x-enkrypt-model-version>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Run Redteam with saved model
Identical to POST /rt/redteam, except the system under test is a saved model named in the X-Enkrypt-Model / X-Enkrypt-Model-Version headers instead of an inline target. The gateway resolves the model and fills in target before the request reaches the Red Team service.
Saved models that reach their provider through a custom cURL command, custom headers/payload/response format, JWT auth, provider-specific auth_data or metadata, or an outbound proxy have no equivalent in the target shape and return 400. Use an inline target on POST /rt/redteam for those, or the Archived Red Team API.
Relay routing is the one exception to that metadata rule: a model saved with model_config.connect_via_relay: true and a model_config.metadata.relay block is projected onto target.connect_via_relay / target.metadata.relay and runs through your bridge exactly as an inline relay target would. A saved model carrying metadata.relay alongside other provider metadata still returns 400, and so does one that sets connect_via_relay without a metadata.relay block, or a metadata.relay block without the flag - a half-configured relay would otherwise be called directly at an address that only resolves inside your network.
curl --request POST \
--url https://api.enkryptai.com/rt/model/redteam \
--header 'Content-Type: application/json' \
--header 'X-Enkrypt-Model: <x-enkrypt-model>' \
--header 'X-Enkrypt-Model-Version: <x-enkrypt-model-version>' \
--header 'apikey: <api-key>' \
--data '
{
"risk_categories": {},
"compliance_frameworks": [],
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": [
"<string>"
]
}
]
},
"generation_config": {
"dataset_name": "<string>",
"max_prompts": 250,
"seed_prompts": [
{
"prompt": "<string>"
}
],
"include_standard_library": true
},
"run_name": "<string>",
"comprehensiveness": "Standard",
"user_metadata": {}
}
'import requests
url = "https://api.enkryptai.com/rt/model/redteam"
payload = {
"risk_categories": {},
"compliance_frameworks": [],
"context": {
"system_description": "<string>",
"policy_description": "<string>",
"policy_rules": [
{
"id": "<string>",
"text": "<string>",
"risk_category": "<string>",
"severity": "<string>",
"frameworks": ["<string>"]
}
]
},
"generation_config": {
"dataset_name": "<string>",
"max_prompts": 250,
"seed_prompts": [{ "prompt": "<string>" }],
"include_standard_library": True
},
"run_name": "<string>",
"comprehensiveness": "Standard",
"user_metadata": {}
}
headers = {
"X-Enkrypt-Model": "<x-enkrypt-model>",
"X-Enkrypt-Model-Version": "<x-enkrypt-model-version>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Enkrypt-Model': '<x-enkrypt-model>',
'X-Enkrypt-Model-Version': '<x-enkrypt-model-version>',
apikey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
risk_categories: {},
compliance_frameworks: [],
context: {
system_description: '<string>',
policy_description: '<string>',
policy_rules: [
{
id: '<string>',
text: '<string>',
risk_category: '<string>',
severity: '<string>',
frameworks: ['<string>']
}
]
},
generation_config: {
dataset_name: '<string>',
max_prompts: 250,
seed_prompts: [{prompt: '<string>'}],
include_standard_library: true
},
run_name: '<string>',
comprehensiveness: 'Standard',
user_metadata: {}
})
};
fetch('https://api.enkryptai.com/rt/model/redteam', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.enkryptai.com/rt/model/redteam",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'risk_categories' => [
],
'compliance_frameworks' => [
],
'context' => [
'system_description' => '<string>',
'policy_description' => '<string>',
'policy_rules' => [
[
'id' => '<string>',
'text' => '<string>',
'risk_category' => '<string>',
'severity' => '<string>',
'frameworks' => [
'<string>'
]
]
]
],
'generation_config' => [
'dataset_name' => '<string>',
'max_prompts' => 250,
'seed_prompts' => [
[
'prompt' => '<string>'
]
],
'include_standard_library' => true
],
'run_name' => '<string>',
'comprehensiveness' => 'Standard',
'user_metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Enkrypt-Model: <x-enkrypt-model>",
"X-Enkrypt-Model-Version: <x-enkrypt-model-version>",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.enkryptai.com/rt/model/redteam"
payload := strings.NewReader("{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Enkrypt-Model", "<x-enkrypt-model>")
req.Header.Add("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.enkryptai.com/rt/model/redteam")
.header("X-Enkrypt-Model", "<x-enkrypt-model>")
.header("X-Enkrypt-Model-Version", "<x-enkrypt-model-version>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.enkryptai.com/rt/model/redteam")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Enkrypt-Model"] = '<x-enkrypt-model>'
request["X-Enkrypt-Model-Version"] = '<x-enkrypt-model-version>'
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"risk_categories\": {},\n \"compliance_frameworks\": [],\n \"context\": {\n \"system_description\": \"<string>\",\n \"policy_description\": \"<string>\",\n \"policy_rules\": [\n {\n \"id\": \"<string>\",\n \"text\": \"<string>\",\n \"risk_category\": \"<string>\",\n \"severity\": \"<string>\",\n \"frameworks\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"generation_config\": {\n \"dataset_name\": \"<string>\",\n \"max_prompts\": 250,\n \"seed_prompts\": [\n {\n \"prompt\": \"<string>\"\n }\n ],\n \"include_standard_library\": true\n },\n \"run_name\": \"<string>\",\n \"comprehensiveness\": \"Standard\",\n \"user_metadata\": {}\n}"
response = http.request(request)
puts response.read_body{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Headers
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.
"customer-support-coc"
The model saved name. E.g. Test Model
"Test Model"
The model version. Default is 'v1'
"v1"
Body
POST /v1/redteam payload.
Per payload.md: model + (risk_categories | compliance_frameworks) + context
- generation_config.
attack_configlives nested under each risk_category. Optionalsub_categoriesphrases (from/threat-modeling/categories) may also nest under each risk_category to scope on-the-fly generation.
target is omitted: the saved model named in the X-Enkrypt-Model / X-Enkrypt-Model-Version headers supplies it.
Show child attributes
Show child attributes
owasp_llm_top10, eu_ai_act, nist_ai_rmf, mitre_atlas, iso_42001, aiuc_1 Show child attributes
Show child attributes
generation_config block per payload.md.
Two mutually-exclusive modes:
- Pre-built dataset:
dataset_name - On-the-fly generation:
max_promptsand/orseed_prompts
Plus an orthogonal include_standard_library toggle (default true).
Show child attributes
Show child attributes
1 - 200How 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.
Low, Medium, High, Standard, Comprehensive "Standard"
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.

