# Multi-tenancy (https://docs.neuralisapp.com/enterprise/multi-tenancy)

The project is the tenancy boundary in Neuralis. Think of it as a department:
its own members and roles, agents, conversations, filesystem sources, package
enablement and spending limits. One instance serves many such teams, each
project's data lives in its own directory tree, and nothing is shared across
projects unless an admin configures it at platform scope. The boundary holds
for *inference* too: to a non-member, a project's resources do not merely
refuse access; they do not appear to exist.

## Membership and roles [#membership-and-roles]

A project stores its members with their role in **this** project, so the same
user can be an `owner` in one project and a `viewer` in another. Only roles with
the invite capability add members, nobody can hand out a role stronger than
their own (see [Roles](https://docs.neuralisapp.com/enterprise/roles.md)), and a project can never be edited
into an ownerless state.

## Isolation guarantees [#isolation-guarantees]

- **Every operation is scoped.** Routes and tools run against the
  authenticated user and project (and optional agent); the project is derived
  from the verified session, never trusted from request parameters.
- **Non-members cannot infer existence.** A non-member gets no metadata about
  a project: not its packages, widgets, skills, sources, agents or runs.
  Workspace snapshots are filtered on the server before they leave the host.
- **Members read a feature-keyed view.** Inside a project, other members'
  emails, other roles' grant lists and other members' spend caps each need
  their own read feature. Everyone sees their own row, role and cap.
- **Revocation applies mid-stream.** The host re-checks membership on every
  call an agent's skill makes, so a member removed while an agent runs loses
  access on the next call, not at the next login.
- **Data is physically separated.** Each project's files, agents,
  conversations and source configurations live under its own directory; vector
  memory is partitioned by project-scoped sources.

These are layers two and three of the [security model](https://docs.neuralisapp.com/enterprise/security.md).

## Notifications [#notifications]

When something a person should hear about happens outside a live
conversation (a workflow run finishes or fails, a workflow is paused, a source
stops syncing), the platform records a notification for the people it concerns,
by default the workflow's creator or the source's owner. Packages declare these
[events](https://docs.neuralisapp.com/package-system/events.md); the history, unread counts and settings are a
platform service.

- **Per project, per person.** A member's history lives inside that project's
  data tree and is removed with the project.
- **A signal, never content.** A notification carries ids, a title and a fixed
  status, never an error message, transcript or path.
- **Checked again on every read**, so a member who loses access stops seeing
  its notifications.
- **Personal settings.** A member can mute an event type, or follow one they
  are not addressed by; following never widens what they may see.

Members see count badges on dock entries and the Inbox in the account menu
(see [the workspace](https://docs.neuralisapp.com/getting-started/workspace.md)). Two platform settings bound
the history: `notificationsMaxRowsPerUser` (500 per member per project) and
`notificationsRetentionDays` (30). A member can clear their own notifications
at any time.

## Per-project limits [#per-project-limits]

Each project carries USD spend limits, edited from the Admin widget's Limits
tab. Every rule sets an amount and one period (daily, weekly or monthly, UTC
calendar windows):

- a project-wide total;
- per-role, per-user and per-agent caps;
- an optional per-minute limit on provider calls.

The most specific limit applies, checked user → role → agent, **and the
project total is always enforced on top**; an unset limit means unlimited at
that level. The per-minute limit counts provider calls (one per step,
subagents included); reaching it makes the turn wait for the next minute with a
countdown rather than fail.

Tightening a cap is open to anyone who can reach the write; **loosening or
removing one requires strength**: a strictly stronger role than the row's target
for role and user caps, and admin strength for the project total and agent rows.
Looser versus tighter is judged on the day-normalized rate.

Spend is estimated from the model catalog's list rates, so for any priced
model a cap closes at or before the money is actually spent. The check runs
before every step of a turn, turns running side by side see each other's spend
as it happens, and a raised cap applies from your next message. A cap reached
mid-answer stops the turn with a banner naming the limit, its amount and its use.
A stopped answer is still charged for what the provider already read. Auxiliary
calls (titles, summaries, prompt polish) count toward the totals;
subscription-priced models sit outside the caps. Non-LLM API spend, embeddings
included, is governed by per-credential use limits (calls per period, see
[Credentials](https://docs.neuralisapp.com/package-system/credentials.md)), and embedding also has its own
platform-wide daily dollar cap, `embeddingDailyUsdCap`.

## Creating projects [#creating-projects]

Each project is a new tenant, so creating one is privileged:

- **Owner strength only.** Only a user who holds an owner-strength role in at
  least one existing project may create one. The first project is provisioned
  during setup.
- **An instance-wide cap.** The *Max Projects* setting bounds the total number
  of projects (`0` = unlimited). It is checked only after the creator is
  authorized, so an unauthorized caller never learns the count.

Creation happens from the Admin widget's **Projects** tab and is audited.

## Deleting projects [#deleting-projects]

Removing a tenant is a **two-stage, owner-strength** operation (a role at
priority 1 in that project; the creator field grants nothing):

- **Archive.** The project is hidden and disabled: members lose access and its
  scheduled workflows stop running and spending. Nothing is erased, and an
  archived project can be restored exactly as before.
- **Delete permanently.** Only an archived project can be deleted, behind a
  typed-name confirmation. This removes its virtual desktops with their browser
  profiles, its vector memory, its data tree, its source configurations and its
  project- and agent-scoped credentials. If a desktop or the vector store
  cannot be cleaned up, nothing else is removed and the deletion can be retried.
  A deleted project's id is never reused. **External and mounted source content
  is never touched**, and user- or platform-scoped credentials stay.

Both stages are audited.

## Per-project packages [#per-project-packages]

Each project can install its own packages into its `_packages/` directory, a
separate trust class from the builtin packages:

- they load **untrusted** and run sandboxed;
- a member who can manage packages can raise one to `trusted`, per project,
  never globally;
- a project package can never shadow a loaded builtin package's id;
- packages are keyed by their owning project, user or agent, so two tenants'
  same-named packages never collide or substitute each other;
- a disabled package disappears from agents' context and tool lists.

See [the package system](https://docs.neuralisapp.com/package-system.md).

## Agent scoping [#agent-scoping]

Agents belong to a project, and access to them is part of the role: `*` (all
agents), `own` (agents the user created or is assigned to) or `view`. An
explicit assignment in the project record takes precedence over the agent's
recorded creator, so an agent you create is yours straight away until someone
assigns it. Provisioning is priority-gated like any role assignment, so a member
cannot create an agent with admin-strength identity. A project also has a
maximum number of agents that bounds every way a person or agent creates one.
Each agent has its own data zone, conversation history and, optionally, its own
credentials, the most specific scope in the
[credential resolution chain](https://docs.neuralisapp.com/package-system/credentials.md).