Firewall for AI enables rapid identification and anonymization to protect sensitive data from disclosure through GenAI prompts, models, analytics pipelines, and automated workflows.
- Comprehensive Coverage: Supports over 100 entity types in text, files, and images, including names, addresses, Social Security numbers, credit card details, credit card images, banking account numbers, and protected health information. For a full list, refer to the detector glossary.
- Enhanced Accuracy: Delivers up to twice the precision and recall compared to leading solutions like Google DLP, Microsoft Presidio, and AWS Guardrails. Benchmarks are available upon request at [email protected].
- Low Latency: ≤100ms P99
- High Throughput: >= 1000 rps
This repository contains sample code demonstrating how to use Firewall for AI APIs to sanitize GenAI prompts within popular LLM services and frameworks using Python.
- OpenAI ChatGPT
- Anthropic Claude
- LangChain / Anthropic Claude
-
If you still need to get a Nightfall account, get one here.
-
Create a Nightfall key and add it to your .env file. Here are instructions.
-
Ensure you have the following packages installed:
pip install -r requirements.txt
Feel free to submit issues or pull requests if you find any bugs or have suggestions for improvements.
This project is licensed under the Apache 2 license.
To sort imports run:
isort .
To format code run:
black .
To check code style run:
pylint examples/