Skip to main content

Multi-Tenant Isolation

AI-in-a-Box enforces tenant boundaries at the gateway, service request context, storage keys, and audit verification layers.

Trust Boundary

The gateway is the trust boundary for external traffic. It removes inbound identity headers, validates the bearer token, then stamps trusted downstream headers.

Manual X-Tenant-ID headers from external callers are not authoritative. Configure the identity provider to emit the desired tenant claim.

Isolation Layers

LayerMechanism
GatewayHeader stripping, JWT validation, tenant derivation, admin path guard.
PrincipalHMAC-signed X-Aibox-Principal verified by Python services.
CapTokenShort-lived capability token bound to tenant, principal, scope, and turn.
MemoryStructured scope with tenant_id, user_id, optional agent_id, and session_id.
KnowledgeTenant plus private/shared/restricted visibility and audience filtering.
AuditPer-tenant hash chain, turn event storage, and receipt proof queries.

Admin Authorization

Audit and admin routes distinguish tenant and platform operations:

  • tenant_admin can access a matching tenant.
  • platform_admin and legacy admin can perform cross-tenant operations.
  • user cannot call /v1/admin/*.

Knowledge Visibility

Knowledge items are not just tenant-scoped. They also carry visibility metadata:

FieldMeaning
visibility_modePrivate, shared, or restricted policy.
owner_user_idOwning user.
audience_tagsGroups allowed to read restricted content.
user_grantsExplicit user grants.

Search and list operations build actor context from tenant, user, and roles before filtering readable documents.

Audit Receipts

Turn receipt APIs require X-Tenant-ID and only return data for that tenant:

curl "http://localhost:8080/v1/receipts/$TURN_ID" \
-H "Authorization: Bearer $TOKEN"

The receipt proof is valid for the exported tenant chain suffix and the signing keys used to verify it.