Reference

Authentication and authorization

Bearer tokens, API keys, service profiles, sessions, federation, MFA, MCP tokens, webhook signatures, grants, envelopes, and row/field policy.

Vadyl separates authentication, project scope, capability grants, governance envelopes, row policy, field masks, and execution-surface authority. A request is allowed only when every layer agrees.

Canonical headers

HeaderPurpose
AuthorizationBearer user, service, API-key, or MCP access token.
X-Vadyl-TenantTenant slug or canonical tenant ID.
X-Vadyl-ProjectProject slug or canonical project ID.
X-Vadyl-BranchOptional branch override for preview/sandbox reads and writes.
Idempotency-KeySafe retry key for create, external egress, webhook replay, and agent/tool dispatch.
If-MatchOptimistic concurrency token or publication/branch precondition.

Authentication modes

ModeUse forNotes
Bearer session/user tokenDashboard, web apps, mobile apps, developer toolsMaterializes ActorContext, roles, claims, auth strength, context sets.
API key + secretCI, server-to-server jobsMaps to a service profile and grant set; rotate without changing project code.
Service profileInternal runtime, scheduled jobs, webhook handlersStrictly bounded by publication, surface, and grant descriptors.
MCP tokenExternal MCP clientsBound to an MCP exposure; dispatched through the same operation dispatcher.
Webhook HMACInbound/outbound webhook trustVerified over raw bytes before parsing; management API still uses bearer auth.
FederationOIDC, SAML, passkeys, MFA, JIT provisioningIdentityEntrypoint and IdentityManagement own the control surface.

Request and response

curl https://api.vadyl.app/v1/identity/me \
  -H "Authorization: Bearer $VADYL_TOKEN" \
  -H "X-Vadyl-Tenant: acme" \
  -H "X-Vadyl-Project: billing"

Authorization pipeline

  1. Authenticate the caller and materialize ActorContext.
  2. Resolve tenant/project/branch scope and project authority.
  3. Merge governance envelopes through the project ancestry chain.
  4. Check capability grants and operation-level required roles.
  5. Evaluate row policy, field masks, branch policy, and publication pins.
  6. Emit audit/observability evidence and expose explainability records.

Denied response

HTTP/1.1 403 Forbidden
{
  "error": {
    "code": "ACCESS_DENIED",
    "message": "Actor cannot read Order rows in this project scope.",
    "reasonCode": "Access.DeniedByPolicy",
    "correlationId": "01HXZ0J4YV8AJF2GFG2T1F7Y42",
    "explainUrl": "/api/Explainability/access/read?correlationId=01HXZ0J4YV8AJF2GFG2T1F7Y42"
  }
}

MFA and step-up

POST /api/identity/challenge/start
{ "subjectId": "usr_123", "requireStrength": "mfa-webauthn", "reason": "publish.production" }

POST /api/identity/challenge/verify
{ "challengeId": "chl_123", "proof": { "kind": "webauthn", "assertion": "..." } }

Policy result meanings

DecisionMeaning
AllowAll auth, grant, row, field, branch, and envelope checks passed.
DenyA required policy failed. Do not retry without changing authority or input.
MaskEntity is visible but specific fields are removed or redacted.
ChallengeOperation needs stronger auth, MFA, approval, or elevated role.