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

Uploaded Python 3

File details

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

File metadata

  • Download URL: promptshield_firewall-0.1.0.tar.gz
  • Upload date:
  • Size: 3.0 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.0.tar.gz
Algorithm Hash digest
SHA256 b13f55b39bc4fb3894c677236e40e1cd2fd7a1b46b200b8ba2cde125de9ff887
MD5 16bc443827711a52f45dfd55569dcf94
BLAKE2b-256 45629b15fc7891db014bde5e3fca6232e60497454165d97ed5d266eaaaec04c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for promptshield_firewall-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0759493dc79d4070576615026267dde41829d95eb6f900a0e5f7a2b5fac8785b
MD5 12da913212b51735c4817d5ce26cc618
BLAKE2b-256 a47ddc81cc2b658603d305084a0212172e16a863e300272f61c0d878b4ffb1ef

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