Auth model

SafeAssist uses three credential layers. Mixing them up is the most common integration mistake: each layer has a distinct audience and lifetime.

Auth0 operator session (humans)

Operators sign in at https://app.callvault.dev through Auth0. Production login uses Auth0 with email, Google, or GitHub on the tenant. New workspaces can start a free seven-day Personal trial with card collected up front. There is no separate SafeAssist username/password outside Auth0.

The access token must include API audience https://api.callvault.dev (same as AUTH0_AUDIENCE / NEXT_PUBLIC_AUTH0_AUDIENCE on the dashboard).

Every operator HTTP call to the broker API also needs:

  • Authorization: Bearer <Auth0 access token>
  • X-Broker-Tenant-Id: <tenant uuid> for a workspace you belong to. The Auth0 dashboard resolves this from GET /v1/workspaces (memberships). The dev-only default 11111111-1111-1111-1111-111111111101 applies when Auth0 is not configured.

That session authorizes tenant-scoped control routes: connections, agents, API keys, approvals, billing previews, webhooks, and GET /v1/ops/openapi.json on https://api.callvault.dev.

Workspaces are created with POST /v1/workspaces (email must be verified). Client-supplied tenant ids never create tenants or memberships. Trial billing starts only through that signup path or POST /v1/billing/trial/start after identity checks.

Control API keys (bk_*)

Server-side only. Prefix must be bk_test_ or bk_live_ (legacy sk_* keys are rejected). Created in the dashboard Connection keys page or via POST /v1/api-keys with an operator session.

Used to mint broker JWTs via POST /v1/broker/token (scope broker:token) and for other control-plane operations documented in the operator OpenAPI spec. Authenticate with Authorization: Bearer bk_test_… only. Do not send an X-Broker-Tenant-Id header. The tenant is bound to the key.

Never embed control keys in agent containers, browser bundles, or mobile apps.

Broker JWT (agent runtime)

Short-lived bearer token returned from /v1/broker/token. Scoped to tenant, agent app, and environment (test / live). Agents present this JWT to POST /v1/tools/execute and related agent routes (Bearer only).

The SDK's BrokerAgentClient throws if you pass a bk_* string where a broker JWT is expected.

OAuth tokens (upstream SaaS)

After Connections → Connect GitHub, tokens are stored encrypted in SafeAssist. Agents and your app code receive connection handles (connected_account_id UUIDs), not refresh tokens. GitHub is the only first-party connector in the shipped product; other providers require your own tool and OAuth wiring.