Ensemble Prompt Injection Detection
Project description
PromptForest - Fast and Reliable Injection Detector Ensemble
PromptForest is a prompt injection detector ensemble focused on real-world latency and reliability.
We rely on an ensemble of small, accurate prompt detection models using a voting system to generate accurate detections.
By comparing predictions across multiple models, the system can flag prompts where models disagree, helping to reduce the risk of false negatives.
This discrepancy score enables downstream workflows such as:
- Human-in-the-loop review for high-risk or ambiguous prompts
- Adaptive throttling or alerting in production systems
- Continuous monitoring and model improvement
Supported Models
| Provider | Model Name |
|---|---|
| Meta | Llama Prompt Guard 86M (Built with Llama) |
| ProtectAI | DebertaV3 Prompt Injection Finetune |
| Deepset | DebertaV3-base Injection Finetune |
| Katanemo | Arch-Guard |
| Appleroll | PromptForest-XGBoost |
Performance
Request Latency
Best Case: 50ms
Worst Case: 200ms
Accuracy
Preliminary results indicate ensemble performance is at least as good as any individual model. Extensive benchmarking is ongoing.
Quick Start
To use PromptForest, simply install the pip package and serve it at a port of your choice. It should automatically start downloading the default model ensemble.
Gated models are downloaded through our own ensemble github respository and are released in accordance to their terms and conditions.
pip install promptforest
promptforest serve --port 8000
Disclaimer & Limitations
PromptForest uses a combination of open-source and third-party machine learning models, including models and weights released by other organizations under their respective licenses (e.g. Meta LLaMA Prompt Guard and other public prompt-injection detectors). All third-party components remain the property of their original authors and are used in accordance with their licenses.
PromptForest is not a standalone security solution and should not be relied upon as the sole defense mechanism for protecting production systems. Prompt injection detection is an inherently adversarial and evolving problem, and no automated system can guarantee complete protection.
This project has not yet been extensively validated against real-world, large-scale, or targeted prompt-injection attacks. Results may vary depending on deployment context, model configuration, and threat model.
PromptForest is intended to be used as one layer in a defense-in-depth strategy, alongside input validation, output filtering, access control, sandboxing, monitoring, and human oversight.
License
This project is licensed under Apache 2.0. Third-party models and weights are redistributed under their original licenses (see THIRD_PARTY_LICENSES folder for details). Users must comply with these licenses.
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 promptforest-0.1.1.tar.gz.
File metadata
- Download URL: promptforest-0.1.1.tar.gz
- Upload date:
- Size: 263.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d9ea5d93d3ed2acb4c8f5b341305b3ba662444c71ff0433e522eae3ebcb1aad
|
|
| MD5 |
32699687fc74c08e0fb5baa47b281cdc
|
|
| BLAKE2b-256 |
574064e874fd8f40f0699ced06a7dccdd83d18167c94373505cb9addc3ebc3be
|
File details
Details for the file promptforest-0.1.1-py3-none-any.whl.
File metadata
- Download URL: promptforest-0.1.1-py3-none-any.whl
- Upload date:
- Size: 266.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb97a22465d8f32f08b09c5dfa5b0e6a31a83c3afbd7ed565d79f1391e727177
|
|
| MD5 |
1e8364f0a0727065dc05f5c74a260b18
|
|
| BLAKE2b-256 |
79415ff530649618649466c3dd642e72fe1d7f62c3cb3b92cdfb249e5eb32bdf
|