REDACT builds red-teaming datasets for content moderation and jailbreak research. Give it a taxonomy of harm categories and a recipe: it generates samples for every category, checks each one with a second model, generates model responses, augments the samples with jailbreak techniques and natural variations, and merges the accepted rows into one CSV. Every stage saves as it goes and resumes where it stopped. It is for AI safety researchers and engineers who build or evaluate content-moderation filters and jailbreak guardrails, and is built for defensive research. It is developed by CeSIA — Centre pour la Sécurité de l'IA, and grew out of the datasets of its sister project BELLS-O, a benchmark of AI supervision systems.
📖 Full documentation: https://centresecuriteia.github.io/REDACT/
A run is an ordered list of stages. Each is one function you can also call on its own:
- constitution: a strong model writes, per taxonomy category, sample descriptions at four severities: harmful, dual-use harmful, dual-use benign, benign.
- inputs: an uncensored model turns each description into prompts, and a checker model accepts or rejects every one.
- outputs: one checked model response per accepted input.
- paraphrase: checked rewordings of the inputs and outputs, to remove the generating model's fingerprint.
- jailbreaks: attacks drawn from 152 techniques in 23 families, dealt evenly across categories, and natural variations of the inputs.
- build: the accepted rows of every stage, merged into
complete_dataset.csv.
Models are hosted APIs or local vLLM engines, planned onto the GPUs stage by stage. Prompts are JSON files that a run can override one by one. docs/overview.md draws the files each stage reads and writes.
Python 3.11 or later.
git clone https://github.com/CentreSecuriteIA/REDACT.git
cd REDACT
pip install -e . # hosted models (Venice, Anthropic, OpenRouter)
pip install -e ".[vllm]" # + local models through vLLMPut the API keys (VENICE_API_KEY, ANTHROPIC_API_KEY,
OPENROUTER_API_KEY) in a .env file at the repository root. The other
extras are in docs/running.md.
Run the example recipe, all six stages, into ./runs/first:
python scripts/run.py src/redact/configs/runs/training_example.json --data-dir ./runs/firstThe merged dataset lands in ./runs/first/Datasets/complete_dataset.csv.
The paraphrase stage loads a 24B model on a local GPU; take it out of the
recipe's stages to run on hosted models only.
Or call a stage from Python:
from redact import generate_constitution, generate_inputs
constitution = generate_constitution(data_dir="./runs/first", num_taxonomy_categories=3)
inputs = generate_inputs(data_dir="./runs/first", constitution_df=constitution, samples_per_entry=3)- Documentation site, with the API reference
- Overview: the stages, the files they pass on, one run end to end
- Running a pipeline: recipes, models, the GPU planner, resume, cost, common failures
- Configuration: every recipe key, params key and registry field
- Jailbreak techniques: every technique by layer and family
- Extending: add a model, a prompt, a technique, a stage or a taxonomy
- Stages and internals: one page per stage and per layer
Datasets REDACT has produced, on Hugging Face under centrepourlasecuriteia. Access is granted on request, on each dataset's page.
- content-moderation-input-dataset
- content-moderation-output-dataset
- jailbreak-dataset
- BET-jailbreak-dataset
- constitution-dataset
- constitution-input-dataset
- constitution-input-augmented-dataset
MIT License. See LICENSE.