docs: add promptfirewall callback integration to integrations listing
Description
Request to add promptfirewall to the callbacks integration listing.
llama-index-callbacks-promptfirewall is an independently published PyPI package that provides PII detection and prompt injection blocking as both a LlamaIndex callback handler (legacy) and an instrumentation event handler (new).
This is a listing request only — no code is being added to the monorepo.
Package Details
| Field | Value |
|---|---|
| PyPI Package | llama-index-callbacks-promptfirewall |
| GitHub Repository | TimurRakhmatullin86/llama-index-callbacks-promptfirewall |
| Core Library | TimurRakhmatullin86/promptfirewall |
| License | MIT |
What It Does
Sub-millisecond PII detection and prompt injection firewall for LlamaIndex applications. Written in Rust, exposed to Python via PyO3.
Two handler modes:
- Legacy:
PromptFirewallHandler(BaseCallbackHandler)— hooksCBEventType.LLMandCBEventType.QUERY - New:
PromptFirewallEventHandler(BaseEventHandler)— handlesLLMChatStartEvent,LLMCompletionStartEvent,LLMPredictStartEvent
Supported PII types: SSN, credit card (Luhn-validated), IBAN (ISO 7064), email, phone, IP address, AWS keys, API keys
Quick Start
from llama_index_callbacks_promptfirewall import PromptFirewallHandler
from llama_index.core.callbacks import CallbackManager
from llama_index.core import Settings
handler = PromptFirewallHandler()
Settings.callback_manager = CallbackManager([handler])
# All LLM calls and queries are now scannedPerformance
| Library | Latency | Approach |
|---|---|---|
| promptfirewall | 12μs | Heuristic + TF-IDF (Rust) |
| Presidio | ~180ms | Regex + NER |
| LLM Guard | ~300ms | ML models |
The only comparable integration is llama-index-postprocessor-presidio (PII only, ~180ms, no injection detection).
Source: run-llama/llama_index