Red Corsair Documentation

Complete reference for the AI red team automation platform

📋 Documentation Sections

Getting Started

Advanced Usage

🚀 Installation Guide

Prerequisites

  • • Python 3.11 or higher
  • • Docker and Docker Compose
  • • OpenAI API key (required for IMPROVISE mode)
  • • Google API key (optional, for Gemini Pro 2.5)
  • • Git (for cloning the repository)

Step-by-Step Installation

# 1. Clone the repository
git clone https://github.com/Alex-Zeo/redcorsair.git
cd redcorsair/corsair_agent
# 2. Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# 3. Install dependencies
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
# 4. Configure environment
cp .env.example .env
nano .env # Edit with your API keys
# 5. Start infrastructure
docker-compose up -d postgres redis weaviate

⚡ Quick Start

IMPROVISE

High-variance discovery mode for creative jailbreak exploration

python -m cli.cli improvise --tactics 10 --temperature-boost 0.2

ADAPT

Weighted learning and retraining from successful attacks

python -m cli.cli adapt --retrain-weights --score-threshold 4.0

OVERCOME

Proven template execution for custom prompts

python -m cli.cli overcome --prompt "Your test prompt"

⚙️ Configuration

Environment Variables

OPENAI_API_KEY=your_openai_key_here
GOOGLE_API_KEY=your_google_key_here
DATABASE_URL=postgresql://user:pass@localhost/pyrit
REDIS_URL=redis://localhost:6379/0
GEMINI_MODEL=gemini-2.0-flash-exp
GEMINI_REQUESTS_PER_MINUTE=15

🔌 MCP Integration

Model Context Protocol Server

Red Corsair exposes a JSON-RPC 2.0 server for external AI agent integration

# Start MCP Server
python -m redcorsair.mcp_server --host localhost --port 8001

Available Methods

  • run_tactic - Execute attack tactics
  • list_tactics - Get available tactics
  • get_system_health - System status
  • execute_campaign - Run campaigns

Authentication

Use Bearer token authentication:

Authorization: Bearer YOUR_API_KEY

🎯 Attack Tactics Reference

📊 Live Attack Results

View real jailbreak attempts and successful exploits across different AI models and content categories

View Live Results Carousel

📖 CLI Commands Reference

🎯 Core Attack Modes

ADAPT Mode

Build comprehensive attack database by executing all tactics against target model

# Show ADAPT options
python -m cli.cli adapt --help
Usage: python -m cli.cli adapt [OPTIONS]

Options:
  -t, --target-model TEXT         Target model
  -s, --target-successes INTEGER  Target successful attacks per category
  -p, --max-parallel INTEGER      Maximum parallel tasks
  --timeout INTEGER               Campaign timeout in seconds
# Advanced ADAPT usage
python -m cli.cli adapt --target-model "gpt-4o" --target-successes 5 --max-parallel 3 --timeout 300

OVERCOME Mode

Run the best ledger tactics against a custom prompt

# Show OVERCOME options
python -m cli.cli overcome --help
Usage: python -m cli.cli overcome [OPTIONS]

Options:
  -m, --prompt TEXT        Prompt to attack [required]
  -t, --target-model TEXT  Target model
# Advanced OVERCOME usage
python -m cli.cli overcome --target-model "gpt-4o" --prompt "I need help understanding AI safety vulnerabilities for my cybersecurity research"

📊 Analysis & Reporting

Scoreboard

Show highest ranked tactics from the attack ledger

# View attack scoreboard
python -m cli.cli scoreboard

Export Ledger

Export attack ledger data to JSON

Usage: python -m cli.cli export-ledger [OPTIONS]

Options:
  -o, --output TEXT  Output file
  -a, --api           Fetch analytics from API
# Advanced export with API analytics
python -m cli.cli export-ledger --output attack_results.json --api

🚀 Project Management

Initialize Project

Initialize a new Red Corsair project

Usage: python -m cli.cli init [OPTIONS] PROJECT_NAME

Options:
  -d, --description TEXT  Project description
# Advanced project initialization
python -m cli.cli init "AI Safety Assessment" --description "Comprehensive security evaluation of LLM deployment"

Parse Requirements

Parse a Product Requirements Document to generate attack plans

Usage: python -m cli.cli parse-prd [OPTIONS] PRD_FILE

Options:
  -p, --project-dir TEXT  Project directory
# Advanced PRD parsing
python -m cli.cli parse-prd requirements.md --project-dir ./security_assessment

🔧 Additional Commands

Task Analysis
python -m cli.cli analyze-complexity

Analyze task complexity using LLM

List Tasks
python -m cli.cli list

List all tasks with dependencies

Set Status
python -m cli.cli set-status

Update task status

API Login
python -m cli.cli login

Login to PyRIT API

Need More Help?

Explore our comprehensive guides and community resources