Start with a bounded information task
Retrieval-augmented generation supplies a language model with selected source material at request time. It can help answer questions about internal information, but it adds a retrieval system, an ingestion process and a permission boundary to the application. An answer with a citation can still misrepresent its source.
Choose an initial task that an accountable reviewer can assess. For an illustrative internal policy assistant, define which policy collection is authoritative, which users may ask questions, and what the assistant must do when the policy does not answer. Begin with read-only assistance; actions in business systems require a separate authorization and execution design.
Separate ingestion from the request path
The ingestion path collects approved documents, extracts text, preserves document structure and creates searchable chunks. Store source identifiers, section locations, document version, ownership and access metadata alongside each chunk. Preserve enough context to distinguish a current policy from an obsolete attachment or an exception applying to another business unit.
The request path authenticates the user, determines permitted sources, retrieves candidates, assembles bounded context and produces an answer with resolvable references. Keep a trace of the source versions and retrieval configuration used for each response, while limiting sensitive text in logs. This separation makes ingestion failures visible without turning every question into a document-processing job.
Enforce authorization before content reaches the model
Apply tenant and document permissions in application-controlled retrieval. A prompt asking a model to respect permissions does not enforce access control. Test the search service, caches and citation endpoints with users who have different permissions; a protected document must not become accessible through an answer, snippet, shared cache or reference link.
Carry source access changes into the index and define behavior while permissions are being synchronized. When authorization cannot be established, return a controlled failure rather than broadening the search. Treat retrieved text as untrusted data: instructions inside a document must not change application permissions or grant tool access. Input screening and prompt-injection checks supplement these boundaries; they cannot guarantee prevention.
Tune retrieval against representative questions
Compare lexical, vector and hybrid retrieval using questions drawn from the intended task. Exact identifiers, product codes and unfamiliar terminology often need different retrieval behavior from conversational questions. Evaluate chunk boundaries and reranking against the same question set before introducing a more complex query planner.
Record whether the relevant evidence appears in the retrieved candidates before judging the generated response. A generation change cannot reliably compensate for missing evidence. Include questions with competing versions, no answer, ambiguous intent and terminology from different departments. Measure retrieval and answer quality separately so a regression has an identifiable cause.
Treat freshness and deletion as operating requirements
Agree how quickly published changes, revoked access and deletions must propagate. Version ingestion jobs and track failed or partial updates. A successful connector request does not establish that every document is searchable or that deleted chunks are gone. Reconcile the source inventory with the index and test recovery after interrupted processing.
Use cache keys that account for authorization scope and relevant content versions. Give answer and retrieval caches an explicit invalidation policy. If a required collection is stale or unavailable, make the limitation visible and offer a source-navigation or human-review path instead of silently presenting the answer as current.
Make the release decision inspectable
Build a reviewed evaluation set containing expected sources, acceptable answer characteristics and refusal cases. Assess evidence coverage, citation correctness, unsupported assertions, permission isolation, latency and cost per completed task. Test whether reviewers can recognize an unsupported answer and reach the underlying source. Set thresholds according to the consequence of error rather than an arbitrary overall accuracy score.
Version the model, prompt, corpus and retrieval settings together. Re-run the evaluation when any of them changes, and retain a rollback path. The release record should include failed examples, known limitations, a monitoring owner and the conditions that require a pause. These are design recommendations to adapt to your environment, not a claim that testing eliminates AI errors.
- Document source ownership and access rules.
- Test missing evidence, source changes and unauthorized requests.
- Record evaluation results and unresolved failure cases.
- Assign monitoring, rollback and escalation responsibilities.
