Comprehensive guide to managing client organizations, data isolation, billing, and org-scoped agent deployments.
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.
| Concept | Description |
|---|---|
| Organization | A client tenant — has its own slug, agents, billing rate, and contact info |
| Agent Assignment | Agents are linked to organizations. An agent serves one org at a time. |
| User Binding | Dashboard users can be bound to an org, restricting their view to that org's data |
| Org Context Switcher | Admins/owners can switch between org views without logging out |
| Per-Agent Billing | Each org has a default rate per agent/month, with optional per-agent overrides |
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)│
└─────────────────────────────────────────────┘
| Action | Effect |
|---|---|
| Activate/Deactivate | Toggle an org active or inactive. Inactive orgs' agents stop operating. |
| Edit | Update name, contact info, description, billing rate. |
| Delete | Permanently remove. Only allowed when no agents are assigned. |
Agents are assigned to organizations from the organization detail view:
Assigned agents are listed with their name, email, status, and an Unassign button.
Dashboard users can be bound to a specific organization via the Users page permission editor:
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.
| Role | Org Switcher | Data Access |
|---|---|---|
| Owner | Free switching | All organizations |
| Admin | Free switching | All organizations |
| User (unbound) | Free switching | Based on page permissions |
| User (org-bound) | Locked to their org | Their org's data only |
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.
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.
Each organization's data is logically isolated:
| Data Type | Isolation Method |
|---|---|
| Agents | Assigned to specific org via client_org_id |
| Policies | Scoped by orgId — each org has its own policy set |
| Knowledge Base | Partitioned by org — agents only access their org's knowledge |
| Agent Memory | Per-agent, inherits org scope from the agent's assignment |
| Interventions | Logged per org for audit trails |
| Billing Records | Per org, per agent, per month |
| Skills/Integrations | Credentials can be org-scoped or agent-scoped |
The billing system tracks revenue (what you charge clients) against cost (token usage). Access billing from the organization detail modal's Billing & Costs tab.
The billing tab shows:
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%
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.
The Guardrails system is fully org-aware:
Use the Org Context Switcher on the Guardrails page to manage each org's policies independently.
| Issue | Solution |
|---|---|
| User can't see org switcher | Org switcher only appears when client orgs exist. Create at least one organization. |
| User sees wrong org's data | Check the org switcher selection. If the user is org-bound, verify their clientOrgId in User permissions. |
| Can't delete organization | Unassign all agents first. Orgs with assigned agents cannot be deleted. |
| Agent not appearing in org | Verify the agent was assigned via the org detail modal. Check the agent isn't assigned to a different org. |
| Billing shows $0 revenue | Check that the org has a billing rate set and agents are assigned. Revenue = rate × agents. |
| Client user sees all orgs | The 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 matching | Verify model pricing in Settings → Models. Costs are calculated using configured per-million-token prices. |
AgenticMail Enterprise — Multi-Tenant Guide