Skip to main content
POST
/
api
/
dataframer
/
red-team-specs
curl --request POST \
  --url https://df-api.dataframer.ai/api/dataframer/red-team-specs/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Healthcare Chatbot",
  "domain_description": "Healthcare and medical information services",
  "app_description": "A patient-facing chatbot that helps schedule appointments and answer general health questions",
  "concerns": "Should not provide medical diagnoses, prescription recommendations, or treatment advice"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "domain_description": "<string>",
  "app_description": "<string>",
  "concerns": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "company_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "company_name": "<string>",
  "created_by": 123,
  "created_by_email": "<string>"
}

What is Red Teaming?

Red teaming generates adversarial prompts designed to test your LLM application’s safety guardrails. Given a description of your application and its domain, it identifies potential undesirable behaviors and creates prompts that attempt to trigger them. Workflow:
  1. Create a red team spec (this endpoint) describing your application
  2. Create a run to generate adversarial prompts
  3. Poll the status until complete
  4. Get the results containing behaviors and adversarial prompts
When to use the main Specs/Runs workflow instead: Red teaming is designed for generating relatively short adversarial prompts and produces fewer than 100 prompts per run. If you need large volumes of diverse, complex synthetic data, use the main Specs and Runs workflow instead.
Spec names are automatically converted to snake_case and must be unique within your company.

Authorizations

Authorization
string
header
required

API Key authentication. Format: "Bearer YOUR_API_KEY"

Body

application/json

Request body for creating a red team spec

name
string
required

Name for the spec (will be converted to snake_case, must be unique within company)

domain_description
string
required

Description of the domain or industry the application operates in (e.g., 'Healthcare', 'E-commerce', 'Financial services')

app_description
string
required

Description of the application being tested, including its purpose and key functionality

concerns
string

Optional specific security concerns or undesirable behaviors to focus on (e.g., 'Should not provide medical diagnoses')

Response

Red team spec created successfully

A red team specification defining the application context for adversarial prompt generation

id
string<uuid>

Unique identifier for the red team spec

name
string

Name of the red team spec (auto-converted to snake_case)

domain_description
string

Description of the domain or industry the application operates in

app_description
string

Description of the application being tested, including its purpose and functionality

concerns
string | null

Specific security concerns or behaviors to focus on during red teaming

created_at
string<date-time>

Timestamp when the spec was created

updated_at
string<date-time>

Timestamp when the spec was last modified

company_id
string<uuid>

ID of the company that owns this spec

company_name
string

Name of the company that owns this spec

created_by
integer

ID of the user who created this spec

created_by_email
string

Email of the user who created this spec