esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

What Are the Multi-Tenant Concerns?

What multi-tenant means for an AI app, and the isolation, fairness, cost and leak risks to handle, explained simply for your AI interview.

In short

Multi-tenant means one AI system serves many customers, called tenants. The main concerns are keeping each tenant's data apart, sharing capacity fairly, tracking cost per tenant, and stopping leaks through caches, logs and fine-tuned models.

11 min readAdvancedCommon · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

A tenant is one customer sharing my app. With many tenants, I worry about four things. First, one firm's data must never reach another firm's answers, so the search filters by tenant inside the index query, using the login. Second, one tenant's big job must not slow the others, so each tenant gets its own limit. Third, I track cost per tenant. Fourth, caches, logs and fine-tuned models must not carry one tenant's data to another.

What are multi-tenant concerns, in plain words?

A tenant is one customer of your system. Multi-tenant means many tenants share the same app, servers and database.

The concerns come from sharing. The same code, index, queue and model serve everyone, so one tenant's data, load or cost can reach another tenant.

Think of a shared office building. Each firm has a locked room, the lift serves everyone, and a courier must never leave one firm's parcel in another firm's room. In an AI app, the rooms are the tenants' documents and chats, and the lift is the model's shared capacity.

A document is cut into small pieces called chunks. A search index is a store that finds the right chunks fast. A vector database is one kind of index that stores each chunk as a list of numbers, so similar text can be found.

Key words

Tenant
One customer or group of users sharing the app.
Data isolation
Keeping one tenant's data unseen by every other tenant.
Noisy neighbour
One tenant's heavy use that slows everyone else.
Workspace
A separate space for a project, environment or team, with its own limits.
Prompt cache
Saved model work, reused so a repeat request is faster and cheaper.

How do you stop one tenant's data reaching another's answer?

A major risk is one shared search index. If every firm's chunks sit in the same vector database, a search for liability can return a clause from a rival firm. OWASP, the open web security project, describes this risk for shared stores, and AWS sets the goal:

  • “In a multi-tenant environment where different groups or classes of users share the same vector database, embeddings from one group might be inadvertently retrieved in response to queries from another group's LLM, potentially leaking sensitive business information.”

    OWASP, LLM08:2025

  • “determining how their multi-tenant environments will ensure that each tenant is prevented from accessing another tenant's resources.”

    AWS, SaaS Lens

The fix is a rule in code. The app takes the firm from the signed-in session and passes it into the search as a filter, so other firms' chunks are never returned. OWASP says to enforce this inside the index query, not after retrieval. A line in the prompt asking the model to use one firm's files is only a request, so it cannot be the control.

OWASP also advises isolating per-tenant indexes for high-sensitivity work, so one faulty filter cannot expose every firm at once.

One shared index, filtered by firm

Firm A's user asks

logged in as Firm A

Shared search index

chunks from all 120 firms

Filter in the index query

firm ID applied in the search

Answer

no other firm's text in it

  1. 1The question, with Firm A's ID from the login, goes to the index.
  2. 2The search asks only for Firm A's chunks, so other firms' chunks are never returned.
  3. 3Only Firm A's chunks reach the model.
One shared index holds every firm's chunks. The search applies Firm A's ID from the login, so other firms' chunks are never returned. Only Firm A's text reaches the answer.

Here is the rule in a few lines of Python. The first function filters by firm before matching. The second skips the filter, and it reports that Denby's chunk matched too.

Python
# Three firms share one index. Each chunk carries its firm; the firm comes from the login.
CHUNKS = [
    {"firm": "Harlow", "text": "Harlow's liability cap is set per contract."},
    {"firm": "Denby", "text": "Denby's liability cap is 2 million pounds."},
    {"firm": "Harlow", "text": "Harlow's notice period is 90 days."},
]

def search(words, firm):
    # In production this filter goes into the index query. Code decides, not the prompt.
    return [c["text"] for c in CHUNKS
            if c["firm"] == firm and any(w in c["text"].lower() for w in words)]

def search_unfiltered(words):
    return [c["firm"] for c in CHUNKS
            if any(w in c["text"].lower() for w in words)]

print("Harlow user:", search(["liability"], "Harlow"))
print("Denby user:", search(["liability"], "Denby"))
print("No filter, firms found:", search_unfiltered(["liability"]))

Output

Harlow user: ["Harlow's liability cap is set per contract."]
Denby user: ["Denby's liability cap is 2 million pounds."]
No filter, firms found: ['Harlow', 'Denby']

How do you stop one tenant slowing the rest?

Give each tenant its own share of the rate limit, so a big job uses only its part. Anthropic's rate-limit docs describe the same idea for workspaces, and AWS names the problem:

  • “To protect workspaces in your organization from potential overuse, you can set custom spend and rate limits for each workspace.”

    Anthropic, rate limits

  • “The idea behind noisy neighbor is that a user of a system could place load on the system's resources that could have an adverse effect on other users of the system.”

    AWS, SaaS Lens

In practice I give every tenant its own per-minute budget, send a clear wait message when it runs out, and move big backfills to a night queue, so they never compete with daytime chats.

Big jobs get their own share

Insurer A's backfill

40,000 claim files at 9 a.m.

Other insurers' chats

normal claim questions

Limit per tenant

each insurer has its own share

Fair share

chats stay fast, backfill slows

  1. 1The backfill sends its requests to the shared limit.
  2. 2The normal chats send theirs to the same limit.
  3. 3Each insurer's share is kept apart, so the backfill slows and the chats stay fast.
Two kinds of tenant share one model quota. The limit gives each insurer its own share, so the backfill slows to that share and the chats stay fast. Fairness is set in code, so no single tenant can take the whole quota.

What about cost, caches, logs and fine-tuned models?

Cost is the third concern. Count the tokens each tenant uses (the small pieces of text a model reads and bills by), cap spend per tenant, and bill from the same numbers, so one heavy customer shows on the dashboard before it shows on the invoice.

The quieter leaks live in the shared parts:

  • Cache

    Shared speed-up

    Anthropic says its prompt caches are isolated by workspace on the Claude API and on some cloud platforms. Timing and cache-hit signals can still hint at content, so high-sensitivity tenants get their own cache.

  • Logs

    Shared record

    Traces and telemetry can hold a tenant's text. Remove private text from them (redact) like any other output, and keep each tenant's logs only as long as its contract allows.

  • Fine-tunes

    Shared memory

    A tenant's adapter can memorise rare examples closely. Never serve one tenant's adapter to another.

OWASP lists these under sensitive information disclosure, where a system reveals data through a channel nobody meant to open. Its list of channels covers logs, telemetry and cache behaviour, as well as the final answer.

Tip

Asked about isolation, name every surface: the index, the cache, the logs, the fine-tunes and the tools the agent can call. Naming only the database misses three of them.

How would you prove a tenant is really isolated?

Seed two test tenants with different documents. Sign in as one, then ask for the other's documents by name, by topic and by copy-paste. Check the answer, the citations, the logs and the cache.

Keep this test in the build pipeline. A new index or cache setting can undo isolation without any change to the app code, so a leaked chunk should fail the build.

What does the interviewer want to hear?

A strong answer covers

  • A tenant defined, and the shared parts named: index, cache, queue, logs and models.
  • Isolation enforced in code, taken from the login, never from the prompt.
  • Per-tenant rate limits and cost metering, so one customer cannot starve the rest.
  • The quiet leaks: caches, logs and fine-tuned adapters.
  • A test where a second tenant tries to fetch the first tenant's data.
  • Honest that isolation is something you design and test.

Common traps

  • Trap"One database per customer solves everything."

    BetterIt helps, but caches, logs, shared models and tools still need checks. Name them.

  • Trap"The system prompt says to use only this customer's data."

    BetterA prompt is only a request. Filter by tenant in the index query, using the login.

  • Trap"Each tenant has a rate limit, so we are fine."

    BetterA limit stops one heavy job. It does nothing for a leak through a shared cache, so watch the shared parts too.

Can you spot the risk?

Spot the risk

Your legal search serves 120 firms from one index. Which search call is safe?

Quick check

A Firm B user gets a clause from Firm A in an answer. What fixes the root cause?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q352Design a work copilot that never leaks data the user can't access.12 min
  2. Q353Design an LLM gateway.12 min
  3. Q355What is your fallback when a provider is down?12 min
  4. Q356Design rate limiting.12 min
  5. Q364Security architecture for LLM apps?13 min

Last updated on 27 November 2026

Building an AI product for many customers?

I design and build AI products and agents that include isolation, per-customer limits and cost tracking. Book a short call and tell me who your customers are and what data they must never see.