Skip to content

Protect your LLMs from prompt injection and jailbreak attacks. Easy-to-use Python package with multiple detection methods, CLI tool, and FastAPI integration.

License

Notifications You must be signed in to change notification settings

dronefreak/PromptScreen

PromptScreen (now on PyPI!)

A prompt injection and jailbreak detection system for LLMs

📦 PyPI 🐍 Python Versions 🧪 Tests 📊 Codecov ⚖️ License: Apache 2.0

PromptScreen is an open-source library that provides multiple defense layers against prompt injection attacks and jailbreak attempts in LLM applications. Designed for production use, it offers plug-and-play guards that can be integrated into any LLM pipeline.


Quick Start

We're excited to announce that PromptScreen is now available via pip:

pip install promptscreen
from promptscreen import HeuristicVectorAnalyzer

guard = HeuristicVectorAnalyzer(threshold=2, pm_shot_lim=3)
result = guard.analyse("Your prompt here")

if result.get_verdict():
    print("✓ Safe prompt")
else:
    print(f"✗ Blocked: {result.get_type()}")

Installation Options

# Core package (fast guards only)
pip install promptscreen

# With ML guards (ShieldGemma, ClassifierCluster)
pip install promptscreen[ml]

# With vector database guard
pip install promptscreen[vectordb]

# Everything
pip install promptscreen[all]

Available Guards

  • HeuristicVectorAnalyzer - Fast pattern-based detection
  • Scanner (YARA) - Bundled YARA rules
  • InjectionScanner - Command injection detection
  • JailbreakInferenceAPI (SVM) - ML classifier
  • VectorDBScanner - Similarity search (optional)
  • ClassifierCluster - Dual ML models (optional)
  • ShieldGemma - Google's safety model (optional)

Documentation

Links


As always Hare Krishna and happy coding!

About

Protect your LLMs from prompt injection and jailbreak attacks. Easy-to-use Python package with multiple detection methods, CLI tool, and FastAPI integration.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •