← Back to Dashboard

Multi-Tenant Guide

Comprehensive guide to managing client organizations, data isolation, billing, and org-scoped agent deployments.

On This Page

Overview

AgenticMail Enterprise supports multi-tenancy — the ability to serve multiple client organizations from a single installation. Each organization gets its own agents, policies, knowledge base, and billing, while you maintain centralized control as the platform operator.

This is ideal for agencies, MSPs, and enterprises that deploy AI agents for multiple clients or departments.

Key Concepts

ConceptDescription
OrganizationA client tenant — has its own slug, agents, billing rate, and contact info
Agent AssignmentAgents are linked to organizations. An agent serves one org at a time.
User BindingDashboard users can be bound to an org, restricting their view to that org's data
Org Context SwitcherAdmins/owners can switch between org views without logging out
Per-Agent BillingEach org has a default rate per agent/month, with optional per-agent overrides

Architecture

The multi-tenant system works through organization-scoped data access. Here's how the layers interact:

┌─────────────────────────────────────────────┐
│              Platform Owner                  │
│  (sees all orgs, full admin access)          │
├─────────────────────────────────────────────┤
│  Org: AgenticMail        │  Org: TechStart Inc   │
│  ├── Agent: Sales Bot  │  ├── Agent: Support│
│  ├── Agent: HR Helper  │  ├── Agent: Ops    │
│  ├── Policies (scoped) │  ├── Policies      │
│  ├── Knowledge Base    │  ├── Knowledge Base│
│  └── Billing: $50/agent│  └── Billing: $75  │
├─────────────────────────────────────────────┤
│  User: alice@acme.com  │  User: bob@globex  │
│  (locked to Acme)      │  (locked to Globex)│
└─────────────────────────────────────────────┘

Managing Organizations

Creating an Organization

  1. Go to Organizations in the dashboard
  2. Click New Organization
  3. Fill in the details:
  4. Click Create

Organization Lifecycle

ActionEffect
Activate/DeactivateToggle an org active or inactive. Inactive orgs' agents stop operating.
EditUpdate name, contact info, description, billing rate.
DeletePermanently remove. Only allowed when no agents are assigned.
Slugs are permanent. Once created, an organization's slug cannot be changed. Choose carefully.

Agent Assignment

Agents are assigned to organizations from the organization detail view:

  1. Click an organization card to open its detail modal
  2. In the Agents tab, use the dropdown to select an agent
  3. Click Assign

Assigned agents are listed with their name, email, status, and an Unassign button.

How Assignment Works

Bulk assignment: To assign multiple agents, repeat the select → assign flow. Each assignment is immediate.

User → Org Binding

Dashboard users can be bound to a specific organization via the Users page permission editor:

Setting Up a Client User

  1. Go to Users in the dashboard
  2. Create or edit a user
  3. In the Permission Editor, set their Client Organization to the appropriate org
  4. Configure which pages they can access (e.g., give them access to Agents and Knowledge, but not Settings)
  5. Save permissions

When this user logs in, the org switcher will be locked to their organization — they see a "Locked" badge and cannot switch to other orgs.

Permission Levels

RoleOrg SwitcherData Access
OwnerFree switchingAll organizations
AdminFree switchingAll organizations
User (unbound)Free switchingBased on page permissions
User (org-bound)Locked to their orgTheir org's data only

Org Context Switching

The Org Context Switcher appears at the top of multi-tenant-aware pages (Guardrails, Knowledge, Agents, etc.). It lets admins and owners view data as if they were in a specific organization.

How It Works

The org context is passed to all API calls on that page — agents, policies, knowledge entries, and interventions are all filtered to the selected org.

Data Isolation

Each organization's data is logically isolated:

Data TypeIsolation Method
AgentsAssigned to specific org via client_org_id
PoliciesScoped by orgId — each org has its own policy set
Knowledge BasePartitioned by org — agents only access their org's knowledge
Agent MemoryPer-agent, inherits org scope from the agent's assignment
InterventionsLogged per org for audit trails
Billing RecordsPer org, per agent, per month
Skills/IntegrationsCredentials can be org-scoped or agent-scoped
Data isolation is logical, not physical. All orgs share the same database. Access control is enforced at the application layer through org ID filtering on every query.

Billing & Cost Tracking

The billing system tracks revenue (what you charge clients) against cost (token usage). Access billing from the organization detail modal's Billing & Costs tab.

Setting Rates

Billing Dashboard

The billing tab shows:

How Costs Are Calculated

Token costs are calculated using the model pricing configured in Settings → Models. Each agent's token usage (input + output) is multiplied by the per-million-token price for the model they used.

Monthly Revenue  = agent_count × billing_rate_per_agent
Monthly Cost     = Σ (input_tokens × input_price + output_tokens × output_price) / 1,000,000
Margin           = (Revenue - Cost) / Revenue × 100%

Knowledge Partitioning

Each organization has its own knowledge base. When you use the Org Context Switcher on the Knowledge page, you see only that org's documents and data.

Shared knowledge: If you need some knowledge available to all orgs, create it under the default (owner) org and ensure cross-org agents can access it. Most deployments keep knowledge strictly partitioned.

Org-Scoped Guardrails

The Guardrails system is fully org-aware:

Use the Org Context Switcher on the Guardrails page to manage each org's policies independently.

Best Practices

Troubleshooting

IssueSolution
User can't see org switcherOrg switcher only appears when client orgs exist. Create at least one organization.
User sees wrong org's dataCheck the org switcher selection. If the user is org-bound, verify their clientOrgId in User permissions.
Can't delete organizationUnassign all agents first. Orgs with assigned agents cannot be deleted.
Agent not appearing in orgVerify the agent was assigned via the org detail modal. Check the agent isn't assigned to a different org.
Billing shows $0 revenueCheck that the org has a billing rate set and agents are assigned. Revenue = rate × agents.
Client user sees all orgsThe user's role is owner or admin, which overrides org binding. Set their role to "user" for org-locked access.
Org switcher shows "Locked"This is correct — the user is bound to a specific org. Only owners/admins can switch freely.
Token costs not matchingVerify model pricing in Settings → Models. Costs are calculated using configured per-million-token prices.

Related Pages

AgenticMail Enterprise — Multi-Tenant Guide

AgenticMail Enterprise Documentation Report an issue