POST
/
redteam
/
v2
/
add-task
curl --request POST \
  --url https://api.enkryptai.com/redteam/v2/add-task \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "test_name": "Test 1",
  "dataset_name": "standard",
  "redteam_test_configurations": {
    "bias_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "cbrn_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "harmful_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "insecure_code_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "toxicity_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_bias_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_info_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_tool_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_command_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_pii_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    },
    "adv_competitor_test": {
      "sample_percentage": 1,
      "attack_methods": {
        "basic": [
          "basic"
        ],
        "advanced": {
          "static": [
            "encoding"
          ],
          "dynamic": [
            "iterative"
          ]
        }
      }
    }
  },
  "target_model_configuration": {
    "model_name": "meta-llama/Llama-2-13b-chat-hf",
    "testing_for": "Copilot",
    "model_type": "text_2_text",
    "model_version": "v1",
    "model_source": "https://together.ai",
    "model_provider": "together",
    "model_endpoint_url": "https://api.together.xyz/v1/chat/completions",
    "model_api_key": "ABCDE12345678900",
    "system_prompt": "",
    "conversation_template": "",
    "rate_per_min": 20
  }
}'
{
  "message": "Redteam task has been added successfully",
  "task_id": "redteam-job-6c3babbe-3bc4-4553-a0b7-454df720579f",
  "data": {
    "test_name": "Test 1",
    "dataset_name": "standard",
    "redteam_test_configurations": {
      "bias_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "cbrn_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "harmful_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "insecure_code_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "toxicity_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_bias_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_info_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_tool_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_command_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_pii_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      },
      "adv_competitor_test": {
        "sample_percentage": 1,
        "attack_methods": {
          "basic": [
            "basic"
          ],
          "advanced": {
            "static": [
              "encoding"
            ],
            "dynamic": [
              "iterative"
            ]
          }
        }
      }
    },
    "target_model_configuration": {
      "model_name": "meta-llama/Llama-2-13b-chat-hf",
      "testing_for": "Copilot",
      "model_type": "text_2_text",
      "model_version": "v1",
      "model_source": "https://together.ai",
      "model_provider": "together",
      "model_endpoint_url": "https://api.together.xyz/v1/chat/completions",
      "system_prompt": "",
      "conversation_template": "",
      "rate_per_min": 20
    }
  }
}

Authorizations

apikey
string
header
required

Body

application/json
redteam_test_configurations
object
required
target_model_configuration
object
required
test_name
string
Example:

"Test 1"

dataset_name
string
Example:

"standard"

Response

200 - application/json
Successful Response
task_id
string
required
Example:

"redteam-job-6c3babbe-3bc4-4553-a0b7-454df720579f"

message
string
Example:

"Redteam task has been added successfully"

data
object