jailbreak-corpus-mini-py
Small local jailbreak and prompt-injection fixture set for tests. Ships a JSON corpus of canonical attack prompts (instruction override, prompt leak, excessive agency, encoding tricks, role hijack) with category + severity labels you can pivot on. Zero runtime dependencies.
Python port of @mukundakatta/jailbreak-corpus-mini.
Install
pip install jailbreak-corpus-mini-py
Usage
from jailbreak_corpus_mini import (
load_corpus,
get_jailbreak_fixtures,
fixture_texts,
Fixture,
)
# Full corpus (each entry is a Fixture: {id, prompt, category, severity, text}).
corpus = load_corpus()
len(corpus) # > 5
corpus[0].prompt # canonical attack string
corpus[0].category # e.g. "prompt_injection"
corpus[0].severity # "low" | "medium" | "high"
# Filter to a single category (matches JS sibling's getJailbreakFixtures).
get_jailbreak_fixtures(category="prompt_injection")
# Just the raw strings (handy for hooking into a guardrail eval loop).
texts = fixture_texts(severity="high")
Use it in a guardrail test
import pytest
from jailbreak_corpus_mini import load_corpus
def my_guardrail(prompt: str) -> bool:
"""Return True if prompt should be blocked."""
...
@pytest.mark.parametrize("fixture", load_corpus())
def test_guardrail_blocks_known_attacks(fixture):
assert my_guardrail(fixture.prompt), (
f"missed {fixture.category}/{fixture.severity}: {fixture.prompt!r}"
)
API
| Symbol | Behavior |
|---|---|
Fixture |
Dataclass: id, prompt, category, severity, plus text alias for JS-parity. |
load_corpus() |
Returns the full list of Fixture objects. |
get_jailbreak_fixtures(*, category=None, severity=None, risk=None) |
Filtered view. risk= is the JS sibling's name for category=. |
fixture_texts(...) |
Same filters, returns list[str] of prompts only. |
The fixture corpus ships as corpus.json inside the package and is loaded once on import. Patch the file (or call load_corpus_from(path)) to use your own.
See the JS sibling's README for the full design notes.
Metadata
Release files for jailbreak-corpus-mini-py 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jailbreak_corpus_mini_py-0.1.0.tar.gz | 6.7 kB | Without provenance | Details for jailbreak_corpus_mini_py-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jailbreak_corpus_mini_py-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for jailbreak_corpus_mini_py-0.1.0-py3-none-any.whl |
Total release size: 13.6 kB
Release files / jailbreak_corpus_mini_py-0.1.0.tar.gz
| Download URL | jailbreak_corpus_mini_py-0.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e06a0409b30f0cf38aed611324e207cf0722377961f951079163fd21d34df2c8
|
|
BLAKE2b-256 checksum How to use checksums |
1406db3dd5fb344736ada47f29c2f559844187a3046438f3a8ab157c0fe3fdd3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / jailbreak_corpus_mini_py-0.1.0-py3-none-any.whl
| Download URL | jailbreak_corpus_mini_py-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b336986c3028dffd3d31140456abc4062019cac3dbbeafa772b1df86986f5b8e
|
|
BLAKE2b-256 checksum How to use checksums |
b65e95e66bf31718bcf56fcb1e7e1c17e346c3de6cfed17a33db339f037a17b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Security for jailbreak-corpus-mini-py 0.1.0
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.