Skip to main content

Optimus: Semantic–Harmfulness-Based Jailbreak Scoring

Overview

This repository provides an implementation of Optimus, a continuous metric for evaluating jailbreak prompts in large language models. The metric jointly considers semantic similarity to a harmful target intent and the estimated harmfulness of the prompt content.

Unlike binary jailbreak success metrics such as Attack Success Rate (ASR), Optimus produces a real-valued score in the range [0, 1]. This enables finer-grained evaluation by penalizing trivial paraphrases, benign rewrites, and low-risk prompts, while highlighting prompts that are both semantically aligned with harmful intent and likely to induce unsafe behavior.

The core implementation is provided through the JBScoreCalculator class.


Key Features

  • Semantic similarity computation using Sentence-BERT embeddings
  • Harmfulness estimation using an NLI-style sequence classification model
  • Continuous jailbreak scoring metric (Optimus)
  • Compatible with CPU and GPU execution via PyTorch
  • Modular design enabling replacement of encoders or classifiers

Dependencies

The following libraries are required:

  • Python 3.9 or higher
  • PyTorch
  • HuggingFace Transformers
  • Sentence-Transformers
  • NumPy

Installation

pip install torch transformers sentence-transformers numpy

Metadata

Release files for optimus-jbscorer 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for optimus-jbscorer 0.0.3
File Size Uploaded Provenance Actions
optimus_jbscorer-0.0.3.tar.gz 4.1 kB Without provenance Details for optimus_jbscorer-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for optimus-jbscorer 0.0.3
File Interpreter ABI Platform Actions
optimus_jbscorer-0.0.3-py3-none-any.whl Python 3 none any Details for optimus_jbscorer-0.0.3-py3-none-any.whl

Total release size: 7.8 kB

Release files / optimus_jbscorer-0.0.3.tar.gz

Download URL optimus_jbscorer-0.0.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f77e32b6a13e0f02e7ea3cc1ae5d9bbb83ce4e5ba8692d072e8327d8e1464f2a
BLAKE2b-256 checksum
How to use checksums
c900e136d488112be9ee988576647a373f770ed4e8bb88b5d950876148e1d29d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / optimus_jbscorer-0.0.3-py3-none-any.whl

Download URL optimus_jbscorer-0.0.3-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b46281e9da30488e726e9b7303f3cab9693c63d23addb51263473e1f866cc229
BLAKE2b-256 checksum
How to use checksums
70a6258b5eb9f566b6eac6f0053334982ecb639c44b6fe5a81a80998843fca8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for optimus-jbscorer 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page