Skip to content

vios-s/CAUST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAUST - Continual Automated Unlearning Safety Testing

CAUST is an autonomous multi-agent system for red-teaming machine unlearning methods. It automatically generates hypotheses, designs experiments, and evaluates unlearning techniques to discover vulnerabilities in data-based and concept-erasure approaches.

Overview

CAUST uses a dual-loop architecture:

  • Inner Loop: Generates hypotheses, designs experiments, executes them on H200 GPUs, and evaluates results
  • Outer Loop: Synthesizes findings across iterations, judges novelty and impact, and produces comprehensive reports

The system leverages:

  • Multi-agent orchestration via CAMEL-AI
  • RAG (Retrieval Augmented Generation) for research paper knowledge
  • GPU-accelerated experiment execution on Kubernetes
  • Persistent memory for successful attack discoveries

Project Structure

CAUST/
├── aust/                       # Application package
│   ├── configs/                # Prompts, personas, thresholds, task templates
│   ├── experiments/            # Placeholder for experiment artifacts
│   ├── logs/                   # Runtime logs
│   ├── outputs/                # Persistent inner loop results
│   ├── rag_paper_db/           # Vector store for paper RAG
│   ├── scripts/                # CLI entry points for inner loop tooling
│   ├── src/                    # Source code
│   │   ├── agents/             # LLM-powered agent implementations
│   │   ├── loop/               # Orchestration and state management
│   │   ├── memory/             # Long-term memory system
│   │   ├── rag/                # Research paper retrieval subsystem
│   │   ├── toolkits/           # Integrations with external unlearning toolchains
│   │   └── logging_config.py   # Project-wide logging setup
│   ├── tests/                  # Test suite (unit + integration)
│   └── utils/                  # Helper scripts (e.g., paper downloads)
├── docker/                     # Docker and Kubernetes configs
│   ├── Dockerfile              # Container image definition
│   ├── job.yaml                # Kubernetes GPU job template
│   └── pvc.yaml                # Persistent volume claims
├── external/                   # Third-party submodules (DeepUnlearn, CAMEL)
├── logs/                       # Legacy log location (top-level)
├── requirements.txt            # Python dependencies
└── docs/                       # Project documentation

Setup Instructions

Prerequisites

  • Python 3.11.5+
  • Docker 24.0.7+
  • Kubernetes 1.28.x with NVIDIA GPU support (H200)
  • CUDA 12.1+ (for H200 GPUs)

Local Development Setup

  1. Clone the repository:

    git clone https://github.com/vios-s/CAUST.git
    cd CAUST
  2. Create Python virtual environment:

    python3.11 -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  3. Install dependencies:

    pip install --upgrade pip==23.3.1
    pip install -r requirements.txt
  4. Install CAMEL-AI in dev mode (Story 1.2):

    # Will be added in Story 1.2
  5. Set up environment variables:

    cp .env.example .env
    # Edit .env with your API keys (OpenRouter, etc.)
  6. Run tests:

    pytest tests/

Docker Build

Build the Docker image:

docker build -t caust:latest -f docker/Dockerfile .

Test the container:

docker run --rm caust:latest

Kubernetes Deployment

  1. Create persistent volumes:

    kubectl apply -f docker/pvc.yaml
  2. Submit GPU job:

    # Edit docker/job.yaml to set TASK_ID and TASK_TYPE
    kubectl apply -f docker/job.yaml
  3. Monitor job:

    kubectl get jobs
    kubectl logs job/caust-experiment-job

Documentation

All project documentation is organized in the docs/ directory:

📚 Main Documentation Files

📖 Story Documentation

  • docs/stories/ - Implementation stories and documentation
    • Story 1.5 - Hypothesis Refinement Workforce
    • Story 1.0-1.8 - Integration summaries
    • Test results and implementation details
    • Inner loop orchestrator documentation

🤖 CAMEL-AI Resources

Complete documentation for using CAMEL-AI patterns:

⚙️ Configuration Guides

🏗️ Architecture Documentation

  • docs/architecture/ - Comprehensive architecture details
    • Components, workflows, data models
    • Tech stack and external APIs
    • Test strategy and security considerations

📋 Project Artifacts

Development Workflow

Code Quality Standards

  • Formatter: black (line length 100)
  • Linter: ruff
  • Type Checking: mypy (strict mode)

Run code quality checks:

black aust/ tests/
ruff check aust/ tests/
mypy aust/

Testing

  • Unit tests: tests/unit/test_{module}.py
  • Integration tests: tests/integration/test_{workflow}.py

Run tests with coverage:

pytest tests/ --cov=aust --cov-report=html

Logging

All production code uses the logging framework (no print() statements):

from aust.logging_config import get_logger, set_correlation_id

logger = get_logger(__name__)

# Set correlation ID for request tracing
set_correlation_id("task_123")

# Log messages
logger.info("Starting experiment", extra={"experiment_id": "exp_001"})
logger.error("Experiment failed", extra={"error": str(e)})

Configuration

Configuration files are located in aust/configs/:

  • prompts/: Agent prompt templates
  • thresholds/: Evaluation threshold configurations
  • tasks/: Task-specific configurations
  • personas/: Judge persona definitions

Documentation

Troubleshooting

Docker build fails with CUDA errors

  • Ensure NVIDIA Docker runtime is installed: nvidia-docker --version
  • Verify GPU access: docker run --rm --gpus all nvidia/cuda:12.1.0-base-ubuntu22.04 nvidia-smi

Kubernetes job fails to schedule

  • Check GPU node labels: kubectl get nodes --show-labels | grep nvidia
  • Verify PVC is bound: kubectl get pvc

Import errors in Python

  • Ensure PYTHONPATH includes project root: export PYTHONPATH=/path/to/CAUST:$PYTHONPATH
  • Check virtual environment is activated

Logging not working

  • Verify logs/ directory exists and is writable
  • Check log level in configuration (default: INFO)

Contributing

Please follow the coding standards and ensure all tests pass before submitting changes.

License

TBD

Contact

Project repository: https://github.com/vios-s/CAUST

About

AUST in camel-ai

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors