Multi-Tenant Access Control for Self-Hosted AI Agent Platforms
A practical guide to designing multi-tenant permissions for self-hosted AI agent platforms, covering tenants, workspaces, roles, resource isolation, quotas, and auditing. It also outlines the operational capabilities, implementation steps, and pre-launch checks needed to move from building agents to maintaining them securely across teams.
1. The Real Bottleneck: Account-Based Agent Handoffs
Teams building custom enterprise AI agents often face a familiar request: one agent must handle real-time web search, video understanding, transcript generation, image generation, and publishing copy. It may also need to call multiple models in parallel so users can compare their outputs. These capabilities can be assembled technically. The harder problem is maintaining the agent after delivery.
Simply sharing a finished agent often leaves the recipient unable to inspect its prompts or orchestration. Even a minor adjustment—such as changing the tone of a sentence—can require contacting the account owner, obtaining account access, signing in, making the change, and signing out again.
The account owner’s workspace configuration may also be deeply nested, leaving their manager unable to see the delivered application. Sharing knowledge bases and workspace credentials creates another problem: control over data boundaries effectively passes to whoever receives those credentials.
The central lesson is straightforward: an agent platform’s core value is not how elaborate its orchestration canvas looks, but whether it treats multiple users, workspaces, and permissions as first-class capabilities. Once primarily a commercial-edition feature, this governance model is increasingly becoming a baseline requirement for open-source, self-hosted platforms.
2. The Tenant and Permission Model: Four Layers
A governable platform needs at least four layers, with scope narrowing from top to bottom:
- Tenant: The highest-level boundary for resources and billing. Data should not flow between tenants by default.
- Workspace: A subdivision within a tenant, typically organized by business function, such as product or operations. Agents, knowledge bases, prompts, and datasets belong to workspaces.
- Group and role: Groups organize users by department or team; roles define the actions they can perform.
- Resource: Applications, knowledge bases, prompt templates, inference services, tool integrations, evaluation datasets, and fine-tuning jobs.
Three roles usually cover most scenarios:
| Role | Permissions |
|---|---|
| Read-only | Can view and use applications and knowledge bases in the workspace, but cannot edit them |
| Read-write | Can edit applications, prompts, and knowledge bases, but cannot manage members |
| Administrator | Has the highest workspace-level permissions, including member and quota management |
The key principle is that authorization must check both the user’s role and the workspace to which the resource belongs. Checking roles without checking resource ownership is a common source of unauthorized access.
The following illustrative policy is not tied to a specific product:
{"subject": "group:operations","role": "readwrite","scope": "workspace:ws_1024","resources": ["agent", "knowledge_base", "prompt_template"],"deny": ["workspace_settings", "member_invite", "model_endpoint"]}
Authorization middleware can express the decision logic as follows:
def authorize(user, action, resource):# 1. The resource must exist and belong to a workspacews = resource.workspace_id# 2. The user must belong to that workspace; deny cross-workspace access by defaultmembership = db.get_membership(user.id, ws)if not membership:return Deny("not_a_member")# 3. The role's capabilities must include the requested actionif action not in ROLE_CAPS[membership.role]:return Deny("role_insufficient")# 4. Explicit deny rules take precedence over allow rulesif match_deny(membership, action, resource):return Deny("explicit_deny")return Allow()
3. Data and Resource Isolation: A Second Line of Defense
Permissions determine who can act. Isolation determines where data resides and how its boundaries are enforced. An implementation should cover at least five areas:
- Metadata isolation: Tenant, workspace, user, and role tables should carry
tenant_id. Queries must enforce tenant filters rather than relying on individual business-code paths to apply them correctly. Central enforcement in the data access layer helps prevent omissions. - Knowledge base and vector data isolation: Partition document chunks and vector indexes by workspace. Retrieval must use the workspace as the minimum filtering boundary. Deleting a workspace should also remove its associated indexes so residual data cannot appear in search results.
- Object storage isolation: Organize source files under
tenant/workspace/prefixes. Bind signed download links to the appropriate workspace scope and enforce their expiration. - Inference and tool-call isolation: Model service credentials and external tool configurations should be workspace-scoped secrets. Users may reference them but must not see their plaintext values.
- Observability data isolation: Tag invocation logs, evaluation results, and fine-tuning datasets by workspace. Separate log-service and monitoring dashboards by tenant.
4. Quotas, Billing, and Auditing
Once multiple tenants share a platform, resource contention becomes an immediate concern. Three types of quotas are useful:
- Invocation quotas: Limit model and tool calls per workspace or user within a defined period. Queue or reject requests that exceed the limit, preventing one team’s evaluation runs from saturating inference services.
- Storage quotas: Meter knowledge base capacity separately from object storage usage.
- Concurrency quotas: Cap the number of parallel tasks. Multi-model comparisons—for example, running four models at once—should not consume resources needed by other users.
Auditing is essential. At a minimum, record who performed an action, when it occurred, which workspace and resource it affected, what the action was, and whether it succeeded.
Audit logs should be append-only and protected against modification. They should also support workspace-level export to meet enterprise compliance review requirements.
5. Production Readiness: Beyond Building Agents
A production-ready, self-hosted agent platform needs more than visual orchestration. It should also provide:
- Prompt and version management: Manage prompts as independent assets, with versioning and rollback, so changing a sentence does not require repeating the entire handoff process.
- Model integration and evaluation: Provide a unified model gateway that supports parallel model execution and output comparison. Built-in evaluation datasets and metrics give tuning an evidence-based foundation.
- An end-to-end fine-tuning workflow: Connect dataset management, training jobs, and staged deployment.
- Tool and service integration: Support both local in-process tools and remote services, with centrally managed credentials.
- Self-hosted deployment support: Use containerized delivery, externalized configuration, and one-step initialization to reduce operational overhead.
The number of feature modules is not a reliable selection criterion on its own. The decisive governance capabilities are permission granularity, isolation strength, and audit completeness.
6. Implementation Roadmap and Pre-Launch Checklist
A four-step rollout helps establish these foundations:
- Model the boundaries: Map the relationships between tenants, workspaces, groups, and roles, and define the data boundaries.
- Centralize enforcement: Route all resource access through authorization middleware and the data access layer. Eliminate bypass paths.
- Add metering and auditing: Implement quotas and audit logging before opening the platform to multiple teams.
- Establish operating procedures: Standardize workspace requests, membership changes, and access revocation when users leave.
Before launch, verify the following:
- Is direct cross-workspace access denied by default?
- Can a read-only user write data or trigger fine-tuning through an API?
- Are a deleted user’s sessions and temporary credentials invalidated?
- Does workspace deletion also clean up vector indexes and object storage?
- Can a complete audit log be exported for each workspace?
7. Conclusion
The competitive focus of agent platforms is shifting from whether an agent can be built to whether an organization can use it securely.
Making multi-user access and permissions part of the open-source baseline addresses two central enterprise needs: clear data boundaries and efficient collaboration. Versioned prompts, comparative model evaluation, and self-hosted deployment then determine whether the platform can be maintained over time.
Design the tenant and permission model correctly first. Further feature expansion is only meaningful once that foundation is in place.
