Configuration
Khaos is configured through CLI flags, environment variables, and cloud/session state under ~/.khaos/. This page covers the stable configuration surface in the current SDK.
Priority Order
TEXT
1. CLI flags (highest priority)
2. Environment variables
3. Stored cloud/session state (~/.khaos)
4. Built-in defaultsIn practice: use CLI flags for one-off overrides, env vars for CI, and stored cloud state for local interactive workflows.
Common Environment Variables
| Variable | Description |
|---|---|
KHAOS_STATE_DIR | Override local state directory (default: ~/.khaos) |
KHAOS_API_URL | Cloud API base URL (default: https://api.khaos.exordex.com) |
KHAOS_API_TOKEN | Cloud token for non-interactive auth (especially CI) |
KHAOS_PROJECT_SLUG | Target cloud project for sync and CI uploads |
KHAOS_DASHBOARD_URL | Dashboard URL override (default: https://khaos.exordex.com) |
KHAOS_AUTO_SYNC | Enable automatic sync defaults where supported |
Terminal
# CI example
export KHAOS_API_URL=https://api.khaos.exordex.com
export KHAOS_API_TOKEN=${{ secrets.KHAOS_API_TOKEN }}
export KHAOS_PROJECT_SLUG=my-org/my-project
khaos ci my-agent --eval quickstart --syncHigh-Value CLI Flags
Terminal
# Reproducible local run
khaos run my-agent --eval quickstart --seed 12345
# Custom thresholds in CI
khaos ci my-agent --eval full-eval --security-threshold 85 --resilience-threshold 75
# Validate cloud auth and project wiring only
khaos ci my-agent --preflight-only --syncFull command flags are documented on CLI Reference.
Python Config APIs
The stable config helper in this release is intentionally minimal:
Python
from khaos.config import load_config, DEFAULT_CONFIG_PATH
config = load_config() # Mapping[str, Any]
print(DEFAULT_CONFIG_PATH) # ~/.khaos/config.yamlFor cloud auth/sync state, use the cloud config helpers:
Python
from khaos.cloud import load_cloud_config
cloud = load_cloud_config()
print(cloud.api_url)
print(cloud.project_id)
print(cloud.masked_token())Cost Table Overrides
Khaos reads model pricing from the bundled table, with optional override via KHAOS_COST_TABLE.
Python
from khaos.costs import load_cost_table, estimate_cost_usd
rates = load_cost_table()
cost_usd, source = estimate_cost_usd(
provider="openai",
model="gpt-4o",
prompt_tokens=1200,
completion_tokens=300,
table=rates,
)
print(cost_usd, source)Validation Checklist
Terminal
# 1) Confirm local + cloud wiring
khaos doctor
khaos sync --status
# 2) Confirm command-level options
khaos run --help
khaos ci --help
# 3) Validate CI auth/project configuration
khaos ci my-agent --preflight-only --syncNo khaos config Command
The stable CLI does not include a
khaos config command group. Use env vars,khaos doctor, and command help output to validate configuration.