Overview
Keys authenticate users against the platform. Format:ns_<32 hex chars>. Only the SHA-256 hash is stored; raw keys cannot be recovered from the database.
There are two kinds of keys:
- Bootstrap key: provisioned by the operator before the server starts. This is the initial credential that makes all other operations possible.
- User keys: created through the authenticated API by someone who already has a valid key.
Bootstrap key
The bootstrap key is set via theNIGHTSHIFT_API_KEY environment variable. When the server starts, it hashes the value and stores it in the database. This is the only key that bypasses the API.
The operator generates the key themselves:
Generate user keys
Once authenticated, generate additional keys through the API:POST /api/api-keys on the server. The server generates the key, stores its hash, and returns the raw key once.
| Option | Default | Description |
|---|---|---|
--tenant | caller’s tenant | Tenant ID to scope the key to |
--label | "" | Human-readable label for identification |
List keys
Revoke a key
api-key list. Provide more characters if the prefix is ambiguous.
Multi-tenant isolation
Agents and runs are scoped by tenant ID. One tenant cannot see or run another’s agents.The tenant ID in the API key determines which agents and runs a user can access. There is no cross-tenant visibility.
