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.2.tar.gz (3.3 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.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: promptshield_firewall-0.1.2.tar.gz
  • Upload date:
  • Size: 3.3 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.2.tar.gz
Algorithm Hash digest
SHA256 48c6ad723ee3c90dbe266f915e8fc26b059af24b92dbf0f291f94709621d2ab7
MD5 d6bc41460d6130352d87cc49b5bf99ca
BLAKE2b-256 c323f1edf6ff4ea4d898e98b7c71d335ef9a95951ffedab84cab4275c2d9eae4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for promptshield_firewall-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b469e6621be497bdef3bc35a04c601ece1d90e6996df22ed92596153ac740996
MD5 4a9b608cd34c5cb8afa435655c588677
BLAKE2b-256 d100606fc5749eff7af43e33313d8c2f2b43b327b0e458b3a5d73bf88179ccdd

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