Markdown Editor

Enterprise RAG Search System Design Template

Enterprise RAG search design: connectors, document and chunk ACL filtering, permission sync, hybrid retrieval, RRF, reranking, citation verification, tenancy

Diseño de sistemasCompletaOWASP LLM Top 10 2026 (LLM08, LLM09)designenterpriseragsearchmath

Cómo usar: Use it when you design search and answers across workplace systems that must respect each source's permissions. Fill the permission guarantee (1.2) and the permission filtering deep dive (7.2) first, then retrieval and verification. The main pitfall is filtering after retrieval or after generation, which lets restricted content reach the model context.

Vista previa

System Design: [Enterprise AI search name]

Reference design for an enterprise search and answer service that retrieves from many workplace systems and answers with citations, while showing each user only what that user may read in the source system. It covers connectors, document-level and chunk-level permission filtering, permission sync, hybrid retrieval and reranking, citation grounding and answer verification, freshness, multi-tenant isolation and evaluation. Threats are mapped to the OWASP Top 10 for LLM Applications 2026, in particular LLM08:2026 Hidden Context Exposure and LLM09:2026 Vector and Embedding Weaknesses. It follows the 12-section skeleton of the System Design Document template and is pre-filled with a worked design for a multi-tenant SaaS to adapt. Replace every [bracketed] value and every row marked Example; all numbers are illustrative examples, not benchmarks.

Document control

FieldValue
Document ID[SDD-ERAG-001]
System / feature[Enterprise search and answer service]
Version[0.1]
Status[Draft / In review / Approved / Implemented / Superseded]
Author(s)[@author]
Reviewers[@reviewer-1], [@reviewer-2]
Last updatedYYYY-MM-DD
Classification[Internal]
Deployment model[Multi-tenant SaaS / single-tenant / on-premises]
Connectors in scope[Document storage, wiki, ticketing, chat, email, code hosting, CRM]
Data classes in scope[Public, internal, confidential; excluded: regulated health or card data]
Related[RAG system design], [Threat model], [Privacy impact assessment], [LLM evaluation plan]

Approvals

RoleNameDecisionDate
Tech lead, search platform[@name][Approved / Changes requested]YYYY-MM-DD
Staff / principal engineer[@name][Decision]YYYY-MM-DD
Security and privacy[@name][Decision]YYYY-MM-DD
Data protection officer[@name][Decision]YYYY-MM-DD
Product owner[@name][Decision]YYYY-MM-DD

Revision history

VersionDateAuthorChange summary
0.1YYYY-MM-DD[@name]First draft for design review
0.2YYYY-MM-DD[@name]Example: Added late permission check against the source for confidential connectors
0.3YYYY-MM-DD[@name]Example: Dedicated shards for tenants above 50 million chunks
1.0YYYY-MM-DD[@name]Example: Approved

Contents

1. Overview

1.1 Problem statement

[Example: Employees search eight systems separately and cannot find the current policy, the latest design review or who owns a service. A pilot chatbot built on a single shared index answered well, but during testing it quoted a restricted board document to an intern because the index ignored source permissions. Customers of the SaaS product now ask for the same capability across their own workplace systems, with a contractual promise that no user ever sees content they cannot open in the source.]

1.2 Proposed solution

[Example: Connectors pull content and permissions from each source system into a per-tenant index. Every chunk carries the principals allowed to read it. At query time the service resolves the user's identity and group memberships, retrieves only chunks whose principals intersect that set, fuses lexical and vector results, reranks, and passes the top chunks to a model that must cite them. A verifier checks that every sentence in the answer is supported by a cited chunk before the answer is shown. For confidential sources, the top documents are re-checked against the source system's permission API at query time. Each tenant's data lives in its own index partition with its own encryption key.]

Permission guarantee: [Example: An answer or result is built only from chunks the requesting user could open in the source system at the time of the last permission sync, and for confidential sources at the time of the query.]

1.3 Decisions requested from reviewers

IDQuestionRecommended optionSection
Q-01Example: Filter by permissions before or after retrieval?Before (pre-filter in the index), plus late check for confidential sources7.2
Q-02Example: Per-tenant index or shared index with tenant filter?Pooled shards for small tenants with tenant key in every query; dedicated shards above a size threshold7.5
Q-03Example: Show an answer when verification fails?Show search results with an explanation instead of the answer7.4
Q-04Example: Permission sync lag target?p95 at or below 15 min; revocations on webhook within 2 min2.2
[Q-nn][Question][Option][Section]

1.4 45-minute interview path

MinutesCoverOutput on the whiteboard
0 to 5Users, sources, the permission guarantee, single or multi-tenant2.1 and 2.3
5 to 10Corpus size, query rate, permission change rate3.5 with consequences
10 to 15Search and answer API; chunk and ACL data model with access patterns4.1 and 5.2
15 to 25Diagram: connectors, sync, index, query service, reranker, generator, verifierSection 6
25 to 40One deep dive: permission filtering and sync (7.2) is the expected one; pick verification (7.4) for an ML panel or tenant isolation (7.5) for a SaaS panelOptions, choice and reason
40 to 45Failure modes, 10x row, how to prove no leakage (9.2, 12.1)9.1 and 10

2. Requirements

2.1 Core functional requirements

IDRequirementPriority
FR-01Example: Connectors for [document storage, wiki, ticketing, chat, email, CRM] with content, metadata and permissionsMust
FR-02Example: Search results and generated answers filtered by the user's source permissionsMust
FR-03Example: Chunk-level filtering where the source restricts parts of a document (page restrictions, protected ranges, message recipients)Must
FR-04Example: Answers cite the source chunks with links that open the original itemMust
FR-05Example: Answers withheld or downgraded to results when verification failsMust
FR-06Example: Incremental sync of content and permissions, with deletions honouredMust
FR-07Example: Tenant administrators choose connectors, exclude sites and set retentionMust
FR-08Example: Feedback (helpful, wrong, should not see this) on each answerShould
FR-09Example: Filters by source, author, date and content typeShould
[FR-nn][Requirement][Must / Should / Could]

2.2 Non-functional requirements

IDQualityTargetMeasured as
NFR-01Permission correctnessExample: Zero results from documents the user cannot read, on the canary suite in 9.2Daily automated leakage test
NFR-02Permission freshnessExample: p95 sync lag at or below 15 min; revocation by webhook at or below 2 minSync lag metric per connector
NFR-03Content freshnessExample: p95 at or below 30 min from source edit to searchableCanary edits per connector
NFR-04LatencyExample: Search results p95 at or below 800 ms; first answer token p95 at or below 2.5 sGateway timing
NFR-05Answer qualityExample: Citation precision at or above 0.9 and answer faithfulness at or above 0.9 on the evaluation setOffline evaluation per release
NFR-06Tenant isolationExample: No query can read another tenant's partition; separate encryption key per tenantPenetration test, key audit
NFR-07AvailabilityExample: 99.9% monthly for search, 99.5% for answersSLO
[NFR-nn][Quality][Target][Measurement]

2.3 Below the line (out of scope)

  • [Example: actions in source systems (creating tickets, sending email); see Customer Support AI Agent System Design (system-design/design-customer-support-agent) for an agent with tools]
  • [Example: model training on tenant data]
  • [Example: field-level redaction inside a chunk (for example, masking a salary column); chunks are visible or not]
  • [Example: legal hold and e-discovery exports]
  • [Item deferred, with the release that will take it]

3. Capacity estimation

3.1 Assumptions

All values are Example planning inputs.

InputValueSource
Tenants400Sales forecast
Users across tenants1.5 millionContracts
Daily active share30%Pilot
Queries per active user per day6Pilot
Busy window10 hMain time zones
Peak to average3Pilot
Documents across tenants600 millionConnector inventory
Chunks per document8Chunking policy
Embedding768 dimensions, int8 after quantizationModel choice
Documents whose permissions change per day2%Connector audit logs
Candidates reranked per query50Retrieval design
Prompt / output tokens per answer6 000 / 300Ten chunks of about 500 tokens plus instructions

3.2 Corpus and index

Chunks: 600 million x 8 = 4.8 billion. Vectors at 768 B each (int8): 4.8 billion x 768 B, about 3.7 TB. HNSW links at 64 per vector and 4 B each add 4.8 billion x 256 B, about 1.2 TB. Lexical index and stored text add roughly the size of the text again.

Consequence: about 5 TB of vector data plus text cannot sit on one node. Shard by tenant: the largest tenants get dedicated shards, the long tail shares pooled shards keyed by tenant. Filtered vector search must work inside a shard, so pick an engine whose filters apply during graph traversal, not after.

3.3 Query load

Daily queries: 1.5 million x 0.3 x 6 = 2.7 million. Over 36 000 s that is 75 queries/s on average and about 225 queries/s at peak. Reranking: 225 x 50 = 11 250 query and passage pairs per second at peak.

Consequence: a cross-encoder reranker over 11 250 pairs/s needs its own GPU pool; cap candidates at 50 and skip reranking for navigational queries (exact title or person look-ups) detected by the query classifier.

3.4 Generation tokens and cost

Input tokens per day: 2.7 million x 6 000 = 16.2 billion; output: 2.7 million x 300 = 810 million. At Example prices of USD 1 per million input and USD 4 per million output: 16 200 + 3 240 = USD 19 440 per day.

Consequence: generation is the dominant cost. Answer only when the query is a question (classifier), show results without generation for navigational queries, and cache answers per (tenant, normalised query, permission set hash, index version) for a short time, invalidating any cached answer that cites a document with a revocation event.

3.5 Permission change rate

Documents with permission changes: 600 million x 0.02 = 12 million per day, about 139/s on average. If principals are copied onto each chunk, that is 12 million x 8 = 96 million chunk updates per day, about 1 100/s.

Consequence: permission updates must be partial updates of a small filterable field, not re-indexing of text and vectors. Group membership changes are handled at query time by expanding the user's groups, so a user joining a group never touches the index.

3.6 Summary

QuantityEstimateDesign consequence
Chunks4.8 billion, about 5 TB of vectors and linksTenant-keyed shards, filtered ANN search
Peak queriesAbout 225/sStateless query service, regional replicas
Rerank pairsAbout 11 250/s at peakDedicated reranker pool, skip for navigational queries
GenerationAbout 16 billion input tokens/day, about USD 19 000/day (Example)Classify before generating; short-lived answer cache keyed by permission set
Permission updatesAbout 1 100 chunk updates/s if denormalisedPartial updates of the ACL field; group expansion at query time

4. API design

4.1 Endpoints

Method and pathPurpose
POST /v1/searchRanked results with snippets, filtered by permissions
POST /v1/answerGenerated answer with citations, streamed; falls back to results
GET /v1/documents/{id}/openRedirect to the item in the source system after a permission check
POST /v1/feedbackHelpful, wrong, or should-not-see report on a result or answer
POST /v1/admin/connectorsTenant admin configures a connector and its scope
GET /v1/admin/connectors/{id}/statusSync state, lag and errors
POST /v1/admin/purgeRemove a source or an item and all derived chunks

4.2 Request and response example

Identity comes from the validated token; the service resolves groups itself. Every citation carries the chunk ID, source link and the source's last modified time so the user can judge freshness.

POST /v1/answer
Authorization: Bearer [user token]
Content-Type: application/json

{"query": "What is the travel approval limit for directors?", "filters": {"sources": ["wiki", "policies"]}, "stream": true}
{"answer": "Directors can approve travel up to [amount] per trip [1].", "citations": [{"id": 1, "chunk_id": "[chunk id]", "title": "Travel policy", "url": "[source link]", "modified": "YYYY-MM-DD"}], "verification": "supported", "index_version": "[version]"}

4.3 Errors

StatusProblem typeMeaning
403identity-unresolvedToken valid but the user is not mapped to source identities
403connector-forbiddenUser may not query this connector
422answer-unverifiedAnswer failed verification; results are returned instead
429rate-limitedTenant or user rate limit reached

5. Data model

5.1 Entities

Documents and chunks are derived data that can be rebuilt from the source. Identity mappings and ACLs are security data: they need the same review as an authorisation system.

5.2 Access patterns

QueryServed byPartition key and rationale
Vector and lexical search for a userShard for the tenant, filter allowed_principals intersects the user's principal set and denied_principals does nottenant_id: every query is tenant-scoped, so a tenant never scans another tenant's shard
Expand a user's groups, including nested groupsMembership graph cached per tenant, flattened per usertenant_id plus user: computed once per session, refreshed on change events
Apply a permission change to a documentPartial update of ACL fields on all chunks of the documenttenant_id plus doc_id: chunks of one document co-located for one batched update
Delete a document and its chunksDelete by doc_id across lexical and vector indexesSame co-location
Late permission check for top documentsSource system permission API, with a short cachePer connector; only for sources marked confidential
Citation link resolutionDocument table by doc_idtenant_id
Connector sync cursorConnector state tableconnector_id: one sync worker owns one cursor

5.3 Storage choices

DataStoreNotes
Chunks, vectors, lexical index, ACL fieldsSearch engine with filtered vector search, sharded by tenantACL fields filterable and not returned in results
Documents and connector stateRelational database per regionSync cursors, source timestamps
Identity and membership graphGraph or relational store, cached in memoryRebuilt from directory sync
Raw contentObject storage, encrypted with the tenant keyNeeded for re-chunking and re-embedding
Answers and feedbackEvent log with tenant retention settingsAnswers contain source content: same retention as the source

6. High-level design

ComponentResponsibilityScales by
ConnectorsFetch content, metadata, permissions; handle source rate limitsWorkers per connector instance
Permission syncMap source identities to principals; compute document and chunk ACLs; push partial updatesChange events per second
Parse, chunk, embedExtract text, split on structure, embed with the pinned modelGPU workers
Tenant shardsLexical and filtered vector searchShards and replicas
Query serviceClassify query, expand groups, hybrid retrieval, fusionHorizontally
RerankerCross-encoder scoring of candidatesGPUs
Late checkRe-verify top documents with the source for confidential connectorsHorizontally, with cache
Generator and verifierAnswer with citations; check support per sentenceModel pools

7. Detailed design

7.1 Query flow

The permission filter applies inside retrieval, before any ranking or generation step sees a chunk; the late check narrows further and never widens.

7.2 Deep dive 1: permission filtering and permission sync

OptionHow it worksStrengthsWeaknesses
A. Post-filterRetrieve top k, then drop chunks the user cannot readSimple indexReturns too few results; the model may see dropped chunks if the order of steps slips; leaks through counts and timings
B. Pre-filter in the index (early binding)Principals stored on each chunk; query filter by the user's principalsCorrect top k from permitted content only; fastIndex must be updated on every permission change; large principal sets
C. Query the source at query time (late binding)Ask each source whether the user can read each candidateAlways currentSlow, source rate limits, many sources have no batch API
D. B plus C for sensitive sourcesPre-filter for all; re-check the top documents against the source for connectors marked confidentialCorrect and fresh where it mattersExtra latency on confidential sources

Choice: D. Reason: pre-filtering guarantees that nothing outside the user's permissions enters the candidate set or the model context, and the late check closes the sync-lag window for the few sources where a minute of staleness is unacceptable.

Rules for the permission path:

RuleDetail
ACL-01 (Example)Map every source identity (email, source user ID, group ID) to one tenant principal; unmapped identities get no access
ACL-02 (Example)Store allow and deny principals on each chunk; deny wins
ACL-03 (Example)Chunk ACL is the intersection of the document ACL and any section-level restriction (page restriction, protected range, message recipients)
ACL-04 (Example)Public-within-tenant content uses a tenant-wide principal, never an empty ACL; an empty ACL means nobody
ACL-05 (Example)Expand nested groups at query time from the cached membership graph; cap expansion depth and alert on cycles
ACL-06 (Example)Revocation events (user removed, document unshared) are processed ahead of content updates in the sync queue
ACL-07 (Example)On any error resolving permissions, return no results from that source (fail closed)

Chunk-level permissions need care at chunking time: never let one chunk span two sections with different restrictions. Split on permission boundaries first, then on structure.

Large principal sets (users in thousands of groups) make filters slow. Use the engine's terms filter on a keyword field, keep the field out of the returned payload, and precompute a per-user principal list when it exceeds a threshold.

7.3 Deep dive 2: hybrid retrieval and reranking

OptionStrengthsWeaknesses
A. Lexical only (BM25)Exact names, codes, acronymsMisses paraphrases
B. Vector onlyParaphrases and intentWeak on identifiers and rare terms
C. Hybrid with reciprocal rank fusion (RRF), then cross-encoder rerankCombines both, robust without score calibrationTwo retrievals plus a rerank stage

Choice: C. Retrieve 50 from each retriever within the ACL filter, fuse with RRF, rerank the top 50 with a cross-encoder, keep 10 for generation. Reason: enterprise queries mix identifiers ("PRJ-2231 status") and intent ("how do I expense a conference"); RRF needs no score normalisation between retrievers.

RRF scores a document by summing, over each ranked list, one divided by a constant plus its rank:

RRF(d)=∑r∈R1k+rankr(d),k=60\mathrm{RRF}(d) = \sum_{r \in R} \frac{1}{k + \mathrm{rank}_r(d)}, \qquad k = 60

The constant 60 is the value used by Cormack, Clarke and Buettcher (SIGIR 2009); tune it on your evaluation set. Add freshness and authority signals (for example, official policy space, recent modification) as features in the reranker, not as hand-edited boosts.

7.4 Deep dive 3: citation grounding and answer verification

OptionStrengthsWeaknesses
A. Instruct the model to citeCheapCitations can point to chunks that do not support the sentence
B. Constrained citation format plus post-hoc check of every cited IDCatches invented IDsDoes not catch unsupported claims with a real ID
C. B plus an entailment verifier per sentenceCatches unsupported sentencesExtra latency and cost

Choice: C. Reason: an enterprise answer is acted on (policy, numbers, owners); unsupported sentences are the main quality failure.

Verification steps:

  1. The generator receives chunks with short IDs and must cite at least one ID per factual sentence.
  2. The verifier rejects any citation ID not in the provided set.
  3. For each sentence, a small verifier model judges whether the cited chunks support it (supported, partially supported, unsupported).
  4. If any sentence is unsupported, the service removes it when the remaining answer still stands, otherwise returns results with "No verified answer found" and the top documents.
  5. Verification outcome is stored with the answer for evaluation.

The generator's instructions tell it to answer only from the chunks, to say when they disagree, and to prefer the most recently modified source while naming both.

7.5 Deep dive 4: multi-tenant isolation

OptionStrengthsWeaknesses
A. One shared index, tenant ID filterCheapestA missing filter is a cross-tenant breach
B. Index per tenantStrong isolationThousands of small indexes; operational overhead
C. Pooled shards for small tenants, dedicated shards above a threshold, tenant key enforced by the query service (not the caller)Balance of cost and isolationTwo operating modes

Choice: C, with a separate encryption key per tenant for raw content and backups, and a query builder that adds the tenant filter itself and rejects any query without one. Tenant routing follows the cell pattern in Resilience and Load Shedding Design Template (system-design/resilience-load-shedding-design).

7.6 How real systems do it

How real systems do it (paraphrased from Microsoft Learn, "Security filter pattern" for Azure AI Search, page dated August 2026). The documented pattern stores the user and group identifiers that may read a document in a filterable string collection field that is not returned in results, and applies a filter at query time that matches any of the caller's identifiers using a set-membership function rather than a long chain of equality tests, which the page notes is slower and error-prone with many identifiers. The page also warns that hiding the field from results is not itself a security control: authorisation comes from applying the filter on every query. The same documentation points to built-in document-level access control support for sources where it is available. Design lesson: pre-filter by principals on every query and never rely on field visibility for protection (7.2).

8. Scalability and performance

ConcernApproachLimit before redesign
Corpus growthTenant-keyed shards, dedicated shards for large tenantsLargest single tenant in one shard group
Filtered vector searchEngine with in-traversal filtering; fall back to brute force for very selective filtersRecall drop when filters are very selective
Permission churnPartial ACL updates, revocations prioritisedSearch engine update throughput
Connector throughputRespect source rate limits, back-off, per-tenant concurrencySource API quotas
Generation costClassifier, answer cache keyed by permission set hashShare of question-type queries

Answer latency budget (target first token p95 2.5 s, Example):

StepBudget
Gateway, identity, group expansion60 ms
Lexical and vector retrieval in parallel150 ms
Fusion and rerank of 50200 ms
Late permission check (confidential sources only)300 ms
Generator time to first token1 200 ms
Headroom590 ms

Verification needs complete sentences: buffer the generator stream, release each sentence to the user only after it passes, or show the answer after verification when the interface does not stream. The first-token target therefore applies to the first verified sentence, and the verifier's time for that sentence comes out of the headroom.

9. Reliability, security and operations

9.1 Failure-mode table

ComponentFailureDetectionBlast radiusMitigationRTO
Permission syncStalled for one connectorSync lag above 15 minRevoked users may still see content from that sourceFail closed: exclude the connector from results when lag exceeds a hard limit30 min
Identity mappingUser not mapped after directory changeUnmapped identity countUser sees fewer resultsRe-sync directory; alert tenant admin1 h
Tenant shardNode lossShard healthSlower or partial results for tenants on that shardReplicas; rebuild from object storage30 min
Reranker poolSaturatedQueue depthLower ranking qualitySkip rerank, use fused order, mark degraded10 min
GeneratorOutageError rateNo answersReturn results onlyPer provider SLO
VerifierOutageError rateUnverified answersDo not show answers; results only15 min
ConnectorSource API changeParse error rateStale content for a sourceVersion pinning of connector, contract tests1 day

9.2 Security

Threat model per Threat Model Template (security/threat-model); privacy per Privacy Threat Model Template (security/privacy-threat-model).

IDThreatOWASP 2026Control
SEC-01User receives content they cannot read in the sourceLLM02:2026 Sensitive Information DisclosurePre-filter (7.2), late check, fail closed, canary leakage tests
SEC-02Content the user may not see reaches the model context and is revealed by follow-up promptsLLM08:2026 Hidden Context ExposureTreat the whole context as visible to the user; only permitted chunks enter it; no other tenant or admin content in system prompts
SEC-03Cross-tenant retrieval, embedding inversion of stored vectors, poisoned documents that rank for many queriesLLM09:2026 Vector and Embedding WeaknessesTenant-scoped shards and query builder; vectors encrypted at rest and never returned by the API; anomaly detection on chunks that appear in unusually many answers
SEC-04Indexed document contains instructions that steer the answerLLM01:2026 Prompt InjectionChunks marked as data in the prompt; no tools available to the generator; verifier checks support
SEC-05Answer states wrong policy with confidenceLLM07:2026 MisinformationCitation verification, "no verified answer" path, source dates shown
SEC-06Answer rendered as HTML with active contentLLM10:2026 Improper Output HandlingSanitised Markdown rendering, link allowlist to source domains
[SEC-nn][Threat][OWASP ID][Control]

Leakage testing: each tenant environment used for testing holds canary documents restricted to a canary group, with unique marker strings. A daily job queries as users outside that group and fails the build if any marker appears in results, answers or citations. Run the same test after every permission-related change.

9.3 Evaluation

Follow LLM Evaluation Plan Template (ai-data/llm-evaluation-plan).

MetricDefinitionTarget (Example)
Recall at 10Share of labelled relevant chunks in the top 10 after ACL filteringAt or above 0.85
nDCG at 10Ranking quality on graded relevance labelsTracked per release
Citation precisionShare of citations that support their sentenceAt or above 0.9
Citation recallShare of factual sentences with a supporting citationAt or above 0.9
FaithfulnessShare of answers with no unsupported sentenceAt or above 0.9
LeakageCanary markers returned to unauthorised usersZero
FreshnessTime from source edit to searchablep95 at or below 30 min

Labelled sets are built per tenant only with tenant consent; a synthetic cross-industry set covers releases.

9.4 Observability

Trace each query with retrieval, rerank, late check, generation and verification spans per LLM and Agent Observability Specification Template (ai-data/llm-observability-spec). Log chunk IDs, not chunk text.

SignalAlert threshold (Example)
Permission sync lag per connectorp95 above 15 min
Late-check disagreements (pre-filter allowed, source denied)Any sustained rate above 0.1%
Unverified answer rateAbove 10%
"Should not see this" feedbackAny report pages security on call

10. Trade-offs and alternatives

DecisionOptionsChosenWhyWhat we give up
Permission enforcementPost-filter; pre-filter; late binding; pre-filter plus late checkPre-filter plus late check for confidential sourcesCorrect candidate set, fresh where it mattersExtra latency on confidential sources
RetrievalLexical; vector; hybridHybrid with RRF and rerankMixed identifier and intent queriesMore components
VerificationNone; ID check; per-sentence entailmentPer-sentence entailmentUnsupported claims are the main failureLatency and cost
TenancyShared index; per tenant; pooled plus dedicatedPooled plus dedicatedCost and isolation balanceTwo modes to operate
What changes at 10x (6 billion documents, 2 250 queries/s)Regional cells per tenant group; ACL stored as compact principal bitmaps; reranker distilled to a smaller modelFilters and rerank become the bottleneckMore engineering in the search engine
What changes at 0.1x (40 tenants, 60 million documents)Single cluster with per-tenant indexes; managed search service; no dedicated reranker pool, hosted rerank APIFixed costs dominateLess control over latency
[Decision][Options][Chosen][Why][Cost]

11. Delivery plan and risks

11.1 Milestones

MilestoneScopeExit criterionTarget date
M1Two connectors, permission sync, search results onlyLeakage canary suite passes for 14 daysYYYY-MM-DD
M2Hybrid retrieval and rerankingRecall at 10 target on evaluation setYYYY-MM-DD
M3Answers with citations and verificationCitation precision and faithfulness targetsYYYY-MM-DD
M4Late check for confidential connectors; dedicated shardsPenetration test of tenant isolationYYYY-MM-DD
M5Remaining connectors, admin controlsPer-connector contract tests in CIYYYY-MM-DD

11.2 Rollout and rollback

[Example: Enable per tenant and per connector. Answers are off by default for a tenant until its leakage tests pass. Ranking and model changes roll out behind an index version alias; rollback switches the alias.]

11.3 Risks

IDRiskLikelihoodImpactMitigationOwner
R-01Example: A source exposes permissions incompletely through its APIMediumHighConnector certification; mark source confidential and use late check or exclude[@name]
R-02Example: Users trust unverified answersMediumMediumVerification, source dates, feedback[@name]
R-03Example: Generation cost above forecastMediumMediumClassifier, caching, model routing[@name]
R-04Example: Oversharing in the source becomes visible through searchHighMediumTenant admin report of widely shared sensitive items before launch[@name]
[R-nn][Risk][L / M / H][L / M / H][Mitigation][@name]

R-04 deserves attention: search does not create oversharing, but it makes existing oversharing easy to find. Offer tenants a pre-launch report.

12. Appendices

12.1 Traceability

RequirementDesign elementVerification
FR-02, NFR-017.2 pre-filter and late checkCanary leakage suite
FR-037.2 ACL-03, chunking on permission boundariesSection-restriction test documents
FR-04, FR-057.4 verificationCitation precision and faithfulness
NFR-027.2 ACL-06, sync designSync lag metric
NFR-067.5 tenancyPenetration test
[ID][Element][Test]

12.2 Open questions

IDQuestionOwnerDue
OQ-01Example: Do we index email at all, given per-message recipients?[@name]YYYY-MM-DD
OQ-02Example: Should tenants bring their own encryption keys?[@name]YYYY-MM-DD
[OQ-nn][Question][@name]YYYY-MM-DD

12.3 Glossary

TermMeaning
ACLAccess control list: principals allowed or denied
PrincipalUser, group or tenant-wide identity used in ACLs
Early bindingPermissions stored in the index and filtered at query time
Late bindingPermissions checked against the source at query time
RRFReciprocal rank fusion of several ranked lists
Cross-encoderModel that scores a query and passage together for reranking
FaithfulnessAnswer claims supported by the provided sources

12.4 References

ReferenceUse
OWASP Top 10 for LLM Applications 2026, OWASP GenAI Security Project, https://genai.owasp.org/Threat mapping in 9.2
Cormack, Clarke and Buettcher, "Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning Methods", SIGIR 2009 (doi:10.1145/1571941.1572114)RRF in 7.3
Lewis et al., "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks", NeurIPS 2020 (arXiv:2005.11401)RAG pattern
Gao et al., "Enabling Large Language Models to Generate Text with Citations", EMNLP 2023 (arXiv:2305.14627)Citation quality metrics in 9.3
Microsoft Learn, "Security filter pattern", Azure AI Search, https://learn.microsoft.com/en-us/azure/search/search-security-trimming-for-azure-searchBox in 7.6
RAG System Design Template (ai-data/rag-system-design)Single-application pipeline details
Guardrails Specification Template (ai-data/guardrails-spec)Input and output guardrails
LLM Inference Serving System Design (system-design/design-llm-inference-serving)Model and vector index serving

Standard and licence note

Based on the OWASP Top 10 for LLM Applications 2026 by the OWASP GenAI Security Project (https://genai.owasp.org/), licensed under Creative Commons Attribution-ShareAlike 4.0 (https://creativecommons.org/licenses/by-sa/4.0/), and on the published research and public documentation in 12.4. The OWASP IDs and short names are used for the mapping in 9.2; all descriptions and controls are original text. Because that mapping adapts the OWASP structure, the adapted structure is shared under CC BY-SA 4.0 and any further adaptation must carry the same licence. The box in 7.6 paraphrases public documentation and copies no text. All numbers are illustrative examples, not benchmarks. Check the current official versions of each source before use. Apart from the adapted OWASP structure, the original text is under the template licence. Template licence: MIT.

Plantillas relacionadas