Installation
After installation, the malagent command is available globally.
Quick Reference
| Command | Description |
|---|
malagent setup | Interactive setup wizard |
malagent raft train | Run RAFT training |
malagent sft train | Run SFT training |
malagent verify | Verify a code sample |
malagent test | Run validation tests |
malagent info | Show environment info |
malagent proxmox | Proxmox VM management |
malagent elastic | Elastic Security status |
Setup Command
Interactive configuration wizard. Optional - you can skip setup and provide config files directly.
Options
| Option | Description |
|---|
--minimal | Minimal setup (Windows build server only) |
--full | Full setup (Windows + Elastic + Proxmox) |
--check | Check existing configs without modifying |
Examples
# Interactive setup (asks questions)
malagent setup
# Quick minimal setup for MVR mode
malagent setup --minimal
# Full infrastructure setup
malagent setup --full
# Validate existing configuration
malagent setup --check
RAFT Training
Run RAFT (Reward-rAnked Fine-Tuning) training cycles.
malagent raft train [OPTIONS]
Options
| Option | Description | Default |
|---|
--config, -c | Config file path | Auto-detect |
--model, -m | Base model | Qwen/Qwen2.5-Coder-7B |
--checkpoint | SFT checkpoint path | From config |
--prompts, -p | Prompts JSONL file | From config |
--output, -o | Output directory | models/raft |
--cycles | Number of RAFT cycles | 3 |
--mode | mvr or elastic | mvr |
--language, -l | Target language | msvc |
--curriculum | Curriculum strategy | none |
--reward-shaping | Reward shaping strategy | fixed |
--resume | Resume from checkpoint | False |
Language Options
| Value | Description |
|---|
msvc | Windows MSVC (remote SSH) |
mingw | Windows MinGW (local cross-compile) |
rust | Rust with Cargo |
go | Go with cross-compile |
dotnet, csharp | .NET/C# |
powershell | PowerShell scripts |
Curriculum Strategies
| Value | Description |
|---|
none | No curriculum (default) |
complexity | Sort by complexity |
progressive | Gradually increase difficulty |
adaptive | Adjust based on performance |
Reward Shaping Strategies
| Value | Description |
|---|
fixed | Fixed reward thresholds (default) |
annealing | Gradually increase threshold |
adaptive | Adjust based on distribution |
warmup | Lower threshold early, increase later |
Examples
# Basic MVR training
malagent raft train --mode mvr --prompts data/prompts/mvr_prompt_v2.jsonl
# With explicit config
malagent raft train --config configs/raft_config.yaml --cycles 6
# Rust training
malagent raft train --mode mvr --language rust --prompts rust_prompts.jsonl
# Elastic mode with full detection
malagent raft train --mode elastic --config configs/elastic_verifier.yaml
# Resume interrupted training
malagent raft train --config configs/raft_config.yaml --resume
SFT Training
Run Supervised Fine-Tuning for cold start.
malagent sft train [OPTIONS]
Options
| Option | Description | Default |
|---|
--config, -c | Config file path | None |
--data | Training data file | From config |
--output, -o | Output directory | models/sft |
--epochs | Number of epochs | 3 |
Examples
# Basic SFT training
malagent sft train --data data/sft_examples.jsonl --output models/sft
# With config file
malagent sft train --config configs/sft_config.yaml --epochs 5
Verify Command
Verify a single code sample.
malagent verify [OPTIONS]
Options
| Option | Description | Default |
|---|
--code | Code file to verify | stdin |
--mode | mvr or elastic | mvr |
--host | Windows host | 10.0.0.152 |
--user | Windows user | keys |
--key | SSH key path | ~/.ssh/win |
Examples
# Verify a file
malagent verify --code sample.cpp
# Verify with Elastic detection
malagent verify --code sample.cpp --mode elastic
# Verify from stdin
cat sample.cpp | malagent verify
# Custom Windows host
malagent verify --code sample.cpp --host 192.168.1.100 --user admin
Test Command
Run pipeline validation tests.
Options
| Option | Description | Default |
|---|
--level, -l | Test level | smoke |
--verbose, -v | Verbose output | False |
Test Levels
| Level | Tests |
|---|
smoke | Import modules, code extraction |
standard | + SSH to Windows, GPU availability |
full | + MSVC compilation test |
Examples
# Quick smoke test
malagent test
# Full validation
malagent test --level full --verbose
Info Command
Show hardware and environment information.
Output
- GPU name and memory
- ROCm/CUDA version
- PyTorch version
- SSH connectivity status
- Configuration file status
Proxmox Commands
Manage Proxmox VM pool for sample execution.
malagent proxmox <subcommand> [OPTIONS]
Subcommands
| Subcommand | Description |
|---|
status | Show VM status |
create | Create VM pool |
destroy | Destroy VMs |
start | Start VMs |
stop | Stop VMs |
revert | Revert to snapshot |
snapshot | Create snapshot |
Common Options
| Option | Description | Default |
|---|
--config, -c | Config file | Auto-detect |
--vmid | Specific VM ID | None |
--all | All training VMs | False |
--prefix | VM name prefix | rlvr-train |
Examples
# Check VM status
malagent proxmox status
# Create 4 training VMs
malagent proxmox create --count 4 --prefix rlvr-train
# Start all training VMs
malagent proxmox start --all
# Revert all VMs to clean snapshot
malagent proxmox revert --all --snapshot rlvr-baseline
# Create snapshot of all VMs
malagent proxmox snapshot --all --name checkpoint-1
# Stop specific VM
malagent proxmox stop --vmid 105
# Destroy all training VMs
malagent proxmox destroy --all --prefix rlvr-train
Elastic Commands
Interact with Elastic Security.
malagent elastic <subcommand> [OPTIONS]
Subcommands
| Subcommand | Description |
|---|
status | Check Kibana and Fleet status |
alerts | Query recent detection alerts |
rules | Check detection rules |
Options
| Option | Description | Default |
|---|
--config, -c | Config file | Auto-detect |
--limit | Max alerts to show (alerts only) | 10 |
Examples
# Check Elastic status
malagent elastic status
# Query last 20 alerts
malagent elastic alerts --limit 20
# Check detection rules
malagent elastic rules
Exit Codes
| Code | Meaning |
|---|
| 0 | Success |
| 1 | General error |
Environment Variables
| Variable | Description |
|---|
MALAGENT_CONFIG | Default config file path |
ANTHROPIC_API_KEY | Anthropic API key (for distillation) |
OPENAI_API_KEY | OpenAI API key (for distillation) |
Configuration File Discovery
When no config is specified, malagent looks for configs in this order:
configs/raft_config.yamlconfigs/elastic_verifier.yamlconfigs/windows_connection.yaml