RAG — inspect retrieved text
In a retrieval pipeline, inspect each chunk after retrieval and before prompt assembly. Detection, not prevention — your app decides how to review or omit a chunk.
Detection, not prevention. A successful run with no findings means the check did not flag the submitted text — not that the chunk is safe to use.
Where inspection sits
Wire the check into the retrieval path at one place:
- Retrieve candidate chunks from your index or uploads.
- Inspect each chunk’s text after retrieval and before prompt assembly (API field source=retrieved_document is a text-type label, not source-aware policy).
- Assemble the prompt only from chunks you keep after review.
- Your app owns timeouts, omissions, and any human review — ANANZI returns findings, not enforcement.
What that does not guarantee
- Not prevention: findings do not block traffic, drop chunks, or stop attacks by themselves.
- Not a permission check: inspection does not verify the caller may read the document.
- Not source-aware policy: this check does not vary rules by corpus, tenant, or tool — that is not guaranteed and is out of scope for this product slice (not a shipped feature).
- Not calibrated safety: a score is not a verified probability of attack; decisions are only review or no_findings — never safe, allow, or block.
- Scaffold / mock today: this build does not serve a live model; do not treat the page as measured coverage.
Integration sketch
Scaffold preview — not a live API call. Start in monitor-only mode.
# RAG path (scaffold) 1. retrieve chunks 2. POST inspect source=retrieved_document checks=[prompt_injection] 3. on review → omit or escalate the chunk 4. on no_findings → proceed (check did not flag — not a safety guarantee) 5. assemble prompt → call your model
Article: detector timeouts and fail-closed handling · prompt_injection product page · secrets product page · Local docs live in apps/docs (Starlight). Deploy is tracked separately.