Vigil
Vigil is a Python library and REST API for assessing LLM prompts and responses against a set of scanners to detect prompt injections, jailbreaks, and other threats. It provides detection signatures and datasets for self-hosting. It is intended for developers and researchers looking to add a security layer to their LLM applications.
✨ Key features
- Analyze LLM prompts for common injections and risky inputs
- Use as Python library or REST API
- Modular and extensible scanners
- Supports local embeddings and/or OpenAI
- Custom detections via YARA signatures
- Streamlit web UI playground
🎯 Use cases
- Detect prompt injection attempts in user inputs
- Monitor LLM responses for jailbreak patterns
- Add canary tokens to prompts to detect leakage
- Build a security layer for LLM-powered applications
📦 Installation
🧰 Requirements: Requires Python 3, YARA v4.3.2, and optionally an OpenAI API key for embeddings. A Docker container is available but not recommended.
git clone https://github.com/deadbits/vigil-llm.git
cd vigil-llm
Install YARA following the instructions at YARA Getting Started.
python3 -m venv venv
source venv/bin/activate
pip install -e .
Configure conf/server.conf as needed. Load datasets with:
python loader.py --conf conf/server.conf --dataset deadbits/vigil-instruction-bypass-ada-002
python loader.py --conf conf/server.conf --dataset deadbits/vigil-jailbreak-ada-002
🚀 Usage
from vigil.vigil import Vigil
app = Vigil.from_config('conf/openai.conf')
# assess prompt against all input scanners
result = app.input_scanner.perform_scan(
input_prompt="prompt goes here"
)
# assess prompt and response against all output scanners
app.output_scanner.perform_scan(
input_prompt="prompt goes here",
input_resp="LLM response goes here"
)
⚠️ Good to know
Vigil is in alpha state and experimental; it is not a complete defense and should be used alongside other security controls.
❓ FAQ
What scanners are available?
Available scanners include vector database, YARA/heuristics, transformer model, prompt-response similarity, and canary tokens.
Can I use Vigil as a REST API?
Yes, you can run the API server with python vigil-server.py --conf conf/server.conf and use endpoints like /analyze/prompt and /analyze/response.
How do I add custom detections?
You can add custom YARA signatures for detection.
What is the purpose of canary tokens?
Canary tokens are used to detect prompt leakage or goal hijacking by adding unique tokens to prompts and checking if they appear in responses.
📊 Repository
🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.