Practical overview
When it fits
Use it when you need a code-based way to build and evaluate prompt-injection scenarios against LLM-integrated applications, or to compare configured attacks and defenses.
Who it is for
- Developers testing prompt-injection behavior in LLM-integrated applications or agents
- Researchers comparing attack strategies and defenses through configured tasks and models
Documented uses
- Construct an attack scenario by combining target and injected tasks.
- Collect model responses and calculate the example attack success value.
- Run experiment matrices, with documented dry-run, retry and checkpoint-resume options.
- Try the documented detection and prompt-localization examples using their respective model configurations and checkpoints.
Requirements & limits
The repository is public, open source and MIT-licensed. The documented setup uses Conda. Model examples may require provider API credentials; detector and localization examples specify downloaded checkpoints.
- The toolkit is Python-based and its README requires Conda to create the environment.
- The combined-attack example is configuration-driven and separates target task, injected task, model, attacker, application and evaluator.
- The experiment runner documents dry-run path validation, retries, configuration fingerprints and response checkpoints.
- The README gives detector and localization examples that depend on separately downloaded fine-tuned model files.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the Python environment
Create and activate the Conda environment described by the repository.
Before you start
- Conda
- A local copy of the repository containing environment.yml
Steps
Run
conda env create -f environment.yml --name my_custom_env.Activate it with
conda activate my_custom_env.
Expected outcome
The named Conda environment is created and activated for working with the toolkit.
Guide limitations
- These steps cover environment setup only, not execution of an attack or experiment.
Configure and evaluate a combined attack scenario
Use the documented example structure to evaluate a combined attack against a configured target task.
Before you start
- The Conda environment set up from the repository
- Model and task configuration files
- A real model API key in the relevant configuration when using the PaLM2 example
Steps
Create the target task from its task configuration and create the model from its model configuration.
Create the injected task and a combined attacker, then create the target application with the chosen defense setting.
Pass attacked prompts to the application, collect responses and create an evaluator to calculate ASV.
Change configuration files or factory-method paths to evaluate a different documented task, attack strategy or defense.
Expected outcome
The example produces an ASV value for the configured attack scenario.
Guide limitations
- The README's worked scenario uses sentiment analysis as the target task, spam detection as the injected task, PaLM2 and no defense.
- Model access depends on valid provider credentials and configuration.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 11 November 2026
- Original website title
- liu00222/Open-Prompt-Injection · Official homepage title · retained in its source language

