Open-Prompt-Injection
Description
This repository is an open-source toolkit for prompt injection attacks and defenses. It enables implementation, evaluation, and extension of attacks, defenses, and LLM-integrated applications and agents. For a deeper dive into prompt injection, see [these slides](https://people.duke.edu/~zg70/code/P
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
Open-Prompt-Injection
Introduction
This repository is an open-source toolkit for prompt injection attacks and defenses. It enables implementation, evaluation, and extension of attacks, defenses, and LLM-integrated applications and agents. For a deeper dive into prompt injection, see [these slides](https://people.duke.edu/~zg70/code/PromptInjection.pdf), an extended version of a presentation given at the Safer with Google Summit 2025.
Required Python packages
Pre-requisite: [conda](https://www.anaconda.com/docs/getting-started/miniconda/install)
Install the environment using the following command:
conda env create -f environment.yml --name my_custom_env
Then activate the environment:
conda activate my_custom_env
Usage
A simple demo
Before you start, go to './configs/model\_configs/palm2\_config.json' and replace the API keys with your real keys. Please refer to Google's official site for how to obtain an API key for PaLM2. For Meta's Llama models and OpenAI's GPT models, please also refer to their websites for registration details.
The following code snippet creates a model and queries the model with the prompt "Write a poem about monkeys":
import OpenPromptInjection as PI
from OpenPromptInjection.utils import open_config
model_config_path = './configs/model_configs/palm2_config.json'
model_config = open_config(config_path=model_config_path)
model = PI.create_model(config=model_config)
model.print_model_info()
msg = "Write a poem about monkeys"
print(model.query(msg))
Combined attack
The following code snippet evaluates the ASV of the scenario where the target task is sentiment analysis (i.e., the target data is sst2), the injected task is spam detection (i.e., the injected data is spam detection), the model is PaLM2, and no defense is applied:
import OpenPromptInjection as PI
from OpenPromptInjection.utils import open_config
# Create the target task
...
Related Skills
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11