LlamaFirewall
Open-source Python guardrail framework for detecting prompt injection, goal hijacking and insecure code in AI agents.
What it does
Lets developers wrap agent inputs, reasoning and outputs in layered security scanners. It combines a prompt-injection classifier, a chain-of-thought alignment checker, a code security scanner and custom regex rules into one policy engine for real-time use.
What an agent can do with it
- detect prompt injection
- audit agent reasoning for misalignment
- scan generated code for vulnerabilities
- apply custom regex rules
How to set it up
pip install llamafirewall (Python 3.10+); some scanners need access to Meta's Llama models on Hugging Face.
Full steps: Meta's documentation.
Use cases that use it
Ad copy variants within written brand rules
Give the agent your brand rules and offer details; it drafts several ad headline and description… Read →
Marketing · Google Docs (brand rulebook) · Google Sheets · ClaudeSocial comment moderation queue
The agent sorts incoming social comments into questions, complaints, spam, and praise, and drafts… Read →
Marketing · Meta Business Suite or another social inbox · Airtable or Google Sheets · ClaudeFilter social comments into reply, hide, and escalate
Comments on your business's social posts are sorted by a decision model into needs a reply, spam to… Read →
Decision models (Jev) · Jev (TypeSafe AI) · Meta Business Suite · MakeAd performance questions answered in a chat
Marketers ask a chat assistant connected to live ad data how campaigns are doing and get reports… Read →
Marketing · Supermetrics · Claude · Google AdsSources
Descriptions are written by Agents Lookup unless marked as quoted. Each link opens the original.
- Official page: github.com/meta-llama/PurpleLlama/tree/main/LlamaFirewall (checked 2026-11-19)
- Meta list where it appears: github.com/meta-llama/PurpleLlama