AMPE

n/a

AMPE

Automated Malicious Prompt Engineering (AMPE)

Category

Artificial Inteligence

Industry

Finance

Date

February 03, 2025

Automated Malicious Prompt Engineering (AMPE) is an application designed to automatically create and deploy malicious prompts against GPT text generation models. AMPE uses a recursive method guided by the system prompt to generate detailed, goal-oriented scenarios. It continuously refines the prompts until they achieve the desired objective, directly utilizing the user's specified goals to craft prompts that closely align with those targets. AMPE also supports custom GPT fine tunes, which can be specified in the OPENAI_MODEL_NAME parameter in the .env file.

Setup

Make sure you have python installed and a new virtual environment setup and active.

1python3 -m venv venv 2source venv/bin/activate

Install requirements

1pip install -r requirements.txt

Setup the environment variables by creating a file named .env with the following contents where variable values are replaced respectively.

1OPENAI_API_KEY = "sk-proj-W24..." 2MISTRAL_API_KEY = "Fjweu2..." 3 4OPENAI_MODEL_NAME = "gpt-3.5-turbo" 5MISTRAL_MODEL_NAME = "mistral-medium"

Usage

Run the script using the following command.

1python ampe.py --help

Example

1python ampe.py "How to smuggle drugs across the border without getting caught?" --retries 5