Daemon Configuration
Harden the daemon’saxon.toml before going live. The default config is tuned for local development; production needs tighter settings.
Enable API key authentication
"auth_enabled": true:auth_enabled is false, update your config and restart the daemon:axon-daemon.exe keygen and store it in your secrets manager — not in source code.Bind to localhost only
Set appropriate rate limits
session.watch()), the /watch WebSocket endpoint is not rate-limited — you can reduce state_per_second accordingly.Enable persistent schema registry
axon_registry.db (see the Backup section below).Lock down CORS
allow_all_origins = true in production.Set structured logging at info level
debug logging generates gigabytes of output per day on a busy daemon. Use info and structured JSON for log aggregator compatibility:Agent Code Safety
Use verify=True on all irreversible actions
reversibility: irreversible_write — send_reply, send_email, delete, take_off, and others — must include a verify_expression. Without it, the daemon rejects the request:Gate on confidence before critical actions
0.95 means the probe hasn’t fully mapped the application yet:Handle NSPConfidenceTooLowError gracefully
Use wait_for_app instead of attach on startup
client.attach() raises NSPNotFoundError if the app isn’t ready yet. wait_for_app retries until the app is detected and confidence is sufficient:Use streaming instead of polling
Store API keys in environment variables
sk_nsp_... keys in source code. Use environment variables or a secrets manager:repr() outputs and log statements never surface key values.Testing Before Going Live
Test reversible actions first
Test reversible actions first
irreversible_write action in production, verify your agent logic with reversible_write equivalents. For example, test with archive and mark_read before enabling send_reply or delete. Reversible actions can be undone; irreversible ones cannot.Verify your verify_expression catches failures
Verify your verify_expression catches failures
email_id) and confirm that result.success is False and your agent handles the error path correctly. A verify_expression that always evaluates to true provides no protection.Load test before high-frequency deployment
Load test before high-frequency deployment
Monitoring
Set up monitoring before your first production deployment, not after the first incident.Poll the health endpoint
GET http://localhost:7842/health. Configure your monitoring system (Datadog, Prometheus, Uptime Kuma, etc.) to poll it every 30 seconds:status != "ok" and on tracked_processes dropping to 0 unexpectedly.Alert on daemon restarts
uptime_secs between two consecutive health checks means the daemon restarted. Restarts trigger cold probe warm-ups for any apps not in the persisted registry.Monitor for 429 responses
HTTP 429) from your agent mean it’s polling too fast. Instrument your agent code to count NSPRateLimitError exceptions and send that metric to your observability platform. A non-zero rate is a signal to switch to streaming.Set up log forwarding
format = "json" in axon.toml, the logs are structured and immediately queryable:nxlog, Windows Event Log forwarding, or a sidecar container) before production.Daemon Auto-Start
Install as a Windows Service
NSPDaemon and starts automatically at boot.Configure automatic restart on failure
- First failure: Restart the Service
- Second failure: Restart the Service
- Subsequent failures: Restart the Service
- Reset fail count after: 1 day
Verify the service starts after reboot
Key Management and Backup
Restrict permissions on axon_keys.json
Restrict permissions on axon_keys.json
Rotate keys when team members leave
Rotate keys when team members leave
axon-daemon.exe keygen, update your deployment secrets, restart the agent process, and then remove the old key from axon_keys.json. The daemon reloads the keys file without a restart.Back up axon_registry.db daily
Back up axon_registry.db daily
