Introducing a new way to review your PRs.

Read the announcement

getnao / nao

👾 nao is the #1 open source agentic BI. (1) Create context with nao-core cli, (2) deploy nao chat interface for everyone

View on GitHub

23 documents · Updated Nov 23, 2026

docs / access-and-governance

Identity, access, and governance

The product uses one access model to connect a signed-in identity to organizations, projects, user groups, budgets, roles, and enabled features. Each request is checked in that order so that membership defines the boundary, roles define the main actions, and group policy defines the data and feature access inside a project.

Access model

The access model turns an authenticated user into an effective project policy. The policy combines organization membership, project membership, role checks, group settings, license state, and request scope before a protected action can run.

When a user makes a request, the product follows this path:

flowchart LR
    A[Authenticated identity] --> B[Organization membership]
    B --> C[Selected project]
    C --> D[Project role]
    D --> E[User group policy]
    E --> F[Effective features and data access]
    F --> G[Allowed action or denied request]

The selected organization must belong to the user. Project access normally comes from direct project membership or membership in the project’s organization. The resulting role then controls broad actions, while group policy narrows access to data, tools, files, skills, and product features. See Authentication and SSO for the identity step and Organizations, projects, and entitlements for the organization and project lifecycle.

Request scope

Request scope identifies the organization or project on which an action operates. The service resolves that scope from the signed-in user and the selected resource, then rejects requests that cross a membership boundary.

This check matters for resources that carry their own project identity. Access is not granted only because a caller knows a resource ID; the resource must belong to a project in which the user has a role.

References: apps/…/trpc.ts• L24-32 apps/…/trpc.ts• L103-139 apps/…/trpc.ts• L168-202

Organization governance

An organization is the main tenant boundary for people and projects. Organization membership gives a user a place in the product and can also provide access to projects owned by that organization.

Organization roles are broad governance roles:

RoleMain purpose
adminManage organization members, organization settings, and organization-level access.
userUse the organization within the access granted by projects and groups.
viewerView the organization within the limits of the assigned access.

Organization admins can manage members and sign-in domains. In cloud use, a sign-in domain must be proved through a verified member and cannot already belong to another organization. This prevents one organization from routing another organization’s users into its tenant.

Organization membership

Membership is shared across the organization’s projects. A member can therefore receive access to a project from the organization without a separate project membership, while a direct project membership can give a project-specific role.

The product keeps account-wide user data separate from organization authority. An admin cannot change another member’s shared account data when that account also belongs to another organization; the user must manage that data themselves.

References: apps/…/organization.ts• L1-3 apps/…/organization.routes.ts• L24-39 apps/…/organization.routes.ts• L41-103 apps/…/organization.routes.ts• L196-228 apps/…/trpc.ts• L267-285

Identity provider governance

Single sign-on (SSO) can map identity-provider groups to organization roles and project user groups. When this mapping is active, the identity provider owns the mapped organization role, so local organization settings cannot override it.

The mapping is applied during sign-in. A changed group claim affects the user at a later sign-in, while a missing or unverifiable claim leaves the current role unchanged. The system also protects the last organization admin from automatic demotion.

References: apps/…/sso-login-sync.service.ts• L7-37 apps/…/sso-group-mapping.service.ts• L21-27 apps/…/sso-group-mapping.service.ts• L44-91 apps/…/sso-group-mapping.service.ts• L187-220

Project access

A project is the working boundary where users access data, conversations, tools, files, skills, and settings. The project role is the first product-level decision after membership and provides the broad action set for the request.

Project access can come from three sources:

  • A direct project membership with a project role.
  • Organization membership inherited by a project owned by that organization.
  • A designated open project that grants signed-in users viewer access without a membership record.

When both direct and organization membership exist, the direct project role is the effective role. Project access views also show whether access comes from the project, the organization, or both. The cloud system example project is an open project and is kept out of the normal project list.

Self-hosted instances can serve more than one project when multiple project paths are configured and the Enterprise multi-project feature is licensed. The project list then includes only active served paths; without that feature, only the default path is active. Project selection uses an explicitly selected accessible project first. If that selection is stale, a normal read falls back to the configured default or the first available project, while a write rejects the inaccessible selection instead of using that fallback.

The project role set includes admin, context_admin, user, and viewer. Admins manage project settings. Context admins can manage observability surfaces while using the product as regular users. Users can perform normal work. Viewers are limited to read access for protected actions.

Project role checks

Protected operations use role checks that match the risk of the action. Read access only needs project membership. Sending, changing settings, managing groups, and managing budgets require stronger roles or a group grant for the relevant area.

The same project check applies when a request names a child resource. This keeps project data from being exposed through an otherwise valid resource identifier. Project lists return each user’s effective role, while access views distinguish direct and inherited access for administrators.

Self-hosted project queries hide paths that the instance no longer serves unless an internal cleanup view explicitly includes inactive projects. This keeps a lapsed license or removed path from exposing a project through normal selection or access lists.

References: apps/…/project.queries.ts• L186-249 apps/…/project.queries.ts• L268-359 apps/…/multi-project.service.ts• L7-21 apps/…/project-paths.ts• L3-11 apps/…/open-projects.ts• L5-11 apps/…/project.routes.ts• L213-235 apps/…/project.routes.ts• L1004-1013 apps/…/trpc.ts• L131-166 apps/…/trpc.ts• L205-236

User group policy

A user group is a project-level policy set that narrows what its members can do and see. Group membership can be assigned directly or supplied by an identity provider, which lets administrators keep access rules in one place while still using external groups.

The effective policy can control:

  • Product features such as story creation and automation creation.
  • Warehouse data and row-level filters.
  • Project documents and files.
  • MCP servers and tools.
  • Project skills and preloaded skills.
  • Sharing with the whole project, selected groups, or selected members.
  • Tool-call density and visibility of advanced settings.

The policy is resolved for the current user and project. The agent receives the same restrictions, so a feature that is unavailable in the application is not offered through the agent instead.

Feature entitlements

An entitlement is permission to use a product capability. User group features and product license features work together: the group can grant a capability only when the product makes that capability available, and the request still passes the user’s role and project checks.

Custom groups that exceed the free-plan allowance become locked when the required license is not active. Their saved settings remain available for later reactivation, but locked groups cannot grant current access or be assigned to users.

References: apps/…/user-group-feature-access.service.ts• L19-35 apps/…/user-group-feature-access.service.ts• L49-104 apps/…/user-group-context-access.service.ts• L34-70 apps/…/user-group-availability.service.ts• L46-68 apps/…/user-group-availability.service.ts• L71-103

Project sharing policy

Project sharing is a second access decision inside a project. It controls who can receive a shared chat, story, or automation after the recipient already has project access. Project admins can share with the whole project, while other users can share only with members and custom groups allowed by their active user groups.

The sharing audience combines direct and identity-provider group membership with the project access list. A group change can therefore narrow future sharing and also make existing project-wide shares invalid; the product can preview and revoke those shares for chats, stories, and automations.

References: apps/…/project-sharing.service.ts• L42-99 apps/…/project-sharing.service.ts• L101-120 apps/…/project-sharing.service.ts• L145-193 apps/…/project-sharing.service.ts• L195-228 apps/…/project.queries.ts• L279-320

Budget governance

Budgets limit usage at the project and member levels. Project budgets can apply to model providers, while member budgets can use the default project limit, a user-group limit, or a personal limit for a user.

The product checks the effective limits while work is requested. It reports warning status as usage approaches a limit, notifies the relevant people when a limit is reached, and blocks further work when the applicable project, provider, or member budget is exceeded.

Budget management follows the same governance boundary as other project settings. Project admins manage provider budgets, and member budgets are available only when the required licensed feature is active.

Budget scope

Budget scope separates shared spend from individual control:

ScopeGovernance purpose
Project or providerControl shared model spend for a project.
Default memberSet a common limit for project members.
User groupApply a limit to members of a group.
PersonalGive one member a specific limit.

References: apps/…/budget.ts• L101-170 apps/…/member-budget.service.ts• L24-45 apps/…/member-budget.service.ts• L111-143 apps/…/budget.routes.ts• L25-59 apps/…/member-budget.routes.ts• L24-68

Governance boundaries

Governance controls keep administrative actions inside the correct tenant, project, role, and license boundary. They also keep configuration-driven access from silently widening when a license, identity claim, or group setting changes.

The main boundaries are:

  • Organization admins manage organization membership and organization settings.
  • Project admins manage project members, groups, budgets, and project settings.
  • Context admins manage the additional observability surfaces assigned to that role.
  • User groups narrow access after the project role is known.
  • License state can disable features, groups, or row-level security access.
  • SSO mappings can make the identity provider the source of truth for roles and group membership.

This layered model lets the product apply a broad tenant rule first and a narrow feature rule later. It also makes a denial meaningful: a user can be a valid member and still lack the role, group grant, license, or budget needed for one action.

Protected administration

Administrative routes check the organization or project role before they read or change governance data. Advanced settings add a group-based condition for users who are not project admins, so a normal project user cannot reach sensitive settings merely by having project access.

References: apps/…/organization.routes.ts• L34-39 apps/…/user-group.routes.ts• L234-260 apps/…/trpc.ts• L205-236 apps/…/budget.routes.ts• L21-59 apps/…/project.routes.ts• L1004-1013

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep organization role names aligned between local membership, SSO mappings, and every role guard.
  • Keep direct project membership and organization membership aligned when changing project selection, effective roles, or access-source reporting.
  • Keep open-project exceptions aligned with project listing, resource access, and viewer permissions.
  • Keep self-hosted configured paths, active-path filtering, license state, project selection, and cleanup access aligned.
  • Keep accessible-project fallback behavior separate for reads and writes so a stale selection cannot redirect a write to another project.
  • Keep user-group feature grants aligned with the agent restrictions so the same capability is not available through a second entry point.
  • Keep group share targets aligned with project access, active group membership, and revocation of existing project-wide shares.
  • Keep license checks aligned with group availability, row-level security, and budget routes.
  • Keep budget resolution aligned across provider budgets, member budgets, spend checks, and limit notifications.
  • Keep domain ownership checks aligned with sign-in routing so one organization cannot claim another organization’s domain.

Important failure modes

TriggerConsequenceGuard
A request selects an organization or project where the user has no membership.The request is rejected before the protected action runs.Scope resolution checks the user’s membership.
A write targets a project that was selected before the user lost access.The write is rejected instead of using another accessible project as a fallback.Project lookup disables inaccessible-project fallback for writes.
An organization role mapping is active and an admin tries to edit a mapped role locally.The role change is denied because the identity provider is authoritative.Organization role edits check SSO mapping state.
An SSO group claim is missing or cannot be verified.The current organization role stays in place.Role sync leaves roles unchanged and records the problem.
A self-hosted project path is removed or a multi-project license lapses.The affected project is hidden from normal project lists and selection.Active project paths are limited to configured paths covered by the license.
A group loses availability because its license is inactive.The group cannot grant access or receive new assignments.Group availability filters locked groups.
A group no longer allows project-wide sharing.Its users may keep project access but cannot create new project-wide shares, and existing unauthorized shares can be removed.Sharing resolves the active group policy and revokes unauthorized chats, stories, and automations.
A provider, project, or member budget reaches its limit.Work is blocked and the relevant budget notice can be sent.Budget checks run before the work continues.
Automatic SSO role sync would demote the last organization admin.The demotion is skipped.The organization must retain at least one admin.

Key files

FileWhy to read it
apps/…/trpc.tsShows the shared request scope and role gates used by protected operations.
apps/…/organization.routes.tsShows organization membership, domain ownership, and organization administration.
apps/…/project.queries.tsShows how direct project access, organization access, open-project access, effective roles, active self-hosted projects, safe project selection, and project-access recipients are resolved.
apps/…/multi-project.service.tsShows how the Enterprise license determines which self-hosted project paths are active.
apps/…/project-paths.tsShows how configured self-hosted paths and the default project are selected.
apps/…/open-projects.tsShows which projects can grant signed-in users viewer access without membership.
apps/…/project.routes.tsShows how project lists and access views expose effective roles and access sources.
apps/…/user-group-feature-access.service.tsShows how group policy becomes effective features and settings access.
apps/…/user-group-context-access.service.tsShows how group policy reaches data, file, tool, and skill access.
apps/…/project-sharing.service.tsShows how group policy limits sharing audiences and removes unauthorized project-wide shares.
apps/…/sso-group-mapping.service.tsShows how identity-provider groups govern organization roles.
apps/…/budget.tsShows how usage checks warn and stop work at budget limits.
apps/…/member-budget.service.tsShows the member and group budget model.