Skip to main content

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

CI License PyPI version Supported Python versions

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)

Status: Planned

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

Status: Experimental

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)

Status: Planned

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 Status: Experimental Active integrity checks using cryptographic tokens to detect jailbreaks.
Generation Language Filter Status: Experimental 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deconvolute-0.1.0a5.tar.gz (77.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deconvolute-0.1.0a5-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

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

Hashes for deconvolute-0.1.0a5.tar.gz
Algorithm Hash digest
SHA256 712f678bd0b05cd9921d4472284ce093278dcc7c9e9e565627c0fa24e3efd8c7
MD5 aea8ffcf727fe837f0d4836e50e6fba0
BLAKE2b-256 04cdfb2e4c8e07496da54313bd7d9a3ba73fbcd656d8b991db96d47983f6816c

See more details on using hashes here.

Provenance

The following attestation bundles were made for deconvolute-0.1.0a5.tar.gz:

Publisher: release.yml on daved01/deconvolute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for deconvolute-0.1.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 80f2717b8b5cf7fbeae903dc6814945c17094da99df7c2d4d829a3708260d05f
MD5 f47c8e6195e67b17cc73be1cf0236a08
BLAKE2b-256 0565d82e3d07ef86af66f77d949648fc14d350395d7bda294ac92091cc086a5d

See more details on using hashes here.

Provenance

The following attestation bundles were made for deconvolute-0.1.0a5-py3-none-any.whl:

Publisher: release.yml on daved01/deconvolute

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page