SwiftGuard is an algorithm designed to protect LLMs from malicious prompts attempting to 'jailbreak' the system. With the implemenation of SwiftGuard, LLMs can be protected from being tricked into responding with illegal or harmful information, at little to no cost to the typical user.
conda create -n swiftguard python=3.10
conda activate swiftguardcd spd
cd jailbreakbench
pip install jailbreakbenchcd ..
cd ..
pip install -r requirements.txtsetx OPENAI_API_KEY "your_api_key_here"Close out of the terminal, and open a new one. Go to the SwiftGuard directory
conda activate swiftguard
python classify_jailbreak.pyEnter the prompt you want to classify as jailbroken or not. Model used is GPT-4o-mini.