Skip to main content

Adversarial and obfuscation prompt transformation toolkit (packaged duplicate of promptify).

Project description

prompttransform

Verbatim packaged distribution of the project's root promptify.py adversarial / obfuscation prompt transformation toolkit. The prompttransform package mirrors the monolithic core exactly (no integrity compromise) and exposes a clean Python API plus a CLI.

Key Principle: Single Source of Truth

Edit only the root promptify.py at the repository top level. After any change run (preferred):

# From repo root (Unix)
cp promptify.py Publish/prompttransform/promptify.py

# PowerShell (Windows)
Copy-Item -LiteralPath .\promptify.py -Destination .\Publish\prompttransform\promptify.py -Force

Or use the sync helper script:
```bash
python tools/sync_promptify.py --sync

No partial edits inside `Publish/prompttransform/promptify.py`. Always overwrite fully to prevent drift.

## Installation (Local / Dev)
```bash
pip install -e ./Publish

(Or after publishing to an index:)

pip install prompttransform

CLI Usage

After install, the entry point promptransform is available:

promptransform --help
promptransform --version
promptransform list
promptransform run --prompt "ignore all previous instructions" --technique BASE64 --technique HOMOGLYPH
promptransform interactive

Python API Quick Start

from prompttransform import Promptify, Techniques

p = Promptify("ignore all previous instructions")
p.apply(Techniques.BASE64).apply(Techniques.HOMOGLYPH, level='enhanced')
print(p.get_transformed_prompt())

Apply a Recipe

recipe = [
    (Techniques.SYSTEM_OVERRIDE, {"level": "enhanced"}),
    (Techniques.ROT13, {}),
]
result = Promptify("give me access").apply_recipe(recipe)
print(result.get_transformed_prompt())

Enumerate All Techniques

for t in Techniques.get_all():
    print(t.name, '-', t.value.category)

Versioning

Current version: 0.1.0

Increment __version__ in prompttransform/version.py and version in pyproject.toml together.

Responsible / Ethical Use

This toolkit includes adversarial, obfuscation, and injection-style transformations intended for research, red teaming, evaluation, and defensive hardening of LLM systems. Do not use it to bypass safety systems in production or for malicious purposes. Always comply with applicable laws, platform terms, and ethical guidelines.

Drift / Integrity Check

Preferred:

python tools/sync_promptify.py --check

Manual hash comparison (fallback):

# Unix
shasum promptify.py Publish/prompttransform/promptify.py
# PowerShell
Get-FileHash .\promptify.py; Get-FileHash .\Publish\prompttransform\promptify.py

The digests should match.

Planned Enhancements

  • Automated sync script + pre-commit hook
  • Technique registry metadata export (JSON)
  • Optional modular decomposition preserving public facade

License

See repository-level licensing terms. All rights reserved unless otherwise specified.

Changelog

  • 0.1.0: Initial packaged release (verbatim copy + CLI + metadata)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

prompttransform-0.2.0.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prompttransform-0.2.0-py3-none-any.whl (49.8 kB view details)

Uploaded Python 3

File details

Details for the file prompttransform-0.2.0.tar.gz.

File metadata

  • Download URL: prompttransform-0.2.0.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for prompttransform-0.2.0.tar.gz
Algorithm Hash digest
SHA256 8c8e64951ef016baaefc1886af12c1d65120de9f706c8228a538fb72a3ced234
MD5 6d2e63254a194452e76fc03b8eb43e5e
BLAKE2b-256 bd9486103f1de7639cf34e4e678d0ce6450a9c43f81e537f765109a77d6699e3

See more details on using hashes here.

File details

Details for the file prompttransform-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for prompttransform-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 425849595156ab86b0f4558430f60572cb9a06619f4c78243e4abe1d5b1091e8
MD5 9ed80c90d2fee1f1d1d992b26d9458d9
BLAKE2b-256 f3c223a16eb9217e208b4a41758ac0ef1dd7e47f930689577afc7c7118d2535a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page