FastAPI LLM Policy Middleware
Add deny-by-default policy checks, PII redaction, risk scoring, and audit traces in front of a FastAPI LLM endpoint.
Install
pip install policyaware fastapi uvicorn
Run The Example
git clone https://github.com/ktirupati/policyaware.git
cd policyaware/examples/fastapi-llm-policy-middleware
python demo.py
Expected Output
allowed_support_request: allow
pii_redaction_request: conditional_allow
secret_leak_request: deny
Open the complete example folder on GitHub: FastAPI LLM policy middleware.