llama-index-postprocessor-ragdefender
RAGDefender as a LlamaIndex
BaseNodePostprocessor. It sits after retrieval and drops passages that look
like a knowledge-corruption (poisoning) attack before they reach the LLM,
using the method from Rescuing the Unpoisoned: Efficient Defense against
Knowledge Corruption Attacks on RAG Systems (ACSAC 2025,
arXiv:2511.01268). No LLM calls, no
training; one embedding pass plus clustering.
pip install llama-index-postprocessor-ragdefender
from llama_index.postprocessor.ragdefender import RAGDefenderPostprocessor
query_engine = index.as_query_engine(
similarity_top_k=10,
node_postprocessors=[RAGDefenderPostprocessor(task_type="single_hop")],
)
task_type is "single_hop" for factoid questions answered by one passage or
"multi_hop" for questions that need several. Node metadata, scores and
retrieval order are preserved; retrieval sets smaller than min_passages
(default 3) pass through untouched.
This package is a thin namespace wrapper: the class is implemented in
ragdefender.integrations.llama_index
and documented in
docs/integrations.md.
Issues: https://github.com/SecAI-Lab/RAGDefender/issues.
Metadata
Release files for llama-index-postprocessor-ragdefender 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_postprocessor_ragdefender-0.3.0.tar.gz | 3.4 kB | With provenance | Details for llama_index_postprocessor_ragdefender-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_postprocessor_ragdefender-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_postprocessor_ragdefender-0.3.0-py3-none-any.whl |
Total release size: 6.8 kB
Release files / llama_index_postprocessor_ragdefender-0.3.0.tar.gz
| Download URL | llama_index_postprocessor_ragdefender-0.3.0.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0177841f87b4f15501a2b06911999a28c7241f0693d41fbb110a12d9edd46134
|
|
BLAKE2b-256 checksum How to use checksums |
0c1cdbf88641b42d0b5ba668c134ddd4c874ef0dbbc44d27b880ffe0e1d82fe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / llama_index_postprocessor_ragdefender-0.3.0-py3-none-any.whl
| Download URL | llama_index_postprocessor_ragdefender-0.3.0-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a5cfbabc76e16894ddd9931f01cf50ee322e8e4e5607788da7c861fc0cb1d0b6
|
|
BLAKE2b-256 checksum How to use checksums |
c5f304501b04c9a9cc377865978ba622d28158f4d5f8c91815d8e3f0d0c2e33c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for llama-index-postprocessor-ragdefender 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for llama_index_postprocessor_ragdefender-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.