One agent platform, many customers: the pooled-versus-siloed decision, per-tenant identity all the way down to tools, tenant-scoped memory, and cost isolation. This playbook designs the multi-tenant agent architecture as a decision record with the isolation proofs named up front.
Tier: Advanced · Hands-on time: ~35 minutes
This area now has first-party canon: AWS's 2026 guidance on building multi-tenant agents with Bedrock AgentCore documents the pooled-runtime-plus-centralized-MCP-gateway pattern explicitly, which means the pattern conversation can start from published architecture rather than folklore. The design problem is classic SaaS multi-tenancy with new failure modes stacked on top — an agent that holds memory, calls tools, and consumes expensive tokens can leak, starve, or overspend across tenant boundaries in ways a stateless API never could.
Decide pooled, siloed, or tiered — per layer, not globally. Runtime, memory store, vector indexes, tool gateway, and model quota can each be pooled or siloed independently. The published pattern — pooled runtime with a centralized MCP gateway enforcing per-tenant scoping — is the cost-efficient default; siloed layers are bought where contracts or blast-radius demand them. A tiered offering (pooled standard, siloed premium/regulated) is often the honest commercial answer; design both paths from one codebase.
Design tenant identity to travel end to end. Every request carries tenant context from the app boundary through the agent, into every tool call and every retrieval. The rule that survives audits: tools and indexes enforce tenancy from propagated identity — never from the agent's prompt remembering which tenant it is serving. Prompts are not a security boundary.
Scope memory and retrieval per tenant. Session state, long-term memory, and vector indexes are keyed and filtered by tenant (pb-31's index-per-tenant versus metadata-filter fork applies verbatim to agent memory). Define tenant offboarding as a first-class flow: all memory, checkpoints, embeddings, and traces for the departing tenant enumerable and deletable.
Design noisy-neighbor controls before the first incident. Model tokens are the scarce shared resource: per-tenant rate limits and token budgets at the gateway (virtual keys per tenant make this enforceable and measurable), queue fairness for long-running tasks, and quota headroom math that assumes your most enthusiastic tenant triples overnight.
Make cost per tenant observable by design. Tag every model call, tool invocation, and storage object with tenant ID at creation; gateway virtual keys give per-tenant spend natively. This is the difference between "we can price agentic features per tenant" and a quarterly archaeology project — design-time attribution, per this track's FinOps principle, is drastically cheaper than retrofit.
Red-team the isolation story. Anita, taking orbit-docs-copilot's agent features multi-tenant:
Attack this multi-tenant agent design (attached: pooled AgentCore-style
runtime, centralized MCP gateway with per-tenant virtual keys,
metadata-filtered shared vector index, tenant-keyed Postgres memory).
Find cross-tenant paths in:
1. Memory — any flow where tenant A's session or long-term memory can
enter a prompt serving tenant B (include checkpoint resume and
summarization jobs).
2. Tools — any tool call where tenant scoping relies on prompt content
rather than propagated identity.
3. Retrieval — filter-bypass paths in the shared index, including
cache layers that might serve cross-tenant cached results.
4. Cost/quota — how tenant A exhausts a shared quota or budget and
what tenant B experiences.
5. Offboarding — what a departed tenant's data leaves behind in
checkpoints, caches, traces, and embeddings.
Severity, concrete scenario, and closing design change for each.
Triage findings yourself; each becomes a design change or a documented, justified acceptance.
Write the decision record. Per-layer pooled/siloed table with reasons, identity-propagation diagram, per-tenant quota and budget scheme, offboarding flow, and revisit triggers (tenant count thresholds, first regulated-tenant contract, noisy-neighbor incident). This ADR is what the commercial team's isolation promises must match.
When the "tenants" are your consultancy's clients, the stakes sharpen: MSAs often prohibit co-mingling outright, forcing siloed layers per client regardless of cost logic — extract those clauses before designing, and let the tiered model absorb the difference. Client-tenancy endpoints (Bedrock or Azure OpenAI inside each client's subscription) naturally silo model traffic and spend per client. All isolation testing uses synthetic tenants only. For the strictest engagements, the entire agent stack — runtime, gateway, memory, index — deploys inside each client's boundary, and the pooled economics conversation ends there; a local Ollama-based rig remains the development environment either way.
Decide pooled-versus-siloed per layer, propagate tenant identity to the tool and the index — never trust the prompt to remember — and prove isolation with hostile tests and a residue-free offboarding before the first real tenant arrives.