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.3.0.tar.gz (55.0 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.3.0-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prompttransform-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6a0c9941188c09764591d5a09bb0a33defa501c3fd5fdf576a8838345ff74b0c
MD5 d5286073f7c1f238e8d8dcd1f0089b53
BLAKE2b-256 cfbbf2b6718e88571356d91baa45ad908e260a59e97e702f620e0748f49c4c67

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for prompttransform-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd0674da100b65eb633fb0d26f6fcd2554f0245fe3c5b90d5afaa803122c4b61
MD5 7aa89916b3464c3f51a3f180ad175404
BLAKE2b-256 f437877c0555b3a2c48fa9c027071bdd58c9234ce83630b8c7379f36a76b215f

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