Implementation Guide

Quarantining Newly Ingested Documents Before They Reach a RAG Index

RAG document quarantine is a distinct stage between ingestion and indexing. New documents land in isolated storage that retrieval and models cannot read. They pass a defined set of checks, receive a policy decision to release, reject or hold for review, and only released content is chunked and embedded with verified metadata and access controls. Every decision is logged, and released content stays eligible for re-evaluation.

What a quarantine stage is and why it is separate

A quarantine stage sits between ingestion and indexing. Connectors write new documents to isolated staging storage, and neither the retrieval service nor the model runtime can read that storage. Nothing reaches the index until it has been evaluated and a policy decision has been made.

Keeping the stage separate is what makes the control enforceable. If the component that ingests documents can also write to the index, evaluation becomes advisory. A separate stage, with its own permissions, means that content is released by a decision rather than by default.

  1. IngestConnectors write to isolated staging only.
  2. EvaluateSandboxed workers run pre-index checks.
  3. DecidePolicy returns release, reject or review.
  4. ReleaseApproved content is indexed with verified metadata.
  5. Re-evaluateReleased content is rechecked when conditions change.
Quarantine as a control stage: five steps from ingestion to re-evaluation.

Pipeline architecture: components and boundaries

The design goal is that no component with index write access can act on a document that has not been evaluated, and no component that reads for retrieval can see staged content.

Pipeline components and the boundary each one enforces
ComponentBoundary and behavior
1. Ingestion connectorsWrite only to the staging location. Their credentials have no access to the index or the retrieval service.
2. Staging storageA separate store with its own encryption keys and access policy. The retrieval service and model runtime identities have no read permission.
3. Work queueEach arrival creates a job. Retries and dead-letter handling ensure that a failed evaluation leaves the document held, never released.
4. Evaluation workersParse untrusted files in a sandbox, with network egress restricted where practical, and write results to the decision record.
5. Release gateThe only component allowed to hand documents to the index pipeline. It confirms the content hash matches the hash that was evaluated.
6. Index pipelineChunks, embeds and writes content using metadata taken from the decision record, not from the document itself.

Validation checks and their limits

Evaluation workers run pre-index checks on the text that will be indexed. The checks named in this guide are:

  • File checks
  • Malware checks
  • Sensitive data checks
  • Prompt injection checks
  • Provenance checks
  • Permission checks

Because untrusted files are parsed during evaluation, workers run in a sandbox, with network egress restricted where practical. Results are written to the decision record rather than acted on directly.

Release, reject and review decisions as policy

Each document receives one of three outcomes, defined by policy rather than by individual judgment at the time of ingestion.

Policy outcomes and what follows from each
OutcomeResult
ReleaseThe release gate hands the document to the index pipeline, where it is chunked and embedded with verified metadata and access controls.
RejectThe document is not released to the index pipeline.
ReviewThe document is held for review until a decision is made.

Write release, reject and review rules as versioned policy, with logged overrides by a separate role. Metadata and access labels are assigned by the gate and attached to every chunk. They come from the decision record, not from the document itself.

Audit records and re-evaluation after release

Log each decision, including overrides. Map every document to the chunk identifiers created from it, so that a decision can be traced to the content in the index and the reverse.

Release is not the end of evaluation. Released content stays eligible for re-evaluation, so define re-evaluation triggers in advance and record the outcome of each re-evaluation alongside the original decision.

Implementation checklist

  • Separate staging storage from the index, with no read access for retrieval or model identities.
  • Remove index write access from connectors and route all content through the release gate.
  • Run file, malware, sensitive data, prompt injection, provenance and permission checks on the text that will be indexed.
  • Write release, reject and review rules as versioned policy, with logged overrides by a separate role.
  • Attach gate-assigned metadata and access labels to every chunk.
  • Log each decision, map documents to chunk identifiers, and define re-evaluation triggers.

Plan the quarantine and release decision points

Discuss how runtime policy enforcement, least-privilege access and audit logging can support quarantine and release controls in your RAG and agent environment.

Talk to an Expert