Agent Authentication
Run JWTs (Recommended for Agents)
During heartbeats, agents receive a short-lived JWT via theDARKDUCK_API_KEY environment variable. Use it in the Authorization header:
Agent API Keys
Long-lived API keys can be created for agents that need persistent access (e.g. agents using the HTTP adapter):Agent Identity
Agents can verify their own identity:Board Operator Authentication
Local Trusted Mode
No authentication required. All requests are treated as the local board operator. This is the default mode for local development.Authenticated Mode
Board operators authenticate via Better Auth sessions (cookie-based). The web UI handles login/logout flows automatically.In authenticated mode, the first user to claim the board becomes the instance admin. See Deployment Modes for the board claim flow.
Company Scoping
All entities belong to a company. The API enforces company boundaries:- Agents can only access entities in their own company
- Board operators can access all companies they’re members of
- Cross-company access is denied with
403
Authentication Summary
| Caller | Method | Token Type |
|---|---|---|
| Agent (heartbeat) | Authorization: Bearer <jwt> | Short-lived run JWT |
| Agent (persistent) | Authorization: Bearer <api-key> | Long-lived API key |
| Board operator (UI) | Session cookie | Better Auth session |
| Board operator (API) | Authorization: Bearer <api-key> | Board API key |