Bearer keys and scopes

Authentication

Every API request carries a bearer key in the Authorization header. Keys belong to a project, carry an explicit scope list, and are checked by the trust kernel at execution time — a run fails at the offending step, not at the door, and the attempt is logged.

curl https://api.myndlabs.ai/v1/runs \
  -H "Authorization: Bearer sk_live_..."

Key types

prefixenvironmentnotes
sk_live_productionServer-side secret. Full scope grants allowed.
sk_test_sandboxSynthetic context; free to call; same API shape.
pk_live_browserCan only mint short-lived session tokens.
sk_ci_CIRead-only default; for replay and eval pipelines.

Scopes

Scopes are resource:verb pairs granted at key creation. The kernel enforces them per fetch and per action; scope_denied errors name the missing scope so widening is a deliberate act, not a guess.

scopegrants
runs:writeCreate and delete runs
runs:readRetrieve runs and traces
context:documentsRead the documents source
context:calendarRead the calendar source
context:financeRead the finance source
agents:executeRuns may invoke declared tools
files:writeUpload and delete files
webhooks:manageCreate, rotate, delete webhook endpoints

Session tokens

For browser and mobile surfaces, exchange a publishable key plus your backend's signature for a session token: 15-minute lifetime, scoped to a single user's slice of the graph, refreshable server-side. Never embed a secret key in a client.

Rotation and revocation

Rotation is overlap-based: create the successor, deploy, revoke the old key. Revocation propagates globally in under five seconds. Keys idle for 90 days are flagged on the dashboard; treat them as candidates for deletion.