Auth And Access
This page describes the access and permissions module.
Access model
- Console users authenticate with OTP and receive JWT tokens.
- Machine workloads authenticate with API keys.
- Governance APIs under
/v1/*accept JWT or API key, subject to scope. Member, API key management, billing, and entitlement endpoints accept only a JWT. Approval actions accept only a user JWT. Theauditorrole can only read; see auditor. - JWT authorization is role-based.
- API key authorization is scope-based.
This module keeps human sign-in and machine access separate so customers can manage permissions cleanly.
JWT roles
Roles are normalized to:
super_adminbilling_adminuserauditor
Role capabilities in Console
super_admin
- Full workspace access, including every write endpoint in the permission matrix.
- Can view and manage API keys, webhooks, and asset discoveries.
- Can approve, reject, and revoke approvals for all assets.
- Can invite, activate, and deactivate members.
billing_admin
- Read-only access to governance data in Console: assets, groups, policies, approvals, audit, decision explorer, and usage.
- Can run decisions (evaluate, proxy evaluate, and playground) for all assets.
- Can view organization settings and use the billing endpoints (checkout and billing portal).
- Can list API keys. Secrets are never returned. Cannot create, rotate, or revoke API keys.
- Cannot view webhooks or asset discoveries.
- Cannot perform governance write actions.
user
- Read-only access to governance data for assets the user owns: assets, policies, approvals, audit, and decision explorer return only records for owned assets. Groups and usage are not filtered.
- Can run decisions and approve, reject, or revoke approvals for owned assets. Approval actions are refused when the approver is the requester.
- Cannot view API keys, webhooks, or asset discoveries. Cannot start checkout or open the billing portal.
- Cannot perform governance write actions.
auditor
- Read-only, organization-wide access for reviewers. An auditor sees all records, not only owned assets.
- An auditor can call only these
GETroutes:/me,/settings,/v1/audit,/v1/audit/operations/{operation_id},/v1/audit/outcome-coverage,/v1/decision-explorer,/v1/decisions/{decision_id}/explanation,/v1/assets,/v1/groups,/v1/policies,/v1/policies/{id}/revisions,/v1/approvals,/v1/approvals/{id},/v1/usage, and/v1/integration-presets. Every other request is refused with403and coderead_only_role. That includes every write and routes such as/members, API keys, webhooks, billing, asset discoveries, and decisions. GET /settingsreturns only the auditor's own member record, not the member directory or API key metadata.- An auditor cannot approve, reject, or revoke approvals.
- An auditor always has an access expiry (see Time-bound access). When it passes, every request is refused with
401. - In Console, an auditor sees a read-only banner and only the sections backed by the routes above.
- Viewing an operation's detail as an auditor is recorded; see Auditor access records.
Time-bound access
A super_admin can give a member an access expiry.
- Invite.
POST /membersaccepts an optionalaccessExpiresAt(RFC3339). It must be in the future and at most 365 days away. It is required forauditor, optional foruserandbilling_admin, and not accepted forsuper_admin. Rejected values return400withaccess_expiry_required,access_expiry_invalid, oraccess_expiry_not_allowed. - Change.
POST /members/{id}/access-expirywith{"accessExpiresAt": "<RFC3339>"}renews or changes the expiry under the same rules.nullremoves it, but is refused for an auditor, and any request for asuper_adminmember is refused. A member of another organization, or one that does not exist, returns404withmember_not_found. Only asuper_adminJWT can call it. - Expiry. When the expiry passes, the member is refused on every request with
401and cannot sign in. The member is not deleted. A change takes effect on the next request. - Seats. An expired member does not use a seat. Renewing an expired, active member needs a free seat; otherwise the request returns
400withmember_seat_limit. - Member records include
accessExpiresAt, an RFC3339 UTC time ornull.
API key scopes
Every API key must include at least one scope.
Supported scopes:
decision:runassets:readassets:writeasset_discovery:writegroups:readgroups:writepolicies:readpolicies:writeapprovals:readapprovals:writeusage:readaudit:readapi_keys:readwebhooks:readwebhooks:write
approvals:write is accepted, but approve, reject, and revoke still require a user JWT. Creating, rotating, and revoking API keys are JWT-only, so API keys cannot manage other API keys. api_keys:write is not a supported scope; creating a key that includes it returns 400.
Behavior:
- Key creation validates scopes and rejects invalid values.
- Key rotation preserves current scopes and expiry.
- Requests without required scopes receive
403 Forbidden. - API keys can create, update, and delete assets, groups, policies, and webhooks, and delete asset discoveries, when they carry the matching write scope. Promoting a discovery into an asset uses
POST /v1/assetswithassets:write. - API keys can submit asset discoveries with
asset_discovery:write. Discovery submission by a JWT user is limited tosuper_admin. - API keys cannot approve, reject, or revoke approvals, even with
approvals:write. Those requests receive403withjwt_user_required.
API key lifecycle
- Every key has an expiry.
expiresAtis required when a key is created. It must be a future time no more than 365 days after creation. - A key's
statusisactive,revoked, orexpired. A key that is both revoked and past its expiry reportsrevoked. - Revoked and expired keys are rejected with
401 Unauthorized. Revocation takes effect on the next request. - Each key reports
lastUsed, the time of its most recent authenticated request. Use it to find keys that are no longer used. - The secret is returned once, when the key is created or rotated. The list endpoint never returns secrets.
Rotation guidance
- Rotate a key before its
expiresAt. Rotation issues a new secret and keeps the original expiry, so it does not extend the lifetime. To get a longer lifetime, create a new key with a laterexpiresAt. - Rotation invalidates the previous secret immediately. Deploy the new secret to your integration before or during the rotation window, not after.
- Rotation resets
lastUsedto empty until the new secret is used. - Revoked or expired keys cannot be rotated and return
400. Create a new key instead. - Revoke a key that is no longer needed, or that may be exposed, with
POST /v1/api-keys/{id}/revoke.
Permission matrix
Legend:
- Allow: permitted for that caller when the request is authenticated and the plan entitlement is enabled.
- Deny: the caller's JWT role is rejected with
403 Forbidden. - Owned assets only: a
userJWT sees or acts only on records tied to assets it owns. Lists are filtered and other records return not found. - Not accepted: the endpoint requires a JWT, so an API key receives
401 Unauthorized. - Own operations only: the proxy operation or outcome must belong to the same caller that requested it, whether a user or an API key. Other callers receive
404 Not Found.
Organization, members, and billing
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| Invite member | POST /members | Not accepted | Allow | Deny | Deny |
| List members | GET /members | Not accepted | Allow | Deny | Deny |
| Activate member | POST /members/{id}/activate | Not accepted | Allow | Deny | Deny |
| Deactivate member | POST /members/{id}/deactivate | Not accepted | Allow | Deny | Deny |
| Change member access expiry | POST /members/{id}/access-expiry | Not accepted | Allow | Deny | Deny |
| Close organization | POST /v1/organization/close | Not accepted | Allow | Deny | Deny |
| Read current user | GET /me | Not accepted | Allow | Allow | Allow |
| Read organization settings | GET /settings | Not accepted | Allow | Allow | Allow |
| Start checkout (SaaS) | POST /v1/billing/stripe/checkout-session | Not accepted | Allow | Allow | Deny |
| Open billing portal (SaaS) | POST /v1/billing/stripe/portal-session | Not accepted | Allow | Allow | Deny |
| Upload entitlement (enterprise) | POST /v1/entitlement/upload | Not accepted | Allow | Deny | Deny |
API keys
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List API keys | GET /v1/api-keys | api_keys:read | Allow | Allow | Deny |
| Create API key | POST /v1/api-keys | Not accepted | Allow | Deny | Deny |
| Rotate API key | POST /v1/api-keys/{id}/rotate | Not accepted | Allow | Deny | Deny |
| Revoke API key | POST /v1/api-keys/{id}/revoke | Not accepted | Allow | Deny | Deny |
Assets and discoveries
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List assets | GET /v1/assets | assets:read | Allow | Allow | Owned assets only |
| Create asset (also promotes a discovery) | POST /v1/assets | assets:write | Allow | Deny | Deny |
| Update asset | PATCH /v1/assets/{id} | assets:write | Allow | Deny | Deny |
| Delete asset | DELETE /v1/assets/{id} | assets:write | Allow | Deny | Deny |
| List integration presets | GET /v1/integration-presets | assets:read | Allow | Allow | Allow |
| Submit asset discovery | POST /v1/asset-discoveries | asset_discovery:write | Allow | Deny | Deny |
| List asset discoveries | GET /v1/asset-discoveries | assets:read | Allow | Deny | Deny |
| Delete asset discovery | DELETE /v1/asset-discoveries/{id} | assets:write | Allow | Deny | Deny |
Groups
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List groups | GET /v1/groups | groups:read | Allow | Allow | Allow |
| Create group | POST /v1/groups | groups:write | Allow | Deny | Deny |
| Update group | PATCH /v1/groups/{id} | groups:write | Allow | Deny | Deny |
| Delete group | DELETE /v1/groups/{id} | groups:write | Allow | Deny | Deny |
Policies
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List policies | GET /v1/policies | policies:read | Allow | Allow | Owned assets only |
| List policy revisions | GET /v1/policies/{id}/revisions | policies:read | Allow | Allow | Owned assets only |
| Create policy | POST /v1/policies | policies:write | Allow | Deny | Deny |
| Clone policy | POST /v1/policies/{id}/clone | policies:write | Allow | Deny | Deny |
| Update policy | PATCH /v1/policies/{id} | policies:write | Allow | Deny | Deny |
| Change policy activation | PATCH /v1/policies/{id}/activation | policies:write | Allow | Deny | Deny |
| Roll back policy | POST /v1/policies/{id}/rollback | policies:write | Allow | Deny | Deny |
| Delete policy | DELETE /v1/policies/{id} | policies:write | Allow | Deny | Deny |
Decisions
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| Evaluate decision | POST /v1/evaluate | decision:run | Allow | Allow | Owned assets only |
| Proxy evaluate | POST /v1/proxy/evaluate | decision:run | Allow | Allow | Owned assets only |
| Playground decision | POST /v1/playground/decision | decision:run | Allow | Allow | Owned assets only |
| Report proxy outcome | POST /v1/proxy/outcomes | decision:run | Own operations only | Own operations only | Own operations only |
| Read proxy operation | GET /v1/proxy/operations/{operation_id} | decision:run | Own operations only | Own operations only | Own operations only |
Audit, decision explorer, and usage
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| Decision explorer | GET /v1/decision-explorer | audit:read | Allow | Allow | Owned assets only |
| Decision explanation export | GET /v1/decisions/{decision_id}/explanation | Refused | Allow (user JWT) | Refused | Refused |
| Audit log | GET /v1/audit | audit:read | Allow | Allow | Owned assets only |
| Operation detail | GET /v1/audit/operations/{operation_id} | audit:read | Allow | Allow | Owned assets only |
| Outcome coverage | GET /v1/audit/outcome-coverage | audit:read | Allow | Allow | Owned assets only |
| Usage | GET /v1/usage | usage:read | Allow | Allow | Allow |
Approvals
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List approvals | GET /v1/approvals | approvals:read | Allow | Allow | Owned assets only |
| Get approval | GET /v1/approvals/{id} | approvals:read | Allow | Allow | Owned assets only |
| Approve | POST /v1/approvals/{id}/approve | Refused (403, jwt_user_required) | Allow | Deny | Owned assets only |
| Reject | POST /v1/approvals/{id}/reject | Refused (403, jwt_user_required) | Allow | Deny | Owned assets only |
| Revoke | POST /v1/approvals/{id}/revoke | Refused (403, jwt_user_required) | Allow | Deny | Owned assets only |
Webhooks
| Operation | Endpoint | API key | super_admin | billing_admin | user |
|---|---|---|---|---|---|
| List webhooks | GET /v1/webhooks | webhooks:read | Allow | Deny | Deny |
| Create webhook | POST /v1/webhooks | webhooks:write | Allow | Deny | Deny |
| Rotate webhook secret | POST /v1/webhooks/{id}/rotate | webhooks:write | Allow | Deny | Deny |
| Delete webhook | DELETE /v1/webhooks/{id} | webhooks:write | Allow | Deny | Deny |
Notes
- Approve is refused with
403and codeself_approval_forbiddenwhen the approver is the requester. This applies to every role. - Each route also requires its plan entitlement, for example
approvals.enabledorwebhooks.manage. A workspace without the entitlement is refused regardless of role or scope. - Owned-asset filtering applies to the
userrole only.super_admin,billing_admin, andauditorsee all records. - The
auditorrole is not a column in these tables. It is organization-wide and read-only: it may call only theGETroutes listed under auditor, and every other row above returns403withread_only_rolefor it. - Proxy operations and outcomes are bound to the caller that requested them, for every role and API key. Lookups by another caller return
404, so no role can read another caller's operation. - Webhooks are only available when the workspace's approvals capability is enabled, since webhook delivery exists to notify on approval lifecycle events.
- Not listed:
/health,/auth/*, API documentation routes, the Stripe webhook (verified by signature instead of a token),/internal/v1/*operator routes, andPOST /v1/bootstrap.
For detailed request/response examples, see API Reference.