Setup Wizard

Detailed guide to the interactive setup wizard

The setup wizard guides you through configuring all malagent infrastructure components interactively.

Quick Start

malagent setup

This launches the interactive wizard which:

  1. Asks which mode you want (Minimal, Standard, Full)
  2. Collects connection details for each component
  3. Tests connections in real-time
  4. Creates configuration files automatically

Setup Modes

Minimal Mode (--minimal)

Use when: You just want to train with compilation rewards (MVR mode).

Configures:

  • Windows DEVBOX (SSH + MSVC)
malagent setup --minimal

Wizard Flow:

MALAGENT SETUP WIZARD
=====================

Select setup mode:
  [1] Minimal - Windows build server only (MVR mode)
  [2] Standard - Windows + Elastic Security
  [3] Full - Windows + Elastic + Proxmox VM orchestration

Choice: 1

WINDOWS BUILD SERVER CONFIGURATION
----------------------------------
Windows host IP or hostname: 10.0.0.152
SSH username: keys
SSH key path (~/.ssh/id_rsa): ~/.ssh/win

Testing SSH connection... ✓
Testing MSVC compilation... ✓

Configuration saved to:
  - configs/raft_config.yaml
  - configs/windows_connection.yaml

Setup complete! Run: malagent raft train --mode mvr

Standard Mode (default)

Use when: You want detection-based rewards but don’t need VM orchestration.

Configures:

  • Windows DEVBOX (SSH + MSVC)
  • Elastic Security (Kibana API + Fleet)
malagent setup
# Or explicitly:
malagent setup --standard

Wizard Flow:

MALAGENT SETUP WIZARD
=====================

Select setup mode:
  [1] Minimal - Windows build server only
  [2] Standard - Windows + Elastic Security  ← Selected
  [3] Full - Windows + Elastic + Proxmox

WINDOWS BUILD SERVER CONFIGURATION
----------------------------------
[... Windows setup as above ...]

ELASTIC SECURITY CONFIGURATION
------------------------------
Kibana host (https://hostname:5601): https://10.0.20.145:5601
Elasticsearch username [elastic]: elastic
Elasticsearch password: ********

Testing Kibana connection... ✓
Checking detection rules... 
  Found 847 rules (523 enabled)
  Windows-related rules: 312

Fleet Server URL (https://hostname:8220): https://10.0.20.145:8220

Configuration saved to:
  - configs/raft_config.yaml
  - configs/elastic_verifier.yaml

Setup complete! Run: malagent raft train --mode elastic

Full Mode (--full)

Use when: You want automated VM pool management for parallel training.

Configures:

  • Windows DEVBOX
  • Elastic Security
  • Proxmox VM Orchestration
malagent setup --full

Additional Wizard Flow:

PROXMOX CONFIGURATION
---------------------
Proxmox host (https://hostname:8006): https://proxmox.local:8006
API user [root@pam]: root@pam
API token name: malagent
API token value: ********

Testing Proxmox connection... ✓

Discovering VM templates...
  [1] 100 - Windows10-Template
  [2] 101 - Windows11-Template  
  [3] 103 - rlvr-template ← Recommended

Select template: 3

Proxmox node [pve]: pve

Configuration saved to:
  - configs/proxmox.yaml

Setup complete!

Check Mode (--check)

Validate existing configuration without modifying:

malagent setup --check

Output:

MALAGENT CONFIGURATION CHECK
============================

Configuration files:
  ✓ configs/raft_config.yaml
  ✓ configs/elastic_verifier.yaml
  ✗ configs/proxmox.yaml (not found)

Testing Windows connection (10.0.0.152)...
  ✓ SSH connection successful
  ✓ MSVC available (Visual Studio 2022)

Testing Elastic connection (10.0.20.145:5601)...
  ✓ Kibana responding
  ✓ 523 detection rules enabled

Tip: Run 'malagent setup' to reconfigure
     Or use 'malagent raft train --config <path>' with your config

What Gets Created

After setup, these files are created in configs/:

raft_config.yaml

Main training configuration:

base_model: "Qwen/Qwen2.5-Coder-7B"
dataset_path: "malagent/data/prompts/mvr_prompt_v2.jsonl"

verifier:
  mode: mvr  # or "elastic"
  language: msvc

windows:
  host: "10.0.0.152"
  username: "keys"
  key_file: "~/.ssh/win"

raft:
  num_cycles: 6
  samples_per_prompt: 8
  reward_threshold: 0.5

elastic_verifier.yaml (Standard/Full mode)

Elastic Security connection:

elastic:
  host: "https://10.0.20.145:5601"
  username: "elastic"
  password: "your_password"
  verify_ssl: false

fleet:
  url: "https://10.0.20.145:8220"

detection:
  timeout: 120
  poll_interval: 5

proxmox.yaml (Full mode only)

Proxmox orchestration:

proxmox:
  host: "proxmox.local"
  user: "root@pam"
  token_name: "malagent"
  token_value: "your_token"
  node: "pve"
  template_vmid: 103

vm_pool:
  pool_size: 4
  name_prefix: "rlvr-train"
  snapshot_name: "rlvr-baseline"

Troubleshooting

SSH Connection Failed

Testing SSH connection... ✗
Error: Connection refused

Solutions:

  1. Verify Windows OpenSSH server is running:
    Get-Service sshd
    Start-Service sshd
    
  2. Check firewall allows port 22
  3. Verify key file exists and has correct permissions:
    chmod 600 ~/.ssh/win
    

MSVC Not Found

Testing MSVC compilation... ✗
Error: 'cl' is not recognized

Solutions:

  1. Install Visual Studio Build Tools
  2. Ensure “Desktop development with C++” workload is installed
  3. Verify vcvars64.bat path is correct

Elastic Connection Failed

Testing Kibana connection... ✗
Error: Connection refused

Solutions:

  1. Check Kibana is running: curl -k https://host:5601/api/status
  2. Verify credentials
  3. Check firewall allows port 5601

Proxmox Authentication Failed

Testing Proxmox connection... ✗
Error: 401 Unauthorized

Solutions:

  1. Verify token name and value are correct
  2. Ensure token has correct permissions (PVEAdmin or higher)
  3. Check token format: user@realm!tokenname

Non-Interactive Setup

For automation, you can skip the wizard and create configs manually:

# Copy example configs
cp configs/raft_config.yaml.example configs/raft_config.yaml

# Edit with your values
vim configs/raft_config.yaml

# Verify
malagent setup --check

Next Steps

After setup:

  1. Test your configuration:

    malagent test --level full
    
  2. Start training:

    malagent raft train --mode mvr
    
  3. Read the complete training guide: How to Train