Human requests
Browser or user-facing clients send an Auth0 access token in the
Authorization header.Machine requests
Services use Auth0 client credentials plus explicit tenant and acting-user
headers.
Local development
DEV_AUTH_BYPASS=true allows unauthenticated local requests when no bearer
token is sent.SDK profiles
The Python SDK stores device, M2M, or dev auth settings in named profiles.
Runtime contract
Every authenticated request resolves to:| Field | Source | Purpose |
|---|---|---|
| User ID | JWT sub, Auth0 /userinfo, snc-userid, or local dev env | User attribution, memory, usage, and audit context. |
| Tenant | Namespaced Auth0 tenant claim, M2M tenant claim, or local dev env | Selects the tenant database and tenant-scoped resources. |
| Principal type | User token, client-credentials token, or local dev user | Separates human and machine usage attribution. |
/api/v1. System probes such as
/health, /ready, /docs, and /openapi.json stay unversioned.
Human bearer tokens
Human clients send an Auth0 access token:issagainstAUTH0_ISSUER, orhttps://$AUTH0_DOMAIN/whenAUTH0_ISSUERis unset.audagainstAUTH0_AUDIENCE.- Signature through the issuer JWKS.
- Allowed algorithms from
AUTH0_ALGORITHMS(RS256by default).
/userinfo, with a DynamoDB-backed cache when configured.
Tenant claim parsing
Tenant metadata is read from the configured Auth0 custom claim namespace. Defaults match the Syncly claim shape:AUTH0_CLAIM_KEY. A typical token or /userinfo payload contains tenant data
like this:
Machine clients
Machine-to-machine requests use Auth0 client credentials. The token must verify against the M2M issuer and audience, and it must include the required scope whenAUTH0_M2M_REQUIRED_SCOPE is set.
AUTH0_ISSUER and AUTH0_AUDIENCE.
Request a token from Auth0:
- The token is a client-credentials token.
- The token tenant claim exists.
- The token tenant claim matches the
snc-tenantheader. snc-useridis present and non-empty.- The required M2M scope is present when configured.
snc-tenant and snc-userid headers. Conversation APIs
require agentflow:conversations; cancellation APIs require
agentflow:cancellations. Without those scopes, AgentFlow rejects the request
instead of trusting arbitrary on-behalf-of headers.
Local development auth
For local backend work, set:DEV_AUTH_BYPASS=true and no Authorization header is sent, AgentFlow
uses the local dev tenant and user. If a bearer token is sent, the backend
verifies it normally.
Example local smoke test:
DEV_AUTH_BYPASS=true is rejected when ENVIRONMENT is production-like. Keep
it unset outside local development.
Python SDK
Install the private SDK from your onboarding package source:af_... API key. SDK bearer-token examples
use access_token / AGENTFLOW_ACCESS_TOKEN.
Required environment
DEV_AUTH_BYPASS=true instead of Auth0.
Multi-tenancy
See how tenant context maps to isolated AgentFlow data and runtime state.
API authentication
See the bearer-token contract used by REST clients.

