Back to blog

Building Multi-Tenant AI Safety: Architecture Patterns for SaaS Platforms

EngineeringUMAIDEC 18, 2024READ TIME: 11 MIN
Tenant Isolation

Engineering · UMAI Blog

ÖB

Özer Batu Kargılı

Co-Founder & CTO

The Multi-Tenancy Challenge

When you are building a SaaS platform that includes AI features, you face a unique challenge: every customer has different security requirements, compliance obligations, and risk tolerances. A healthcare customer needs HIPAA-compliant PII detection. A financial services customer needs real-time blocking of investment advice. A government customer needs sovereign data processing with no external API calls.

Building a separate guardrail system for each customer does not scale. Treating all customers the same does not work either. You need multi-tenant AI safety — isolated policy enforcement on shared infrastructure.

This post covers the architectural patterns we developed at UMAI to solve this problem.

Architecture Overview

UMAI's multi-tenant architecture has three core design principles.

1. Policy Isolation

Every tenant (organization) in UMAI has a completely isolated policy namespace. Tenant A's policies cannot reference, affect, or even see Tenant B's policies. This isolation is enforced at the database level, the API level, and the policy evaluation engine level.

Concretely, this means:

  • Separate policy storage: each tenant's policies are stored in a logically isolated partition with tenant-scoped encryption keys.
  • Separate evaluation contexts: when UMAI evaluates a request, the policy engine loads only the requesting tenant's policies. There is no global policy state that could leak between tenants.
  • Separate audit trails: each tenant's audit log is independently hash-chained. Tenant A's audit chain is cryptographically independent of Tenant B's.

2. Shared Compute, Isolated Data

UMAI uses a shared-compute model for the core detection engine. The prompt injection classifier, PII detector, and content safety models are shared across tenants — they do not contain tenant-specific data and do not learn from individual tenant traffic.

But the policy evaluation layer, audit storage, and configuration are strictly isolated. This gives us the cost efficiency of shared infrastructure with the security properties of dedicated deployments.

For customers who require dedicated infrastructure, UMAI supports single-tenant deployments on private cloud or on-premises — but the multi-tenant architecture is the default and handles the vast majority of enterprise requirements.

3. Hierarchical Policy Inheritance

Most enterprises do not want to configure every policy from scratch. UMAI supports policy inheritance:

  • Organization-level policies apply to all projects and environments within an organization.
  • Project-level policies can extend or override organization policies for specific use cases.
  • Environment-level policies allow different enforcement in development, staging, and production.

This hierarchy means a CISO can set organization-wide rules (e.g., "never allow SSNs in any AI response") and individual teams can add project-specific rules (e.g., "block investment advice in the customer-facing chatbot") without affecting other teams.

The Hard Problems

Request Routing

Every incoming request must be routed to the correct tenant's policy context in under 1ms. We use a combination of API key prefix matching (O(1) lookup) and a tenant context cache that holds the active policy set for each tenant in memory.

Cache invalidation is event-driven: when a tenant updates a policy, an invalidation event propagates to all edge nodes within 500ms.

Noisy Neighbor Prevention

If one tenant sends a traffic spike, it should not affect latency for other tenants. UMAI uses per-tenant rate limiting at the edge and fair-share scheduling in the policy evaluation pipeline.

Each tenant gets a guaranteed throughput allocation based on their plan tier. Burst capacity above the allocation is best-effort and can be throttled if the system is under load.

Cross-Tenant Analytics

UMAI's internal analytics — attack trend detection, false-positive rate monitoring, model accuracy tracking — must aggregate data across tenants without exposing tenant-specific information.

We solve this with differential privacy techniques: aggregated metrics include calibrated noise to prevent individual tenant behavior from being inferred. Tenant-specific analytics are only available to that tenant's administrators.

Lessons for SaaS Builders

If you are building a SaaS platform with AI features and considering multi-tenant guardrails, here is what we recommend:

  • Design for policy isolation from day one. Retrofitting tenant isolation into a system that was not designed for it is significantly harder than building it in from the start.
  • Separate the detection engine from the policy engine. Your ML models (classifiers, detectors) can be shared. Your policy configuration and enforcement logic must be isolated.
  • Invest in policy inheritance. Enterprise customers will have hundreds of policies. Without inheritance, managing them becomes unworkable.
  • Plan for on-premises. Even if 90% of your customers are happy with multi-tenant SaaS, the 10% who need on-prem are often your largest contracts. Design your architecture so the same codebase can run in both modes.
  • Benchmark latency under multi-tenant load. Single-tenant performance benchmarks are misleading. Test with realistic multi-tenant traffic patterns, including noisy-neighbor scenarios.

Want to see how UMAI's multi-tenant architecture works for your platform? Book a technical deep-dive at contact@umaisolutions.com.