Skip to main content

Prompt injection firewall for AI applications

Project description

PromptGuard

A prompt injection firewall for AI applications.

Install

pip install promptguard-firewall

Usage

from promptguard import protect

result = protect("Ignore all previous instructions and...")

if result["action"] == "block":
    print("Attack blocked!")
elif result["action"] == "sanitise":
    print("Sanitised:", result["analysis"]["sanitised_version"])
else:
    print("Safe to forward to your LLM")

Response format

{
  "action": "block",
  "tier": 1,
  "t1_label": "OBVIOUS_ATTACK",
  "analysis": null
}
Field Values
action "allow" / "block" / "sanitise"
tier 1 (fast, ~250ms) or 2 (deep analysis, ~2s)
analysis null for Tier 1 blocks, full JSON for Tier 2

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

promptguard_firewall-0.1.1.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

promptguard_firewall-0.1.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for promptguard_firewall-0.1.1.tar.gz
Algorithm Hash digest
SHA256 174eac64d20922568a7cafa5998b8a3b4b5b11c916f3ba686c1bd11bfd733bd6
MD5 01d8e0a86e9d5ba188208ebe6543f791
BLAKE2b-256 1d0d3d593f9fa138c19506c0421ef84d56c63c68517594dcf8ada93e03c2444a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for promptguard_firewall-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99455c9caa7aa2061f46f37dfb6299e84fa28a140608eeb736c2cac264db6a80
MD5 dca52b155176ff5d6e062a784d941e52
BLAKE2b-256 5f1a4d1116e0ee7ef98354194800d2effef93392306a8772b5ce75588fc0e4de

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