security
Intended Documentation
Roles and Token Governance
The enterprise role/permission matrix and the API credential lifecycle — create, list, and revoke tenant API keys, with exact scopes, secret handling, and the events ledger.
Roles and Token Governance#
This page covers the two governance levers a tenant administrator controls: who can do what (the enterprise role/permission matrix) and which machine credentials exist (the API credential lifecycle). Both are tenant-scoped, permission-checked, and audited.
Two different vocabularies — keep them apart
Enterprise admin permissions (this page — tokens:manage, members:manage, evidence:export, …) gate the /admin/* console operations. API-key scopes (authority:evaluate, authority:policy:write, intent:create, …) gate the runtime authority API. A credential carries scopes; a person carries an enterprise role. They are resolved and enforced independently.
The role/permission matrix#
There are six enterprise roles. Each resolves to a fixed set of the eleven enterprise permissions. admin is currently equivalent to owner.
| Permission | owner | admin | operator | auditor | reviewer | read_only |
|---|---|---|---|---|---|---|
trust:read | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
audit:read | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
approvals:review | ✓ | ✓ | ✓ | ✓ | ||
tokens:manage | ✓ | ✓ | ✓ | |||
policies:manage | ✓ | ✓ | ✓ | |||
gateway:manage | ✓ | ✓ | ✓ | |||
evidence:export | ✓ | ✓ | ✓ | |||
members:manage | ✓ | ✓ | ||||
tenant:settings:manage | ✓ | ✓ | ||||
identity:manage | ✓ | ✓ | ||||
emergency:invoke | ✓ | ✓ |
What each role is for:
- owner / admin — full tenant control, including member management, identity settings, and emergency actions.
- operator — hands-on runtime operator: policies, gateway, approvals, and credential governance, but no member, identity, or emergency authority.
- auditor — read everything and export evidence, with no mutating authority.
- reviewer — approval-focused, with read-only trust context.
- read_only — trust and audit visibility only.
How your role is resolved
Your enterprise role comes from your explicit per-tenant assignment (tenantMemberRole) when one exists; otherwise it is mapped from your portal role (owner→owner, admin→admin, operator/developer→operator, approver→reviewer, viewer→read_only). API-key actors with no member record resolve to read_only.
API credentials#
Credentials are the intended_live_ API keys your services use to call the runtime (a legacy mrt_ prefix is still accepted on older keys). They are issued, listed, and revoked through /admin/api-tokens, and every lifecycle action is recorded as an event.
List credentials#
Each credential record exposes: id, name, prefix (the first 12 characters of the key, e.g. intended_liv...), environmentKey, scopes[], status (active · revoked · expired), createdBy, createdAt, lastUsedAt, revokedAt, and eventCount. The raw key value is never returned here — only on creation.
Create a credential#
The secret is shown once
The plaintext secret (intended_live_ + 64 hex characters) is returned only in the create response. Intended stores only a SHA-256 hash of it and cannot recover the raw value. Persist it directly into your secrets manager; if it is lost, revoke the credential and issue a new one.
Revoke a credential#
Emergency revocation
For incident response you can also revoke a credential through the token_revoke emergency control, which records the action in the emergency-event ledger as well as the credential-event ledger.
The credential event ledger#
Every create and revoke writes an apiCredentialEvent (eventType: created · revoked · rotated · used) with the acting actorId, environmentKey, a human-readable summary, and createdAt. These events are returned in the events[] array of GET /admin/api-tokens (most recent first) and feed the audit evidence export. They give you a complete, queryable history of credential governance for a tenant.
Failure modes#
| Status | Code | Cause |
|---|---|---|
| 400 | INVALID_ADMIN_API_TOKEN_CREATE_REQUEST | Missing name/environmentKey, empty scopes, or malformed body |
| 400 | INVALID_ADMIN_API_TOKEN_REVOKE_REQUEST / INVALID_ADMIN_ROLES_QUERY | Malformed revoke body or roles query |
| 401 | UNAUTHENTICATED_ACTOR | No resolvable actor on the request |
| 403 | TENANT_MISMATCH | x-tenant-id ≠ body/query tenantId |
| 403 | FORBIDDEN (+ permission: "tokens:manage" or "trust:read") | Role lacks the required permission |
| 404 | ORG_NOT_FOUND | No organization exists for the tenant |
| 404 | CREDENTIAL_NOT_FOUND | The credential id does not belong to this tenant |
Next Steps#
- API Authentication — how keys and scopes are checked at the gate
- Audit Export
- Emergency Controls