Config File Location
The main config file lives at ~/.clawmagic/config.json. It is created during onboarding and can be edited directly or through the portal Settings page.
~/.clawmagic/ ├── config.json # Main config (gateway, agent, plugins, etc.) ├── auth.json # Google OAuth tokens (if connected) └── workspace/ # Default agent workspace
Runtime settings that can change without restart are stored separately at state/config/runtime_settings.json inside the project directory.
Portal Settings
The web portal at localhost:5173 provides a full Settings UI for editing configuration without touching JSON files. Settings are organized into tabs:
- General: rate limits, AI logging, marketplace connection, response cache, retention, local tools, multi-agent mode
- Agent: safe mode, approval gates, tool profile, developer override, execution thresholds
- Advanced: AI provider API keys, GitHub token, marketplace credentials
Security-critical fields (remote access, API token, approval gates) cannot be changed via the portal API — they require direct config file or environment variable changes.
Gateway Settings
| Setting | Config Key | Env Override | Default | Notes |
|---|---|---|---|---|
| Port | gateway.port | CLAWMAGIC_GATEWAY_PORT | 18790 | 1–65535 |
| Host | gateway.host | — | 127.0.0.1 | Forced to localhost for security |
| Remote access | — | CLAWMAGIC_GATEWAY_ALLOW_REMOTE | false | Env-only. Use with TLS termination. |
| API token | gateway.api_token | CLAWMAGIC_GATEWAY_API_TOKEN | — | Min 8 chars. Required for remote. |
| CORS origins | gateway.cors_allowed_origins | CLAWMAGIC_GATEWAY_CORS_ALLOWED_ORIGINS | [] | Comma-separated |
| Rate limit | gateway.chat_rate_limit_per_minute | CLAWMAGIC_GATEWAY_CHAT_RATE_LIMIT_PER_MINUTE | 60 | 1–1000 |
| Approvals | gateway.approvals_enabled | CLAWMAGIC_GATEWAY_APPROVALS_ENABLED | true | Security-critical. Cannot disable via API. |
| Portal password | — | CLAWMAGIC_PORTAL_PASSWORD | — | Min 10 chars. Hashed with scrypt. |
Agent Defaults
| Setting | Config Key | Default | Options |
|---|---|---|---|
| Max iterations | agent.maxIterations | 6 | 1–100 |
| Safe mode | agents.defaults.safe_mode | true | true / false |
| Tool profile | agents.defaults.tool_profile | full | coding, messaging, automation, full |
| Command sandbox | agents.defaults.command_sandbox | restricted | restricted, standard, unrestricted |
| Exec security | agents.defaults.exec_security_mode | allowlist | deny, allowlist, full |
| Exec ask mode | agents.defaults.exec_ask_mode | risky | always, risky, never |
| Filesystem mode | agents.defaults.filesystem_mode | full | full, workspace_only |
| Plugin network | agents.defaults.plugin_network_mode | restricted | full, restricted, none |
All agent defaults can be overridden per-agent in the Agents page (/app/agents). Environment variable overrides use the pattern CLAWMAGIC_AGENTS_DEFAULTS_<FIELD>.
AI Provider Keys
ClawMagic uses BYOK (Bring Your Own Key). Set provider API keys via environment variables or through the portal Advanced Settings tab.
# Environment variables for AI providers OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_AI_API_KEY=AIza... # Or set via portal: Settings → Advanced → AI Provider Secrets
Provider keys are stored encrypted using AES-256-GCM. No plaintext secrets on disk. The onboarding wizard handles initial provider setup.
Marketplace Connection
| Setting | Config Key | Default | What It Does |
|---|---|---|---|
| Enabled | marketplace_enabled | true | Connect to marketplace API |
| Purchase approval | marketplace.approvals_required_for_purchases | true | Require human approval before buying |
| Agent purchases | marketplace_allow_agent_purchases | false | Let agents buy plugins autonomously |
| Daily limit | marketplace_daily_purchase_limit_cents | 0 | Max daily spend in cents |
| Malware scan | marketplace.require_malware_scan | true | Require scan before install |
| Checksum verify | marketplace.require_checksum_verification | true | Verify download integrity |
Plugin Settings
// ~/.clawmagic/config.json → plugins section
{
"plugins": {
"enabled": true, // Master switch
"allow": [], // Allowlist: only these slugs can load
"deny": [], // Denylist: block specific slugs
"load": { "paths": [] }, // Additional plugin directories
"compat": {
"openclawStrict": false, // Enforce OpenClaw manifest compat
"requireSignatures": false, // Require signed packages
"openclawInstallSecurity": "permissive" // strict|balanced|permissive
},
"slots": {
"memory": null // Optional: plugin slug for memory backend
}
}
}Memory Settings
Memory configuration is stored at state/config/memory_settings.json and controls the search, embedding, and cost guardrail behavior.
| Setting | Default | What It Does |
|---|---|---|
| Storage backend | jsonl | jsonl or sqlite |
| Search mode | bm25 | bm25, semantic, or hybrid |
| Embedding provider | auto | auto, openai, gemini, voyage, mistral, local, hash |
| Temporal decay | enabled | Older memories score lower (half-life in days) |
| Quality mode | off | off, pre, pre_post, full (runtime intelligence) |
| Cost guard | enabled | Budget limits per task and chain run |
Env overrides: CLAWMAGIC_STORAGE_BACKEND, CLAWMAGIC_SEARCH_MODE, CLAWMAGIC_EMBEDDING_PROVIDER, CLAWMAGIC_EMBEDDING_ENABLED.
Heartbeat Configuration
// Runtime settings → heartbeat
{
"heartbeat": {
"enabled": true,
"intervalMinutes": 30,
"keepaliveOnInbound": true,
"adaptiveCadence": true,
"activeHours": {
"enabled": true,
"startHour": 8,
"startMinute": 0,
"endHour": 22,
"endMinute": 0,
"timezone": "America/New_York"
}
}
}The heartbeat keeps your agent proactive during active hours. Set via the portal or during onboarding.
Environment Variable Reference
All config keys can be overridden via environment variables using the pattern CLAWMAGIC_<SECTION>_<KEY>. The .env.example file in the ClawMagic repo lists all available variables with documentation.
# Key environment variables CLAWMAGIC_GATEWAY_PORT=18790 CLAWMAGIC_GATEWAY_API_TOKEN=your-token-here CLAWMAGIC_PORTAL_PASSWORD=your-password OPENAI_API_KEY=sk-... ANTHROPIC_API_KEY=sk-ant-... GOOGLE_AI_API_KEY=AIza... CLAWMAGIC_AGENT_MAX_ITERATIONS=6 CLAWMAGIC_PLUGINS_ENABLED=true CLAWMAGIC_GATEWAY_ALLOW_REMOTE=false
Environment variables always override config file values. This is useful for Docker deployments and CI/CD where you inject config via env.
Next Steps
- /docs/environment — feature flags, marketplace connection, and provider setup.
- /docs/security — 50 security controls and how to configure them.
- /docs/deployment — remote access, Docker, and production deployment.
- /docs/power-workstation — built-in tools: thought chains, tickets, email, and more.