Configuration

Complete configuration reference

Configuration Files

FilePurpose
configs/raft_config.yamlRAFT training settings
configs/sft_config.yamlSFT training settings
configs/windows_connection.yamlDEVBOX connection
configs/elastic_verifier.yamlElastic integration
configs/distillation.yamlExternal LLM settings

RAFT Configuration

raft:
  mode: "elastic"  # "mvr" or "elastic"
  
  model:
    path: "output/sft/final"
    base: "Qwen/Qwen2.5-Coder-7B"
  
  prompts:
    path: "data/prompts/mvr_prompt_v2.jsonl"
  
  generation:
    samples_per_prompt: 8
    temperature: 0.7
    max_new_tokens: 2048
    
  filtering:
    reward_threshold: 0.5
    keep_top_percent: 0.5
  
  training:
    epochs: 1
    batch_size: 2
    gradient_accumulation: 16
    learning_rate: 5e-5
    bf16: true
    gradient_checkpointing: true
  
  cycles: 6
  output_dir: "output/raft"

Windows Connection

windows:
  host: "10.0.0.152"
  port: 22
  user: "keys"
  key_path: "~/.ssh/win"
  
  compiler:
    type: "msvc"
    vcvars_path: "C:\\Program Files\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"
  
  paths:
    source_dir: "C:\\dev\\samples"
    output_dir: "C:\\dev\\output"
  
  timeout:
    connection: 10
    compilation: 30

Elastic Verifier

elastic:
  host: "10.0.20.145"
  port: 9200
  
  auth:
    username: "elastic"
    password: "your_password"
  
  ssl:
    verify: false
  
  detection:
    timeout: 120
    poll_interval: 5
  
  rewards:
    evaded: 1.0
    low: 0.8
    medium: 0.7
    high: 0.6
    critical: 0.5

Verifier Options

All verifiers support these common options:

verifier:
  # Language/compiler selection
  language: "msvc"  # msvc, mingw, rust, go, dotnet, powershell
  
  # Lint pre-checks (fast rejection of broken code)
  enable_lint: true
  
  # Metrics tracking
  track_metrics: true
  log_failed_samples: false  # Store failed samples (uses storage)
  
  # Binary caching
  binary_cache_dir: "./binary_cache"
  
  # Parallelism
  max_workers: 8

Language-Specific Options

MSVC (JointVerifier)

verifier:
  language: "msvc"
  windows:
    host: "10.0.0.152"
    user: "keys"
    key_path: "~/.ssh/win"
    vcvars_path: "C:\\...\\vcvars64.bat"
  timeout: 30

MinGW

verifier:
  language: "mingw"
  static_link: true
  warn_as_error: false

Rust

verifier:
  language: "rust"
  cross_compile: true
  auto_install_target: true  # Install Windows target via rustup
  edition: "2021"

Go

verifier:
  language: "go"
  cross_compile: true
  cgo_enabled: false

.NET/C#

verifier:
  language: "dotnet"
  target_framework: "net8.0"
  self_contained: true
  single_file: true

PowerShell

verifier:
  language: "powershell"
  validation_mode: "remote"  # remote, local, none, auto
  
  # For remote validation (uses Windows DEVBOX)
  windows:
    host: "10.0.0.152"
    user: "keys"
    key_path: "~/.ssh/win"

Distillation Configuration

distillation:
  # External LLM provider
  provider: "anthropic"  # anthropic, openai
  model: "claude-sonnet-4-20250514"
  
  # API authentication
  api_key_env: "ANTHROPIC_API_KEY"  # Environment variable name
  
  # Generation settings
  samples_per_prompt: 5
  temperature: 0.7
  max_tokens: 4096
  
  # Budget controls
  budget_usd: 20.0
  cost_warning_threshold: 0.8  # Warn at 80% budget
  
  # Rate limiting
  requests_per_minute: 50
  concurrent_requests: 5
  
  # Fix agent
  fix_agent:
    enabled: true
    max_attempts: 2
    provider: "anthropic"
    model: "claude-sonnet-4-20250514"
  
  # Output
  output_dir: "distillation_output"
  save_binaries: true
  save_alerts: true

Proxmox Configuration

proxmox:
  host: "proxmox.local"
  port: 8006
  user: "root@pam"
  token_name: "malagent"
  token_value: "your-api-token"
  
  verify_ssl: false
  
  vm_pool:
    template_id: 100
    pool_size: 4
    name_prefix: "malagent-vm"
    snapshot_name: "clean"
    
  timeouts:
    clone: 120
    start: 60
    stop: 30

Environment Variables

VariablePurpose
ANTHROPIC_API_KEYAnthropic API key for distillation
OPENAI_API_KEYOpenAI API key for distillation
ELASTIC_PASSWORDElastic password (alternative to config)
PROXMOX_TOKENProxmox API token (alternative to config)
MALAGENT_CONFIGDefault config file path

Configuration Precedence

  1. Command-line arguments (highest)
  2. Environment variables
  3. Config file specified with --config
  4. Default config file (configs/raft_config.yaml)
  5. Built-in defaults (lowest)

Example: Complete Training Config

# configs/raft_config.yaml

raft:
  mode: "mvr"
  
  model:
    base: "Qwen/Qwen2.5-Coder-7B"
  
  prompts:
    path: "malagent/data/prompts/mvr_prompt_v2.jsonl"
  
  generation:
    samples_per_prompt: 8
    temperature: 0.7
    max_new_tokens: 2048
  
  filtering:
    reward_threshold: 0.5
  
  training:
    epochs: 1
    batch_size: 2
    gradient_accumulation: 16
    learning_rate: 5e-5
    bf16: true
    gradient_checkpointing: true
  
  cycles: 6
  output_dir: "output/raft"

verifier:
  language: "msvc"
  enable_lint: true
  track_metrics: true
  binary_cache_dir: "./binary_cache"

windows:
  host: "10.0.0.152"
  user: "keys"
  key_path: "~/.ssh/win"
  vcvars_path: "C:\\Program Files\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat"