Security advisory — Malicious litellm versions 1.82.7 and 1.82.8 were removed from PyPI (potential API key exfiltration). Uninstall them, rotate exposed credentials, and upgrade to a safe release (e.g. 1.82.9+). Run pip show litellm to verify. PyPI · README

RBAC Scopes

A scope is the smallest unit of Enterprise permission. Format: resource:verb.

RBAC Scopes

A scope is the smallest unit of Enterprise permission. Format: resource:verb.

Single source of truth: packages/iam-core/src/scope-registry.ts


Registry

ResourceVerbsExample scope
adminenteradmin:enter — enter the admin console
userread, create, update, delete, manageuser:read
deptread, create, update, delete, managedept:manage
roleread, create, update, delete, managerole:create
auditread, read:all, read:dept, export, manageaudit:read:dept
meteringread, export, managemetering:export
workspaceread, chat, manageworkspace:chat — front-office chat
policyread, create, update, delete, publish, disable, managepolicy:publish
modelread, create, update, delete, managemodel:manage
kbread, create, update, delete, manageKnowledge base (reserved)
automationread, create, update, delete, manageAutomation (reserved)
gatewayread, manageGateway configuration
providerread, create, update, delete, manageModel provider
ssoread, create, update, delete, manageSSO Provider

Special values

ValueMeaning
*Owns every registered scope (super admin)

Functions:

  • expandRoleScopes() — expand *
  • mergeUserScopes() — merge roles and dedupe
  • hasEveryScope() / hasSomeScope() — API route checks

Default seed roles (reference)

db:seed plus optional iam-demo-seed injects demo data. Typical setup:

Role codePurposeTypical scopes
ownerTenant owner* or full manage
adminPlatform adminadmin:enter, IAM, policy, audit:read:all, model:*
securitySecurity auditaudit:read:all, policy:read, metering:read
memberRegular employeeworkspace:chat, workspace:read

Minimum for portal chat: workspace:chat

The default owner already has it; older environments may backfill it via HMR.


Audit visibility

ScopeVisible range
audit:read:allTenant-wide gateway audit
audit:read:deptRecords related to the caller's department
audit:exportExport permission

Note: Using only the legacy scope audit:read may return 403 in department-isolation scenarios. Upgrade to audit:read:dept or audit:read:all.

IAM management audit (audit_events table) is authorized separately from gateway audit; the route layer checks each independently.


API route mapping examples

RouteRequired scope
GET /api/admin/usersuser:read
POST /api/policy/publishpolicy:publish
PUT /api/admin/users/:id/modelsmodel:manage
POST /api/audit/queryaudit:read:all or audit:read:dept
Portal /api/chat/completionsworkspace:chat

See each feature's middleware/rbac.ts and admin route handlers for the actual checks.


Role editor UI

Admin /iam/roles:

  • Scope multi-select comes from ALL_REGISTERED_SCOPES
  • System immutable roles cannot be deleted
  • Saves take effect immediately (scopes inside the JWT update on the next login / refresh)

Adding a new scope

  1. Add the resource/verb to SCOPE_REGISTRY
  2. Call hasEveryScope on the corresponding API route
  3. Update this document and the admin role-template seed
  4. Do not hard-code scope strings in a customer repo without flowing them back into the registry

Related docs

Made-with: Damon Li