← Back to Profile

The Multi-Tenant Mind

December 5, 2025

Imagine you're the landlord of an apartment building. Every tenant has their own unit, their own furniture, their own life behind their own locked door. But they all share the same plumbing, the same electrical grid, the same structural foundation.

Now imagine that every tenant also has their own personal butler. Each butler knows everything about their specific tenant: their preferences, their schedule, their dietary restrictions. But no butler should ever know anything about the tenant next door. And all the butlers are, underneath the uniform, the same model of robot running on the same operating system.

Welcome to multi-tenant agentic architecture. It's the problem I've been solving for the past year, and it's unlike anything I built before.

A Problem That Didn't Exist

Two years ago, "AI integration" meant calling an API. You sent a prompt to OpenAI, got a response, displayed it to the user. Stateless. Simple. The same architectural pattern as hitting any third-party service.

Then agents happened.

An agent isn't a single API call. It's a persistent entity with memory, context, goals, and the ability to take actions. When you give each customer on your platform their own agent, you're not just adding a feature. You're creating a parallel system of autonomous actors that need to be isolated from each other, governed independently, and funded from separate budgets.

Traditional multi-tenancy is about data isolation: make sure Customer A can't see Customer B's records. Multi-tenant agentic systems add three new dimensions that existing SaaS patterns simply don't cover.

The Token Economy

Every AI action costs money. Not metaphorically. Literally. Each API call to an LLM consumes tokens, and tokens cost real dollars. When you're running a platform where fifty different customers each have agents performing actions throughout the day, you need a token economy.

This means metering. Per-tenant usage tracking, budget caps, rate limiting, cost allocation. It means deciding what happens when a customer's agent tries to perform an action that would exceed their monthly budget. Does it stop? Degrade gracefully? Queue the action for later? Notify the customer and ask for approval?

These are product decisions masquerading as engineering problems. There is no right answer in the abstract. It depends on what your customers are using the agents for, and how critical each action is.

We built a centralised token ledger that tracks every API call across every tenant in real time, with configurable policies per customer. It sounds straightforward until you realise that a single agent action might chain together five or six LLM calls under the hood, and you need to attribute every single one accurately.

The Context Wall

This is the one that keeps me up at night.

When an agent has memory, it accumulates context over time. Conversations, documents, user preferences, business data. That context is what makes the agent useful. It's also what makes a data leak catastrophic.

If Customer A's agent somehow accesses Customer B's context, you don't just have a bug. You have a breach. And in the age of AI, a breach doesn't mean someone saw a database row they shouldn't have. It means an AI system has ingested another customer's data and might now reference it, summarise it, or act on it in completely unpredictable ways.

The solution is defense in depth. Separate vector stores per tenant. Scoped API keys. Context injection that's validated at every layer. We treat the context wall the way you'd treat a security boundary in a banking system, because functionally, that's what it is.

The Guardrail Paradox

An agent that can do anything is more dangerous than an agent that can do nothing.

Each customer's agent needs its own set of guardrails: what it's allowed to do, what it's not allowed to do, how far it can go without human approval. These guardrails are per-tenant configurations, because what's appropriate for a marketing automation agent is very different from what's appropriate for a financial analysis agent.

The challenge is that guardrails need to be both strict and flexible. Strict enough that an agent can't go off-script in harmful ways. Flexible enough that the agent can actually be useful. Finding that balance is an ongoing negotiation with each customer.

We settled on a layered approach: platform-level guardrails (hard limits that no tenant can override), tenant-level guardrails (configured per customer), and action-level guardrails (specific to each operation). An agent might be authorised to send emails on behalf of a customer, but only to addresses on an approved list, and only if the total count doesn't exceed a daily limit.

The New Discipline

None of this maps cleanly to existing software patterns. It's not traditional SaaS engineering, though it borrows from it. It's not DevOps, though infrastructure management is a huge component. It's not AI research, though you need deep understanding of how models work.

It's something new. I've started calling it "agentic platform engineering," which is admittedly not the catchiest term. But it captures the reality: you're building platforms that host autonomous agents, and the engineering challenges are fundamentally different from anything we were doing five years ago.

The closest analogy I can find is cloud computing in 2008. AWS had just launched, and a new generation of engineers was figuring out how to build systems that were elastic, isolated, metered, and multi-tenant in ways that previous server architectures never contemplated. We're at that same inflection point with AI.

The apartment building is getting more tenants every month. The butlers are getting smarter. And the landlord's job is making sure the plumbing holds up while nobody's reading anyone else's mail.

← Back to Profile