X-Substrate-Key header. The daemon verifies the key by comparing a BLAKE3 hash; the plaintext value is never stored on disk.
Generating a Key
Runkeygen from the directory where axon-daemon.exe lives, or from any terminal where it is on your PATH:
axon_keys.json and prints the plaintext key once — this is the only time you will see it:
--label to track which key belongs to which agent:
Key Format
All NSP API keys start with the prefixsk_nsp_ followed by a random alphanumeric string:
Enabling Authentication in axon.toml
Openaxon.toml (located in the daemon’s working directory or C:\ProgramData\Nelieo\) and confirm the [auth] section is configured:
axon_keys.json every 5 seconds without requiring a restart, so you can add, disable, or delete keys without any downtime.
If
require_key is false, the daemon prints a warning every 60 seconds. Treat that warning as a deployment blocker — disable auth only in isolated local development environments.The Keys File
All keys live in the JSON file pointed to bykeys_file. The daemon stores only the BLAKE3 hash — you cannot recover the original key from this file.
"enabled": false rather than deleting the entry:
Authenticating Requests
Pass the key in theX-Substrate-Key header on every request.
- curl
- Python SDK
With a valid key:Without a key (returns 401):
The NSP_API_KEY Environment Variable
The Python SDK automatically readsNSP_API_KEY from the process environment when you do not pass api_key to NSPClient. Set this variable in your shell profile, a .env file (excluded from source control), or your deployment environment:
401 Error Responses
The daemon returns401 Unauthorized for three distinct authentication failures:
All three return the same JSON envelope:
NSPAuthError. Inspect e.code to distinguish them:
Rotating Keys
Follow these steps when rotating a key — for example, during a periodic security rotation or after a suspected leak:1
Generate a replacement key
sk_nsp_... value and store it in your secrets manager.2
Update your agent configuration
Update
NSP_API_KEY in your deployment environment or secrets manager to point to the new key.3
Verify the new key works
200 OK response before proceeding.4
Disable the old key
Open
axon_keys.json and set "enabled": false on the old entry. The daemon picks up the change within 5 seconds.5
Delete the old key after a grace period
After 24 hours with no authentication errors using the new key, delete the old key entry from
axon_keys.json to keep the file tidy.