Skip to main content

Real-time LLM prompt injection firewall

Project description

PromptShield Python SDK

Real-time LLM prompt injection firewall.

Installation

pip install promptshield

Quick Start

from promptshield import PromptShield

shield = PromptShield(api_key="ps_your_key")

# Scan before sending to your LLM
result = shield.scan("Ignore all previous instructions.")

if result["verdict"] == "BLOCKED":
    print(f"Attack blocked! Risk score: {result['risk_score']}")
else:
    response = your_llm.chat(user_input)

# Or use the simple boolean check
if not shield.is_safe(user_input):
    return "Request blocked."

Async Support

result = await shield.async_scan(user_input)

Get API Key

Free tier at promptshield.live

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

promptshield_firewall-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

promptshield_firewall-0.1.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file promptshield_firewall-0.1.1.tar.gz.

File metadata

  • Download URL: promptshield_firewall-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for promptshield_firewall-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7c462e4528632ed6be799999d3c0562d23c1458a3a47af7b0c8147b47fc240cb
MD5 0f2d0d29cfb6b4c09328cef5b6cd9769
BLAKE2b-256 f8d47a1b9143ab4a272b7472081d043f87e80ef8f8763079685dd2fee32a73a5

See more details on using hashes here.

File details

Details for the file promptshield_firewall-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for promptshield_firewall-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4fdfad65c46249be57bd87ca7c0a7a8b557e5313a880b2239be043c5e22bf1fa
MD5 407a0382b572a0f42dda8ebc933a1c76
BLAKE2b-256 94084daa339df5d75bd859ea9f16f19113790d8007db5e68b8b6fa0fdb12504c

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