The AI Firewall SDK
Project description
Guardion - AI Firewall SDK
Guardion is a lightning-fast, context-aware AI Firewall SDK, built to protect LLM-based systems from prompt injection and misuse. Seamlessly integrates with leading agent frameworks.
In the background, Guardion uses a robust Prompt Defense System developed by the GuardionAI research team. Our production-grade detection engine, ModernGuard, continuously evaluates threats using a multilayered architecture of classifiers, heuristics, and decoding pipelines.
✅ Tested and proven in production by major financial institutions.
🔬 Benchmarks
Detection Performance
Multilingual prompt injection evaluation for finance and e-commerce domains.
| Model | Overall F1-Score |
|---|---|
| guardion/Modern-Guard-v1 | 0.9718 |
| Lakera Guard | 0.8600 |
| protectai/deberta-v3-base-prompt-injection-v2 | 0.6008 |
| deepset/deberta-v3-base-injection | 0.5725 |
| meta-llama/Prompt-Guard-2-86M | 0.4555 |
| jackhhao/jailbreak-classifier | 0.5000 |
Notes
Tested on a multilingual, multi-attack dataset of 50K prompts with 40+ attack classes in 8 languages.
Evaluation data was built using real-world red team data from partners and the latest jailbreak and attack methods, including: encoding, prompt injection, jailbreaking, exfiltration & leakage, evasion & obfuscation, code and command injection, hard negatives (safe content), regular documents (safe content), regular chats (safe content), and more. See more details here.
Features
✅ Plug-and-play SDK for popular agent and LLM frameworks
🛡️ Real-time prompt inspection
🔍 Customizable detectors and security policies
🚀 Optimized for low latency and high throughput
How to use?
First, get an API Key at GuardionAI Console.
And store at the env var GUARDIONAI_API_KEY.
export GUARDIONAI_API_KEY=your-api-key
OpenAI Agents SDK
You need to install our SDK using our openai-agents extras with the following command:
pip install guardion[openai_agents]
from agents import Agent, Runner, InputGuardrailTripwireTriggered
from guardionsdk.openai_agents import guardion_guardrail
agent = Agent(
name="Secure AI Assistant",
instructions="You are a helpful and safe assistant.",
input_guardrails=[guardion_guardrail],
)
And use it as shown in the file examples/openai_agents.sdk.
LangChain
We support Chat and simple LLM models from LangChain, in order to use it, you need to install our langchain extra.
pip install guardion[langchain]
from langchain_openai import ChatOpenAI
from guardionsdk.langchain import get_guarded_chat_llm
from guardionsdk.exceptions import InjectionDetectedError
GuardionOpenAI = get_guarded_chat_llm(
ChatOpenAI
)
llm_guardion = GuardionOpenAI(model="gpt-4o-mini")
And in order to use it, just checkout our examples/langhchain.py file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file guardion-0.1.3.tar.gz.
File metadata
- Download URL: guardion-0.1.3.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35a62d690cb00e57236b812b32889bd6b0e846a96b9ece050f9418d8fbdf30b6
|
|
| MD5 |
dc32fc4f55bcb804b13b466ac1773005
|
|
| BLAKE2b-256 |
69ce80a059533076f55bcd81998200d19d464922bd9a357ae980b97c6f415b60
|
Provenance
The following attestation bundles were made for guardion-0.1.3.tar.gz:
Publisher:
python-package.yml on GuardionAI/guardion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guardion-0.1.3.tar.gz -
Subject digest:
35a62d690cb00e57236b812b32889bd6b0e846a96b9ece050f9418d8fbdf30b6 - Sigstore transparency entry: 208514101
- Sigstore integration time:
-
Permalink:
GuardionAI/guardion@510cc4222eae059c36abe4703b26da44d03c33b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GuardionAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@510cc4222eae059c36abe4703b26da44d03c33b9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file guardion-0.1.3-py3-none-any.whl.
File metadata
- Download URL: guardion-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edaeeebcbde7edd55e5f3019caf7a1eb18978512895ca3875081b571a1f54b90
|
|
| MD5 |
c2ff818ee2b1156269db2a38a35468ee
|
|
| BLAKE2b-256 |
648774521b4b7d2966967d63761e68bb5c4a8243750829ef77572f69c0a4a6ed
|
Provenance
The following attestation bundles were made for guardion-0.1.3-py3-none-any.whl:
Publisher:
python-package.yml on GuardionAI/guardion
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
guardion-0.1.3-py3-none-any.whl -
Subject digest:
edaeeebcbde7edd55e5f3019caf7a1eb18978512895ca3875081b571a1f54b90 - Sigstore transparency entry: 208514104
- Sigstore integration time:
-
Permalink:
GuardionAI/guardion@510cc4222eae059c36abe4703b26da44d03c33b9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/GuardionAI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-package.yml@510cc4222eae059c36abe4703b26da44d03c33b9 -
Trigger Event:
workflow_dispatch
-
Statement type: