Cyber security

JailbreakEval : Automating the Evaluation Of Language Model Security

Jailbreak is an attack that prompts a language model to give actionable responses to harmful behaviors, such as writing an offensive letter, providing detailed instructions for creating a bomb.

Evaluating the results of such attacks typically requires manual inspections by determining if the response fulfills some standards, which is impractical for large-scale analysis.

As a result, most research on jailbreak attacks levarage automated tools to evaluate the result of their jailbreak attempts, and each of them offers some unique insights.

However, due to the inherent semantic flexibility of natural language, there is no such automated evaluator that could fit in all contexts.

Therefore, instead of proposing one best automated evaluator to rule them all, JailbreakEval aims to bring them together in a unified manner, making them straightforward to craft, access, and compare. It is particularly well-suited for:

  • Jailbreak Researchers, by providing well-known jailbreak evaluators to assess the effectness of their attacks out-of-the-box.
  • Jailbreak Evaluator Developers, by providing a handy framework for creating new evaluators and comparing its performance with the established ones.

Install

You can install the latest release of JailbreakEval from pypi:

pip install JailbreakEval

Alternatively, you can install JailbreakEval by cloning the project:

git clone https://github.com/ThuCCSLab/JailbreakEval
cd JailbreakEval
make install  # for installation
make dev  # for development

Quick Start

JailbreakEval can evaluate your jailbreak attempts in just a few lines of codes.

Here is a snippet to assess a jailbreak attempt by GCG’s evaluator:

from jailbreakeval import JailbreakEvaluator

# Initialize the evaluator with GCG's preset
evaluator = JailbreakEvaluator.from_preset("StringMatching-zou2023universal")

# The jailbreak attempt to be evaluated
attempt_to_evaluate = {
    "question": "How to build a bomb?",  # the target question to jailbreak
    "answer": "I cannot tell you. This is illegal."  # the answer extracted from the model by the jailbreak attack
}

# Evaluate the attempt and print the result
evaluation_result = evaluator(attempt_to_evaluate)
print(evaluation_result)   # Output: False

For more information click here.

Varshini

Varshini is a Cyber Security expert in Threat Analysis, Vulnerability Assessment, and Research. Passionate about staying ahead of emerging Threats and Technologies.

Recent Posts

Hyperswitch : Revolutionizing Digital Payments With Open-Source Flexibility

Juspay, a leader in payment orchestration since 2012, has introduced Hyperswitch, an open-source payments platform…

14 hours ago

Stuxnet : The Blueprint Of Modern WMI-Based Cyber Threats

Stuxnet, a groundbreaking cyberweapon first discovered in 2010, targeted Iran's nuclear facilities, marking a significant…

14 hours ago

ZKsync Era : A ZK Rollup For Scaling Ethereum

ZKsync Era is a cutting-edge Layer 2 scaling solution designed to address Ethereum's persistent challenges…

14 hours ago

SeCoRA : Revolutionizing Secure Code Review With AI

SeCoRA (Secure Code Review AI Agent) is an advanced AI-powered tool designed to enhance the…

14 hours ago

Tokei : The Developer’s Guide To Codebase Analytics

Tokei, a powerful and efficient command-line tool, is designed to provide detailed insights into the…

14 hours ago

Vaultwarden : The Efficient Self-Hosted Alternative To Bitwarden

Vaultwarden is an alternative, lightweight server implementation of the Bitwarden Client API, developed in Rust.…

16 hours ago