rag-sanitizer v0.2 adds real embeddings and CLIP to catch poisoned RAG corpora early
Developer amurlaniakea has released rag-sanitizer v0.2, an open-source tool designed to detect poisoned documents in Retrieval-Augmented Generation (RAG) corpora before they are chunked and embedded into a vector store. Unlike most defenses that operate post-retrieval, the tool scans upstream, flagging threats such as semantic mimicry, entity-swapping, and visual poisoning where image content contradicts document text. Version 0.2 introduces real embeddings via MiniLM and multimodal detection using OpenAI's CLIP model, with each document receiving a verdict of CLEAN, SUSPECT, or POISON along with supporting reasons. An independent audit caught a bug in the CLIP similarity scoring logic, leading to recalibration of the detection threshold from 0.5 to 0.25 to reduce false positives. The tool is available on GitHub with known limitations documented openly, including reduced reliability for mimicry detection on short fluent text and a CLIP threshold calibrated on synthetic low-resolution images.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in