00. Security, Governance, and Multi-Tenancy — The Five-Year-Old Version¶
Security is locks on doors. Governance is who gets the keys. Multi-tenancy is apartments sharing walls.
Imagine an apartment building. Many families live under one roof. Each family has their own front door with a lock. Nobody walks into someone else's apartment uninvited.
The building has a guest register at the lobby. Every visitor signs in, shows ID, states who they're visiting. The guard checks the guest register before letting anyone past the lobby. That is authentication — proving you are who you claim to be.
Inside, not every resident can access every floor. The penthouse requires a special elevator key. The gym needs a membership swipe. The server room is staff-only. That is authorization — even after proving identity, you only access what you're allowed.
Now, the walls between apartments must be thick. Noise from apartment A should not reach apartment B. A water leak in apartment C should not flood apartment D. The wall between tenants is isolation — resource, network, and data isolation. Multi-tenancy means multiple customers share infrastructure, but each believes they are alone.
Every month, the building manager runs an audit — checking fire extinguishers, testing alarms, reviewing access logs. The audit ensures rules are followed and nothing has drifted from the plan. That is governance and compliance.
Finally, sensitive documents are stored in a safe. Even if someone breaks in, they can't read what's inside without the combination. The safe is encryption — data at rest and in transit, wrapped in math that only authorized parties can unwrap.
Why does multi-tenancy matter so much in AI platforms? Because AI-as-a-service means many customers share the same model infrastructure. Customer A's prompts must not leak to Customer B. Customer A's fine-tuned model weights are their intellectual property — the wall between tenants must be absolute.
Security in AI has extra dimensions too. Prompt injection. Model poisoning. Training data extraction. Data leakage through model outputs. Traditional web security (OWASP Top 10) still applies, but AI adds a whole new attack surface. The front door must guard against threats that didn't exist five years ago.
Governance means knowing: Who trained this model? On what data? With whose approval? Can it be used for this purpose? Is it compliant with GDPR? SOC2? HIPAA? The audit trail must answer all these questions — not just for code deploys, but for model deployments too.
The apartment building analogy scales to enterprise SaaS: thousands of tenants, each with their own data, configurations, usage quotas, and compliance requirements. Your architecture must handle all of them without sacrificing performance, security, or simplicity.
The placeholders you will see called back¶
| Placeholder | Meaning |
|---|---|
| front door | authentication — login, tokens, identity verification (OAuth, SAML, JWT) |
| elevator key | authorization — RBAC, ABAC, policies that control what you can access |
| wall | tenant isolation — data separation, network segmentation, resource limits |
| audit | governance and compliance — logging access, policy enforcement, drift detection |
| safe | encryption — TLS, AES, KMS, secrets management, data protection at rest/transit |
Top resources¶
- OWASP Top 10 — the most critical web application security risks; updated regularly
- AWS Security Best Practices — IAM, encryption, logging, and compliance on AWS
- Zero Trust Architecture (NIST SP 800-207) — the "never trust, always verify" model explained
- Designing Multi-Tenant SaaS (AWS) — practical tenant isolation patterns
- OAuth 2.0 Simplified by Aaron Parecki — OAuth/OIDC explained clearly with diagrams
What's coming¶
- 01-authn-identity-tokens.md — OAuth, OIDC, JWTs, sessions, and proving who you are
- 02-authz-rbac-abac-policies.md — roles, permissions, policy engines, and deciding what you can do
- 03-encryption-tls-kms.md — TLS, envelope encryption, KMS, and protecting data everywhere
- 04-tenant-isolation-patterns.md — silo, pool, bridge models and the tradeoffs of each
- 05-api-security-rate-limits.md — input validation, CORS, rate limiting, and API gateway patterns
- 06-secrets-management.md — Vault, rotation, least privilege, and never hardcoding secrets
- 07-compliance-audit-logging.md — audit trails, SOC2, GDPR, HIPAA, and proving you're compliant
- 08-honest-admission.md — what we don't fully understand about security and governance
Bridge. The apartment building starts with the front door. Authentication — proving identity — is the foundation everything else builds on. → 01-authn-identity-tokens.md