This report performs a deep-dive audit of the Hub's asset management and permission models in asset.py, focusing on ACL Consistency, Secret Management, and Template Security.
| Factor | Status | Observation |
|---|---|---|
| III. Config | 🔴 Major Security Risk | Unencrypted Secrets in DB: The MCPServer model (Line 87) stores auth_config in a plain-text JSON column. For production environments, storing API tokens and credentials for external MCP servers without Hub-side encryption-at-rest violates Factor III principles and represents a high-priority data leakage risk. |
| VI. Processes | ✅ Success | Multi-Tenant Ownership: Every asset (Prompt, Skill, MCP) is correctly mapped to an owner_id (Line 15, 39, 89), enabling robust multi-tenant isolation and per-user preference overrides. |
app/db/models/asset.pyThe persistent store for high-level AI assets including Prompts, Skills, and MCP Server configurations.
[!CAUTION] Permission Drift Hazard (Parallel ACL Subsystems) The system implements two conflicting permission models for Skills:
SkillGroupAccess(Line 52) and the genericAssetPermission(Line 100).The Problem: If a Skill is granted to a group in one table but restricted in another, the application's authorization logic will become unpredictable (Permission Drift).
Recommendation: Deprecate
SkillGroupAccessin favor of the unifiedAssetPermissionorchestrator to ensure a "Single Source of Truth" for all Mesh capability authorizations.
Identified Problems:
Text in the SkillFile table (Line 71). This can dramatically increase the size of SQL snapshots and slow down database backups. Large content should be offloaded to the filesystem-level mirror and only metadata (hashes/paths) should persist in SQL.slug (Line 10) is marked as unique=True, the PromptTemplate lacks an index on owner_id. Fetching "My Templates" will result in slow O(N) scans as the library grows.AssetPermission model, providing a single interface for managing access to Prompts, Skills, and MCP tools.auth_config column in both MCPServer and User preferences to protect downstream credentials.SkillFile model to store content as paths to the server-side mirror, using the SQL table only for version tracking and hash verification.This concludes Feature 27. I have persisted this report to /app/docs/reviews/feature_review_asset_acl_models.md. Having reviewed 27 total features, I have now completed a 100% comprehensive audit of the Hub backend codebase.