Access Control & Identity Architecture

AVAILABLE

Naagmani enforces a comprehensive, multi-tiered authorization and identity architecture with strict separation between human governance, customer directory identities, and machine credentials.


1. Domain Separation Matrix #

Identity DomainEntity / Key PrefixAuthentication / BearerPurpose & Authorization Model
Portal UserUser + OrganizationMembershipHuman JWT session cookie / tokenDynamic RBAC permissions governing Developer Portal management actions.
Customer MemberMember (mbr_...)X-Naagmani-Member-ID headerApplication and customer directory identity for FinOps attribution and spending limits. Cannot log into Portal.
Project Service TokenServiceToken (nm_st_...)Authorization: Bearer nm_st_...Machine-to-machine inference, discovery, and runtime management. Governed by PST capabilities (inference.execute, etc.).
API KeyApiKey (nm_app_...)Authorization: Bearer nm_app_...Application runtime credential scoped to environments and customer member attribution.

2. Dynamic RBAC Domain Model (Phase 2 Foundation) #

Human access control for Developer Portal users is backed by a first-class dynamic RBAC architecture:

text
                    ORGANIZATION
                         |
             +-----------+-----------+
             |                       |
       PORTAL USERS             CUSTOMER MEMBERS
             |                       |
     User + Membership               Member (mbr_...)
             |
    UserRoleAssignment
             |
           Role
             |
       RolePermission
             |
         Permission
             |
      Canonical Registry

Core Entities #

  1. Permission: Platform-defined canonical capability representing a distinct business action (e.g. projects.read, billing.manage).
  2. Role: Organization-scoped container of permissions. Distinguishes between system_defined: true and custom roles.
  3. RolePermission: Join entity linking roles to their authorized canonical permissions.
  4. UserRoleAssignment: Organization-scoped assignment linking a human Portal User (User / OrganizationMembership) to one or more roles.

3. Canonical Permission Registry #

The platform maintains a deterministic, canonical registry of platform capabilities. Permissions are read-only for tenants and seeded automatically during platform initialization.

Resource NamespaceCanonical Permission KeysDescription
organizationsorganizations.read, organizations.manageInspect and manage organization metadata and settings
usersusers.read, users.invite, users.manageList, invite, and administer human Portal User memberships
rolesroles.read, roles.manageInspect canonical permissions and manage organization custom roles
projectsprojects.read, projects.create, projects.update, projects.delete, projects.manageFull lifecycle control over workspaces and projects
environmentsenvironments.read, environments.manageExecution environment tier management
service_tokensservice_tokens.read, service_tokens.create, service_tokens.update, service_tokens.revoke, service_tokens.manageIssue, rotate, and revoke Project Service Tokens
api_keysapi_keys.read, api_keys.create, api_keys.revoke, api_keys.manageApplication API key lifecycle
providersproviders.read, providers.manageBYOK AI provider credentials and latency health probes
billingbilling.read, billing.manageSubscription tiers, payment methods, and invoices
usageusage.readOrganization and project token usage analytics
auditaudit.readImmutable security and unified request audit trails
mcpmcp.read, mcp.manageModel Context Protocol servers, tools, and access policies
policiespolicies.read, policies.manageIntelligent routing policies and fallback hierarchies
membersmembers.read, members.create, members.update, members.delete, members.manageManage customer directory identities and spending limits

4. System Default Roles vs Custom Roles #

Every organization is automatically initialized with three default system roles:

  1. Owner (owner): Assigned all permissions across the canonical registry (organizations.*, users.*, roles.*, billing.*, etc.).
  2. Admin (admin): Administrative permissions for infrastructure, projects, tokens, providers, policies, and members.
  3. Member (member): Read permissions for projects, environments, usage, audit, and basic execution capabilities.

Organization Custom Roles #

Organizations can create custom roles with tailored permission subsets.

  • Tenant Isolation: Custom roles created in Organization A cannot be viewed, updated, or assigned in Organization B.
  • Safety Invariants:
    • Predefined system roles cannot be deleted.
    • Custom roles cannot be deleted while active Portal Users are assigned to them.
    • The final Owner of an organization cannot be stripped of their Owner role.
    • Unknown permission keys are rejected during role creation/update.

5. Security & Isolation Rules #

  • No Machine Credential Conflation: Creating or modifying human Portal Users, roles, or role assignments never generates API keys, PST secrets, or Customer Members.
  • Customer Members Are Outside RBAC: End-user customer members cannot receive human RBAC roles, hold Portal permissions, or authenticate to the portal.
  • Tenant Context: All role and permission evaluations are strictly evaluated within the active organization boundary.

Next Steps #