Deconvolute is a defense-in-depth SDK designed to secure every stage of your Retrieval Augmented Generation (RAG) pipeline.
Project description
Deconvolute: The RAG Security SDK
⚠️ Pre-alpha development version
Protect your RAG pipeline from Indirect Prompt Injection and Poisoned Knowledge.
Deconvolute is a defense-in-depth SDK designed to secure every stage of your Retrieval Augmented Generation (RAG) pipeline. It supports both asynchronous and synchronous usage.
The Threat Model: To understand the full range of attacks this SDK defends against from front-door injections to back-door corpus poisoning read the survey report: The Hidden Attack Surfaces of RAG.
Getting Started
First, install the core package using pip:
pip install deconvolute
Optional Features: To use the Language Detection module, install the extra:
pip install deconvolute[language]
Usage
Deconvolute is architected to defend the critical threat surfaces of an AI Agent or RAG pipeline, with a primary focus on preventing Poisoned Knowledge and Indirect Prompt Injection.
See the Usage Guide & API Docs for detailed code examples, configuration options, and integration patterns.
1. Context Defense (The Backdoor)
Prevent Indirect Prompt Injection via RAG.
This is the core focus of Deconvolute. Attackers hide malicious instructions in trusted documents (e.g. PDFs, white text on web pages) to hijack the model during retrieval.
- Scanners: Detect Vector Magnets (content optimized to force retrieval) before they enter your database.
- Sanitizers: Enforce instruction hierarchy during the retrieval step to isolate trusted system instructions from untrusted retrieved data.
2. Output Defense
Verify LLM Integrity and Adherence.
Even if an attack bypasses the first layer, you can catch it at the output.
- Canary Detection: Injects a cryptographic token into the system prompt and verifies if the LLM includes it in the final response. If the token is missing, the model likely ignored your instructions (Jailbreak).
- Language Verification: Ensures the output language matches the input language or a specific allow-list, preventing Payload Splitting attacks where the model hides malicious output in a foreign language.
3. Input Defense (The Front Door)
Filter User Prompts.
While Deconvolute focuses on the backdoor, the same detection engines can be applied to user inputs. Future modules will support signature-based detection of known Jailbreak patterns in user chat messages.
Feature Status
| Module | Feature | Status | Description |
|---|---|---|---|
| Generation | Canary Token | Active integrity checks using cryptographic tokens to detect jailbreaks. | |
| Generation | Language Filter | Input-Output correspondence checks to prevent payload splitting. |
Note on status:
- Planned: On the roadmap; not yet implemented.
- Experimental: Functionally complete and unit-tested, but not yet red-teamed. Use with caution in production.
- Validated: Empirically tested against SOTA models with results published in benchmarks..
Further Information
- User Guide & API Documentation
- Deconvolute Benchmarks: Detailed efficacy results and code to reproduce results easily.
CONTRIBUTING.md: For developers who want to build, test, or contribute to the project.
References
Click to view academic sources
Wallace, Eric, Kai Xiao, Reimar Leike, Lilian Weng, Johannes Heidecke, and Alex Beutel. "The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions." arXiv:2404.13208. Preprint, arXiv, April 19, 2024. https://doi.org/10.48550/arXiv.2404.13208.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deconvolute-0.1.0a5.tar.gz.
File metadata
- Download URL: deconvolute-0.1.0a5.tar.gz
- Upload date:
- Size: 77.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
712f678bd0b05cd9921d4472284ce093278dcc7c9e9e565627c0fa24e3efd8c7
|
|
| MD5 |
aea8ffcf727fe837f0d4836e50e6fba0
|
|
| BLAKE2b-256 |
04cdfb2e4c8e07496da54313bd7d9a3ba73fbcd656d8b991db96d47983f6816c
|
Provenance
The following attestation bundles were made for deconvolute-0.1.0a5.tar.gz:
Publisher:
release.yml on daved01/deconvolute
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deconvolute-0.1.0a5.tar.gz -
Subject digest:
712f678bd0b05cd9921d4472284ce093278dcc7c9e9e565627c0fa24e3efd8c7 - Sigstore transparency entry: 830897580
- Sigstore integration time:
-
Permalink:
daved01/deconvolute@345fd540e3dd329360cca6ce9d5fce89138c345f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daved01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@345fd540e3dd329360cca6ce9d5fce89138c345f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file deconvolute-0.1.0a5-py3-none-any.whl.
File metadata
- Download URL: deconvolute-0.1.0a5-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80f2717b8b5cf7fbeae903dc6814945c17094da99df7c2d4d829a3708260d05f
|
|
| MD5 |
f47c8e6195e67b17cc73be1cf0236a08
|
|
| BLAKE2b-256 |
0565d82e3d07ef86af66f77d949648fc14d350395d7bda294ac92091cc086a5d
|
Provenance
The following attestation bundles were made for deconvolute-0.1.0a5-py3-none-any.whl:
Publisher:
release.yml on daved01/deconvolute
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deconvolute-0.1.0a5-py3-none-any.whl -
Subject digest:
80f2717b8b5cf7fbeae903dc6814945c17094da99df7c2d4d829a3708260d05f - Sigstore transparency entry: 830897588
- Sigstore integration time:
-
Permalink:
daved01/deconvolute@345fd540e3dd329360cca6ce9d5fce89138c345f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daved01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@345fd540e3dd329360cca6ce9d5fce89138c345f -
Trigger Event:
workflow_dispatch
-
Statement type: