# Vigil

<div align="left"><figure><img src="https://1327977903-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEzo8o9vJPcrh2UB6tKuV%2Fuploads%2FJgIbwrmKRy3hyNZuK0lv%2Flogo.png?alt=media&#x26;token=93232105-9456-458c-85cb-edee6814cfd7" alt=""><figcaption></figcaption></figure></div>

## Overview 🏕️

`Vigil` is a Python library and REST API for assessing Large Language Model prompts and responses against a set of scanners to detect prompt injections, jailbreaks, and other potential risks. This repository also provides the detection signatures and datasets needed to get started with self-hosting.

* **Repo**:[ https://github.com/deadbits/vigil-llm](https://github.com/deadbits/vigil-llm)

This application is currently in an **alpha** state and should be considered experimental.

Work is ongoing to expand detection mechanisms and features.

### Highlights ✨

* Analyze LLM prompts for common injections and risky inputs
* Use Vigil as a Python library or REST API
* Evaluate detections and pipelines with **Vigil-Eval** (coming soon)
* Scanners are modular and easily extensible
* Available scan modules
  * [x] [Vector database / text similarity](https://vigil.deadbits.ai/overview/use-vigil/scanners/vector-database)
    * [Auto-update vector database with detected prompts](https://vigil.deadbits.ai/overview/use-vigil/configuration/auto-updating-vector-database)
  * [x] [Heuristics via YARA](https://vigil.deadbits.ai/overview/use-vigil/scanners/yara-heuristics)
  * [x] [Transformer model](https://vigil.deadbits.ai/overview/use-vigil/scanners/transformer)
  * [x] [Prompt-response similarity](https://vigil.deadbits.ai/overview/use-vigil/scanners/prompt-response-similarity)
  * [x] [Canary Tokens](https://vigil.deadbits.ai/overview/use-vigil/scanners/canary-tokens)
  * [ ] Sentiment analysis
  * [ ] Relevance (via LLM)
* Supports [local embeddings](https://www.sbert.net/) and/or [OpenAI](https://platform.openai.com/)
* Signatures and embeddings for common attacks
* Custom detections via [YARA signatures](https://yara.readthedocs.io/en/stable/)
* [Streamlit web UI playground](https://vigil.deadbits.ai/overview/use-vigil/web-server/web-ui-playground)

## Quick Links

{% content-ref url="overview/install-vigil" %}
[install-vigil](https://vigil.deadbits.ai/overview/install-vigil)
{% endcontent-ref %}

{% content-ref url="overview/use-vigil" %}
[use-vigil](https://vigil.deadbits.ai/overview/use-vigil)
{% endcontent-ref %}

{% content-ref url="overview/use-vigil/scanners" %}
[scanners](https://vigil.deadbits.ai/overview/use-vigil/scanners)
{% endcontent-ref %}

***
