Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Environment:Norrrrrrr lyn WAInjectBench External Repos Dependencies

From Leeroopedia
Knowledge Sources
Domains Infrastructure, Security, NLP
Last Updated 2026-02-14 16:00 GMT

Overview

External repository dependencies (Open-Prompt-Injection, JailGuard/MiniGPT-4, spaCy model) required by the DataSentinel and JailGuard detectors.

Description

Two detectors in WAInjectBench depend on external repositories that must be cloned and configured separately:

DataSentinel (`detector_text/datasentinel.py`) requires the Open-Prompt-Injection repository with its `DataSentinelDetector` class and a pretrained Mistral-based detector checkpoint (`checkpoint-5000`).

JailGuard (`detector_image/jailguard.py`) requires the JailGuard repository with its mutation-based detection utilities, plus a configured MiniGPT-4 vision-language model for inference. It also requires the spaCy `en_core_web_md` model for response divergence analysis.

Both detectors modify `sys.path` to import from these external repositories.

Usage

Use this environment when running the DataSentinel text detector or the JailGuard image detector. It is not required for other detectors (KAD, PromptArmor, PromptGuard, embedding-based, LLaVA, GPT-4o).

System Requirements

Category Requirement Notes
Disk 5GB+ additional For external repo clones and pretrained model weights
Hardware NVIDIA GPU JailGuard requires GPU for MiniGPT-4 inference; DataSentinel uses Mistral 7B
Network Internet access For initial clone and model download only

Dependencies

External Repositories

Python Packages

  • `spacy` >= 3.7.2 (for JailGuard divergence analysis)
  • spaCy model: `en_core_web_md`

Credentials

No additional credentials required beyond the base environment.

Quick Install

# DataSentinel setup
git clone https://github.com/liu00222/Open-Prompt-Injection.git
# Download the pretrained DataSentinel model into:
# Open-Prompt-Injection/DataSentinel_Models/detector_large/checkpoint-5000

# JailGuard setup
git clone https://github.com/JailGuardRepo/jailguard.git
# Follow JailGuard README to configure MiniGPT-4

# spaCy model for JailGuard
python -m spacy download en_core_web_md

Code Evidence

sys.path modification for DataSentinel from `detector_text/datasentinel.py:9-10`:

sys.path.append("YOUR_PATH_TO_/Open-Prompt-Injection")
from OpenPromptInjection.utils import open_config
from OpenPromptInjection import DataSentinelDetector

DataSentinel model path configuration from `detector_text/datasentinel.py:14-16`:

CONFIG_PATH = "Open-Prompt-Injection/configs/model_configs/mistral_config.json"
config = open_config(CONFIG_PATH)
config["params"]["ft_path"] = "Open-Prompt-Injection/DataSentinel_Models/detector_large/checkpoint-5000"

sys.path modification for JailGuard from `detector_image/jailguard.py:11-15`:

sys.path.append('YOUR_PATH_TO_/JailGuard/JailGuard/utils')
from utils import read_file_list, update_divergence, detect_attack
from mask_utils import load_mask_dir
from augmentations import img_aug_dict
from minigpt_utils import initialize_model, model_inference

spaCy model loading from `detector_image/jailguard.py:94`:

metric = spacy.load("en_core_web_md")

Common Errors

Error Message Cause Solution
`ModuleNotFoundError: No module named 'OpenPromptInjection'` Open-Prompt-Injection not cloned or path not set Clone the repo and update `sys.path.append()` in `datasentinel.py`
`ModuleNotFoundError: No module named 'utils'` JailGuard utils path not set Clone JailGuard and update `sys.path.append()` in `jailguard.py`
`OSError: Can't find model 'en_core_web_md'` spaCy model not downloaded Run `python -m spacy download en_core_web_md`
`FileNotFoundError: checkpoint-5000` DataSentinel model not downloaded Download and place in `Open-Prompt-Injection/DataSentinel_Models/detector_large/`

Compatibility Notes

  • Path configuration: Both `datasentinel.py` and `jailguard.py` use placeholder paths (`YOUR_PATH_TO_/...`) that must be manually edited to match your local directory structure.
  • MiniGPT-4: JailGuard depends on MiniGPT-4 which has its own separate installation requirements. Follow the JailGuard README for full setup.
  • Temporary files: JailGuard creates temporary directories (`./temp/temp_variants_*`, `./temp/temp_responses_*`) during detection and cleans them up after each image.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment