Skip to main content
POST
/
api
/
dataframer
/
red-team-specs
Python
import os
from dataframer import Dataframer

client = Dataframer(
    api_key=os.environ.get("DATAFRAMER_API_KEY"),  # This is the default and can be omitted
)
red_team_spec = client.dataframer.red_team_specs.create(
    app_description="A patient-facing chatbot that helps schedule appointments and answer general health questions",
    domain_description="Healthcare and medical information services",
    name="Healthcare Chatbot",
    concerns="Should not provide medical diagnoses, prescription recommendations, or treatment advice",
)
print(red_team_spec.id)
{
  "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>"
}

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