Nevent AI multi-tenant model
Nevent uses a hierarchical tenant model. Nevent AI lets you switch tenants within a session and work with multiple organizations without restarting the connection.
Role-based access model
Section titled “Role-based access model”| Role | What it can see |
|---|---|
SUPERADMIN | All tenants in the system |
OWNER | Their own tenant and all child tenants |
ADMIN | Only their own tenant |
The role of the authenticated user (the JWT used at login) determines which tenants are accessible through nevent_list_tenants.
Basic multi-tenant workflow
Section titled “Basic multi-tenant workflow”Example conversation
Section titled “Example conversation”nevent_switch_tenant contract
Section titled “nevent_switch_tenant contract”When you call nevent_switch_tenant:
- The MCP server calls the tenant-switch endpoint on the Nevent API with
{ tenantId }. - The API validates that the JWT bearer has access to the destination tenant and returns a new access token scoped to the new tenant.
- The MCP server updates the JWT in
DataClient(analytics) andPaidMediaClient(paid media) atomically. - All in-memory caches (capabilities, segmentation criteria) are invalidated — subsequent calls will get fresh data from the new tenant context.
activeTenantIdis updated from thetenantIdclaim in the new JWT.
nevent_reset_tenant contract
Section titled “nevent_reset_tenant contract”When you call nevent_reset_tenant:
- The server reads
homeTenantId— the tenant ID captured from the original JWT when the session was created. - It calls the tenant-switch endpoint with
{ tenantId: homeTenantId }. - Same cache invalidation and JWT rotation as in
nevent_switch_tenant. - If
homeTenantIdis not available (the original JWT had notenantIdclaim), the tool returns an error.
Isolation guarantees
Section titled “Isolation guarantees”- Session scope: the tenant context is per session. Switching tenants in one conversation does not affect any other active sessions from the same user or other users.
- JWT atomicity: JWT rotation is atomic. If the API call fails, neither client (DataClient nor PaidMediaClient) is updated. The active tenant does not change on error.
- Verifiable response: the response from
nevent_switch_tenantincludesactive_tenant_idso the agent can verify the switch completed correctly before continuing.
Segment management tools in multi-tenant
Section titled “Segment management tools in multi-tenant”Segment operations (nevent_list_segments, nevent_get_segment, nevent_create_segment, nevent_update_segment) always operate on the currently active tenant.
If you need to list the segments of a specific tenant:
nevent_help tool
Section titled “nevent_help tool”If the agent has questions about the multi-tenant workflow, it can invoke:
This tool provides in-session contextual guidance on workflows, errors and the multi-tenant model without needing to consult external documentation.