Follow the document beyond the upload

A RAG application usually creates several representations of a source: extracted text, chunks, embeddings, index entries and retrieved context. It may also retain prompts, responses or caches depending on its design. Approving the original file is not enough if the ingestion process creates a different representation with a different audience or retention period.

Draw the actual path used by the proposed system. Name the service and owner at each step. Include the source repository, extraction process, model endpoints, storage and user-facing application. The purpose of the map is to reveal where an approved document becomes another copy and where a permission or deletion decision must be enforced again.

Define the knowledge task before selecting documents

A collection of available files is not automatically a suitable knowledge base. State which questions the application should answer, for which users and for what purpose. That decision determines which information is necessary and which documents should stay outside the first corpus.

For an illustrative internal policy assistant, approved policy documents may be sufficient; individual employee records may add exposure without helping the intended task. A contract-analysis use can require a different corpus and audience. These examples are design choices, not statements about a legal basis. The relevant business and information owners must approve the actual scope.

Create a controlled source-to-output relationship

Keep the authoritative source separate from the approved input copy. Record an identifier, version, owner, intended use and access scope for each document admitted to the corpus. Where redaction is applied, preserve a controlled link between that decision and the resulting representation.

Do not allow the ingestion job to fall back silently to the original file when an approved copy is missing. A source relationship should support change control without exposing the original to every downstream user. Recovery material, if used by an internal process, needs a separate boundary from the retrieval corpus.

Decide what must be removed and what must remain

A useful redaction policy is tied to the knowledge task. Removing all names or dates may destroy the relationships needed to interpret a policy exception or a contract obligation. Retaining everything may expose details unrelated to the approved questions.

Describe the categories to remove, allowed exceptions and cases that require review. Include examples of necessary context: a role rather than an individual's name, a contract identifier used to locate an approved source, or a date needed to distinguish current policy from superseded guidance. The chosen treatment must be justified for the actual use rather than copied from a generic sensitive-field list.

Validate the representation that will be indexed

Inspect the extracted text or other actual input after redaction. A clean-looking file can be processed differently by another parser. Conversely, an image-only output may lose information the retrieval task needs. Verify both the removal decision and the usefulness of the resulting representation.

Adobe’s PDF redaction instructions include an option to sanitise the document and remove hidden information. This PDF-specific example is a reason to inspect final file contents; it does not establish that a RAG system or another product satisfies a legal obligation. Validate the actual parser input separately and keep any applicable legal assessment distinct.

Carry source permissions into chunks and retrieval

A document's access scope must remain meaningful after chunking and indexing. Identify the metadata the retrieval service needs to enforce the approved audience. Check the implementation at query time as well as during ingestion, because users and permissions can change after the corpus is built.

OWASP's vector and embedding risk guidance identifies unauthorised retrieval and cross-context leakage as risks. The tests below are proposed implementation checks; they do not establish that a particular permission mechanism is sufficient for every deployment.

  • Query the same topic using accounts with different document permissions.
  • Include a restricted source that is semantically close to an allowed source.
  • Check citations, snippets and previews as well as the generated answer.
  • Change a user's group membership and repeat the query.
  • Verify that shared caches do not return another audience's earlier result.

Treat retrieved text as evidence, not an instruction

An approved source can still contain content that should not control the application. A document may quote a command, describe an adversarial instruction or contain text inserted by an untrusted party. Decide which sources can enter the corpus and who can replace them.

Use the application design to separate source content from system instructions. Test a deliberately labelled adversarial sample in the authorised evaluation environment. The expected result should reflect the system's intended behaviour, such as declining to follow an instruction embedded in retrieved material. Redaction of identifiers does not address this source-integrity problem by itself.

Evaluate retrieval usefulness alongside removal

A document may be safer to share yet no longer useful for the approved question. Build an evaluation set of representative questions with expected source references and acceptable answers. Include questions that require relationships across passages, since redaction and chunk boundaries can make those relationships harder to recover.

Record when the system should say that the available information is insufficient. A failure to answer a question can be the correct result when the necessary source is outside the user's scope. Do not improve apparent answer coverage by weakening the permission boundary or retrieving a broader corpus without approval.

Test the pipeline at its failure points

A successful sample query demonstrates only one route. Include an extraction failure, an unsupported file, missing permission metadata and an unavailable source. Decide which conditions must stop ingestion or retrieval and who receives the resulting issue.

Test case Expected decision to define Evidence to retain
Missing approved copy Stop or use an explicitly approved alternative Job state and selected input
Incomplete access metadata Prevent unscoped ingestion or retrieval Rejected record and error handling
Restricted near-match source Keep that source outside the user's result Account, query and returned references
Changed source version Replace or invalidate derived material Source-to-index update result
Failed removal request Escalate instead of claiming deletion Affected stores and unresolved action

Set output rules for the actual audience

A response may combine information from several individually permitted passages. That combination can reveal something more sensitive than any one snippet. Review whether the application should summarise, quote, cite or decline different question types. Apply a handling rule to the response that matches the intended use.

Keep evidence for human review when the answer will support a significant decision. A source citation helps a reviewer inspect the basis of the answer; it does not make the answer correct automatically. Test whether a user can open the cited approved source without gaining access to a broader original or a restricted attachment.

Include temporary data and logs in the processing map

Inspect the selected configuration at each processing stage:

  • During extraction, identify whether logs retain source text.
  • During embedding, identify what processing content is recorded.
  • During retrieval, check whether query content is retained.
  • During generation, check whether answers are logged and who can read them.

Logs can be useful for troubleshooting but may also contain sensitive material. Confirm the actual logging behaviour and permissions rather than relying only on the intended configuration.

Decide what is necessary for investigation and what can be omitted or minimised. Assign an owner for access and retention decisions. Processing region should be verified for each relevant service and copy rather than inferred from the source repository's location. Record unresolved questions before treating the workflow as ready for sensitive production input.

Make updates and deletion propagate

A source document can be replaced, withdrawn or assigned a new audience. The corresponding chunks, index entries, caches and other retained representations need a defined response. A document deleted from the source folder may still exist in derived stores if the pipeline does not handle that event.

Keep a source-to-derived relationship that lets the team identify the affected material. Test a replacement and a withdrawal using known samples. Verify what users can retrieve afterwards, and inspect agreed administrative records. Where a store cannot be removed immediately under the design, describe the actual handling and restriction rather than claiming instant deletion across the entire system.

Assign operating responsibilities before expansion

The document owner approves the information and its intended use. The ingestion owner maintains processing and change propagation. The application owner is responsible for retrieval and output behaviour. Reviewers need a route for reporting a wrong answer, unexpected source or exposure concern.

These responsibilities can be held by a small team, but the handoffs should remain explicit. Otherwise a source change may be considered complete by one team while another continues serving an older representation. Use a shared issue identifier for an incident or change so that the source, index and user-facing result can be checked together.

Start with a bounded corpus and an exit decision

A first pilot should use approved documents and a defined audience, with enough variation to test the intended task. Build the evaluation questions before tuning the retrieval system so that the test remains meaningful. Keep the results for usefulness, removal, access, failure handling and lifecycle changes separate.

  1. Confirm the source list, audience and permitted questions.
  2. Prepare and review the approved input representation.
  3. Verify ingestion and permission metadata.
  4. Run allowed, denied and insufficient-information queries.
  5. Replace and withdraw sources, then repeat the relevant tests.
  6. Decide whether to proceed, revise the scope or stop, with unresolved conditions recorded.

Where bestCoffer belongs in the design

bestCoffer AI Redaction can be considered for preparing sensitive documents before approved AI processing. Its role does not establish every downstream retrieval, cache or model control. Confirm formats, processing location, output properties and any integration for the particular deployment.

Use the AI redaction guide for the preparation and review process, and the RAG redaction workflow guide for a more focused implementation discussion. A useful design leaves a traceable path from an approved source and purpose to the representation a particular user can retrieve.

Questions and answers

Does redaction make a RAG corpus unrestricted?

No. A processed document may remain confidential, and retrieval, source integrity, output handling and retention still need their own controls.

Should access be checked only when a document is indexed?

No. The design should account for later permission and membership changes and enforce the required audience boundary when information is retrieved or served.

Are embeddings equivalent to anonymised data?

Do not assume that they are. Their exposure and handling need assessment within the actual system, source content and access model.

Why test deletion and replacement?

The source can change while derived chunks, indexes or caches remain available. Tests should establish how the implemented pipeline handles those events.

What should a pilot measure?

Keep task usefulness, incorrect or unnecessary removal, access boundaries, failure behaviour and source lifecycle results separate. A single answer-quality score does not cover all of them.

Sources and method

The trial procedures and worksheets are editorial recommendations for teams to adapt. References explain relevant concepts and risks; they do not certify a product or establish a legal or compliance outcome.

Test your document workflow

Discuss the documents, reviewer roles and trial samples with bestCoffer to confirm the applicable deployment and product scope.

Contact the team