SpecAlign Documentation ======================= .. image:: https://readthedocs.org/projects/specalign/badge/?version=latest :target: https://specalign.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status **SpecAlign** is a multi-agent adversarial testing framework for evaluating LLM compliance with safety specifications. It generates synthetic data through red team testing, producing DPO (Direct Preference Optimization) datasets for model alignment. Key Features ------------ - **Multi-agent adversarial testing**: Attacker and Defender agents compete to find specification violations - **DPO dataset generation**: Automatically generates preference pairs for training - **Configurable providers**: Support for OpenAI, Anthropic, local models, and more - **Rich CLI**: Modern command-line interface with progress tracking - **Flexible configuration**: JSON config files with environment variable support Quick Example ------------- .. code-block:: bash # Install SpecAlign pip install specalign # Initialize configuration specalign config init # Set API key export SPECALIGN_OPENAI_API_KEY="your-api-key" # Run the complete pipeline specalign run --config config.json Documentation Contents ---------------------- .. toctree:: :maxdepth: 2 :caption: Getting Started getting_started/installation getting_started/quickstart getting_started/first_experiment .. toctree:: :maxdepth: 2 :caption: Tutorials tutorials/index tutorials/spec_generation tutorials/red_team_pipeline tutorials/dpo_dataset tutorials/custom_providers .. toctree:: :maxdepth: 2 :caption: User Guide user_guide/configuration user_guide/cli_reference user_guide/output_formats .. toctree:: :maxdepth: 2 :caption: API Reference api_reference/index api_reference/core api_reference/agents api_reference/specgen api_reference/config api_reference/utils .. toctree:: :maxdepth: 1 :caption: About about/changelog about/contributing Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`