Skip to main content

Prompt injection firewall for AI applications

Project description

PromptGuard

A prompt injection firewall for AI applications.

Install

pip install promptguard

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.0.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.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: promptguard_firewall-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 719a3243fd9af87766bc8592ad0b41689ffaa1eaa3fc5613d4b741803c66932b
MD5 56145a8a88f41e4262d91524ddb91c0c
BLAKE2b-256 647ea4d8ec3f97936437d8f96741f521f602b30b6ff8febcfc307dcb4d0d8a04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for promptguard_firewall-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c62a1b94797646f5f3f0811f72877af1a0b0746c398582bb6e0f58c56ae7e08
MD5 04c1cee9171612a428b3dc2f726d0214
BLAKE2b-256 71afbfe9c1732abc7ab2cec961b7ce7dcaaf2fa82a8504d340d37e38ff6898fb

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