agentbastion
preventIn-process firewall for AI agents
A firewall for AI agents: block prompt injection, guard tool calls, redact PII/secrets — a checkpoint between the agent you ship and the world.
pip install agentbastion What it does
- Three guards in one SDK: inbound injection block, tool-call guard, outbound PII/secret redaction
- Tool-call guard is the differentiator — stops mass email/delete/refund/exfil
- Drop-in SDK: data never leaves your box; optional LLM judge
- Encoded attacks: bastion.decoded_payload decodes base64, hex, binary, rot13, leetspeak, reversed text and more; it ships in shadow mode and reports what it would block (58–74% of encoded corpus attacks, 0% benign false positives)
- Honest benchmark: recall 1.0 / FPR 0.0 on the labeled corpus (public-set caveat in README)
Quickstart
from agentbastion import Bastion
bastion = Bastion()
result = bastion.check_input(user_text)
Version 0.14.0 · MIT + BSL-1.1 (gateway)