BotNetwork

Multi-tenant bots: isolating customer data

Guild/workspace ids as tenants and hard data boundaries.

Guide1 min readUpdated

Why it matters

Multi-tenant bots must isolate tokens, data and rate limits per customer — a shared table without tenant_id is an incident waiting to happen.

Practical steps

  1. Every row carries tenant_id; enforce in the query layer.
  2. Separate secrets per tenant when platforms allow.
  3. Per-tenant rate limits and budgets.
  4. Avoid cross-tenant caches keyed only by user id.
  5. Test with two tenants in CI asserting isolation.

Watch out for

  • Global admin commands that forget the tenant filter.
  • Logging one tenant's prompts in another's support ticket.

Related comparisons and tools