Skip to main content

CLI tool for auditing prompts using PromptForest

Project description

PromptForest Ranger

PyPI Downloads Apache License Documentation

This project is actively in development! If you have any questions or want to help out, you can reach out via issues or discussions, or send me an email.

PromptForest Ranger (or PFRanger) is a CLI tool for auditing LLM prompts for injection attacks and jailbreaks. It leverages the PromptForest ensemble engine to scan datasets and generate comprehensive and accurate HTML reports, mitigating the problem of high-certainty false positives.

PFRanger Report Preview

Intended Use Cases

We intend this tool to be a swiss army knife: it should be used for multiple situations regarding unsafe prompts. Here are some, but not all, of the ways to use PFRanger

  1. Processing Unsafe Datasets Huge datasets may contain prompts that weaken a model, making it more vulnerable to jailbreak attempts. PFRanger can mitigate this issue before you feed it to your model.

  2. Auditing Datasets Feeding potentially dangerous datasets into AI model with highly privileged abilities may produce catastrophic results. PFRanger helps by giving you an overview of the dataset's security.

Features

Works Offline

All data stays on your computer.

Accurate and Reliable

PFRanger utilises the PromptForest engine, which provides responses that are not only accurate, but also calibrated and reliable. PromptForest uses a strategically selected ensemble of small models using soft weighted model voting. Read more about PromptForest here

Fast

Startup latency of ~3s and an average request rate of 27 prompts/s on a consumer GPU with optimal parallelization.

Informative

Supports a large number of input and output file types. Also outputs a shareable HTML file to help you analyse the data.

Downloading Models

PromptForest automatically handles all model downloading on first run. Downloading takes around 3GB disk space and around a minute to download on consumer network download speeds.

Documentation

A simple quick start guide is provided below. You can view the official wiki in GitHub Pages, and the DeepWiki version here for those interested in how Ranger works under-the-hood.

Installation

pip install pfranger

Usage

pfranger [INPUT_FILE] [OPTIONS]

Examples

Scan a CSV file:

pfranger validation_prompts.csv -p text

Scan with custom configuration:

pfranger prompts.jsonl -c my_config.yaml

Arguments

Argument Description Default
input Path to the file containing prompts Required
--output, -o Output path for HTML report report.html
--input-format, -f Force input format (csv, json, jsonl, txt) Auto-detect
--output-format Add additional output format alongside HTML None
--prompt-col, -p Column name for prompts (CSV/JSON) prompt
--timestamp-col, -t Column name for timestamp None
--workers, -w Number of parallel worker threads 4
--config, -c Path to PromptForest YAML configuration file Benchmark Defaults

License

See LICENSE.

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

pfranger-0.7.6.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

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

pfranger-0.7.6-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file pfranger-0.7.6.tar.gz.

File metadata

  • Download URL: pfranger-0.7.6.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfranger-0.7.6.tar.gz
Algorithm Hash digest
SHA256 eede74e3b10e6fc3d8b897f044f53b075e7949edc0a1092eb133f5f1fc80d90f
MD5 c2d7261128bebb0f6a97651abc61e851
BLAKE2b-256 dba1f8cbc79e697da555997b2d2e06afa100f969d32dd8032959f6846eee5699

See more details on using hashes here.

File details

Details for the file pfranger-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: pfranger-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for pfranger-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3b4267438ffecca24af40452636d0889233edbcd9af3d9d75cdeec8782e1a10f
MD5 547a0d25d7fcbaaab81816b70f29c478
BLAKE2b-256 79c102815f4ec0afbf741d20972874062baecf3a7aa1dbbaf10fb4aa3cee2048

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