Zenaique

How does per tenant cost gating change the context engineering policy in a multi-tenant product?

Flashcard·Medium·4.0 · 0·~30s·Asked atHumanloopOlaOracle
Attempt it
TL;DR

Context engineering becomes parameterised by tenant: same persona and system prompt, but top-k, summary depth, rerank, and model class scale with the plan so the free tier is profitable and the enterprise tier uses

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Think of an all you can eat restaurant that has two memberships. The basic membership gets a small plate, no dessert station, and house-brand soft drinks. The premium membership gets a big plate, the dessert station, and the imported drinks. The kitchen is the same. The recipes are the same. The waiter is the same. What changes is how much each member can put on the plate and which stations they can visit. If you gave everyone the big plate the restaurant would lose money on the basic members. If you gave everyone the small plate the premium members would be paying for things they cannot use. The agent works the same way. The persona is the kitchen. The plate size and the dessert station are the tenant-tuned context knobs.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

When the same agent serves a hobbyist on a free plan and a Fortune 500 customer on an enterprise contract, the per-call economics are wildly different. The free user generates near-zero revenue; the enterprise contract may pay six figures a year. If you assemble the same context for both, you either lose money on the free tier or you give the enterprise tier less than they paid for.

Cost gating is the discipline of letting the tenant's plan flow into the context-assembly pipeline as a budget envelope. Same persona, same safety, same tool registry, but how much retrieval, how much summary depth, which model class, and how big a working context all scale with the plan.

This question matters in 2026 because input tokens are the single largest cost driver in most LLM products, and they are spent at assembly time, not billing time. You cannot recover margin in invoicing if you have already spent it in tokens. The right place to defend unit economics is in the assembler.

What stays constant versus what scales

The first move in designing tier-aware context engineering is to decide what is policy (constant) and what is parameter (tier-scaled).

Constant across tiers: system prompt and persona, output schema, safety and policy rails, the tool registry. Behavior should be tier-independent. The agent introduces itself the same way to everyone, refuses the same out of scope requests, follows the same brand voice. Tier-flavoring the persona ('cheap version is rude, premium version is friendly') destroys trust and inverts the conversion funnel, your free-tier users are the ones you most want to woo into paying.

Scaled with tier: working context budget, top-k retrieval size, reranker on/off, query expansion on/off, summary depth, model class, persistent memory horizon. Each of these has a direct cost lever. Doubling top-k roughly doubles input tokens. Turning on a commercial reranker adds a per-query cost on top of vector search. Switching from Claude Sonnet 4.6 to Opus 4.7 is roughly a 5x cost multiplier per token at 2026 prices. The total cost per call envelope is the multiplication of all these factors, and the right envelope for a tier is whatever keeps the per-user gross margin positive.

Sample envelopes for three tiers
Why the assembler is the right place to gate
Closing the loop with observability
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
KnobFree tierPro tierEnterprise tier
Working context budget4-8k tokens16-24k tokens32-64k tokens
Top-k retrieval3-58-1215-25
RerankerOffLocal / cheapCohere Rerank v3 / Voyage Rerank-2
Summary depthSingle rolling2-level3-level + semantic
Model classGPT-5-mini / Haiku 4GPT-5.5 / Sonnet 4.6GPT-5.5 Pro / Opus 4.7
Persistent memorySession-onlyWeek-longPersistent with admin controls

Real products, models, and research that use this idea.

  • Notion AI Q&A's free preview uses a smaller retrieval window and cheaper model than the Business and Enterprise tiers, with the same persona and output style.
  • GitHub Copilot Business gives access to Claude Sonnet 4.6 and GPT-5.5 with longer context than the Individual plan, with Enterprise unlocking Claude Opus 4.7 and proprietary code retrieval.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow do you keep the free tier's quality high enough to drive conversions while staying profitable?
A

Invest in retrieval precision rather than retrieval volume. A free tier with top-k 3 and a strong reranker can outperform a top-k 10 with no rerank, at lower cost. The unit economics get better as the retrieval quality goes up, not as the budget goes up.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Running the same context policy for every tenant and trying to recover margin with billing math. The fix is at the assembly layer, not the invoice.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • Which knobs stay constant across tenant tiers and which scale

  • Why margin must be defended at the context-assembly layer rather than in billing

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Pick the most effective intervention when an agent's context grows by 8KB every iteration
MCQ·Medium