Multi-Tenancy and Permission Practices for Open-Source Local Agent Platforms
This article explains how to build multi-tenant access control in an open-source, self-hosted AI agent platform. It covers the collaboration gaps in agent delivery, four core capabilities an enterprise agent platform needs, a resource-level permission model that moves from shared accounts to least privilege, knowledge base and prompt governance, model integration and evaluation, and a four-step implementation roadmap.
1. Background: The Collaboration Gap in Custom Agent Delivery
When delivering agent projects for enterprises, the biggest obstacle is rarely model quality. It is the missing collaboration and governance chain. A typical requirement combines real-time web retrieval, video content understanding, speech transcription, image generation, and publish-ready copywriting. It may also require calling multiple models in parallel to compare output quality across them. For the platform, this shifts the bar from “can it run one workflow?” to “can multiple people and roles maintain it over the long term?”
There are usually two traditional approaches. One is a cloud-hosted agent builder service. The other is a privately deployed open-source workflow platform. Both come with constraints.
Cloud services often tie knowledge base and workspace quotas, along with the account system, to the purchasing tier. This makes it hard for external collaborators to participate under least privilege. A privately deployed workflow platform is more controllable, but open-source editions often place user management, permission separation, and billing allocation in the commercial version. As a result, every small prompt tweak by the delivery team turns into a cycle of “request an account, log in, edit, log out.” Both delivery efficiency and security suffer.
2. Core Requirements: Four Capabilities of an Enterprise Agent Platform
Abstracted from these pain points, four foundational capabilities emerge. They also serve as a general yardstick for evaluating any local agent platform, including Baidu AI Cloud related solutions:
- Identity and permission governance: Layered management of teams, users, and user groups, with differentiated authorization at read-only, read-write, and administrator levels.
- Resource isolation: Across workspaces and tenants, applications, knowledge bases, model services, and runtime data remain invisible to one another.
- Visual orchestration and component completeness: A rich enough set of node types (such as flow control, knowledge retrieval, tool calls, code execution, and human confirmation) to lower the barrier for non-developers.
- Operability: Version control for prompts and knowledge bases, auditable calls, model evaluation, and support for fine-tuning and private inference service integration when needed.
3. Permission Model Design: From Shared Accounts to Least Privilege
The key to multi-tenancy is not merely having user management. Permissions must reach resource granularity. The recommended hierarchy is team → workspace → user group → user, with three permission levels:
| Role | App Orchestration | Knowledge Base | Member Management | Run Records |
|---|---|---|---|---|
| Read-only | View/run | View | None | View |
| Read-write | Edit/publish | Add/delete/edit | None | View |
| Admin | All | All | Add/delete/edit | Export/audit |
Illustrative permission check logic (pseudocode):
def can(action, user, resource):ws = resource.workspaceif user.role_in(ws) == "admin":return Trueif action in ("read", "run"):return resource.is_visible_to(user.group)if action in ("write", "publish"):return user.role_in(ws) == "rw" and resource.is_visible_to(user.group)return False
Three points matter in practice. First, default to deny: new resources are not shared by default. Second, create groups by department (product, operations, algorithms). The group is the authorization unit, which avoids per-person configuration. Third, give external collaborators only read-write access within a limited workspace. They can edit prompts but cannot see other business data.
4. Knowledge Base and Prompt Governance
In a multi-tenant environment, the knowledge base is the asset most prone to privilege overreach. The recommendations are:
- Tag documents with business labels at ingestion, and filter by tag at the retrieval layer.
- Put prompts under version control, keep a change trail, and support rollback.
- For frequent tweaks such as “the tone is off,” let the business side handle them self-service within read-only or read-write permissions, while the delivery team only reviews. This removes the account round-trip cost.
5. Model Integration and the Evaluation Loop
The platform should support both private inference services and remote model services, and run multiple models in parallel on the same task for comparison. The engineering recommendation is to fix an evaluation set and scoring dimensions (accuracy, format compliance, citation completeness, latency) and use the evaluation results as a release gate. Only consider fine-tuning if the results fall short, avoiding the blind investment of “fine-tune first, evaluate later.”
6. Implementation Roadmap and Summary
The recommended path has four steps. First, set up workspaces and user groups. Second, migrate the knowledge base and apply tags. Third, orchestrate the main workflow with human confirmation nodes. Finally, connect monitoring, alerting, and call auditing.
The overall principles are: platformize capabilities, minimize permissions, and make changes traceable. With these three in place, an agent can evolve from a one-off demo into digital productivity that an enterprise can operate sustainably.
