What problem does it solve? Building a defensive layer in front of LLM applications requires wiring together a classifier, an API gateway, decision logic, and monitoring UI from scratch. This Skill provides the architecture and working code patterns for intercepting user prompts, scoring them with ML classifiers, enforcing ALLOW/BLOCK policies, and visualizing results before requests reach downstream LLMs. ## Core Features & Use Cases - FastAPI Guardrail Middleware: A /v1/chat/guardrail endpoint that loads a trained TF-IDF or DeBERTa classifier, computes a malicious probability score, and returns ALLOW or BLOCK decisions with latency metrics. - Streamlit Monitoring Dashboard: An interactive dashboard with live prompt testing, a tunable detection threshold slider, model benchmark tabs, and attack log views. - Docker Deployment: A Dockerfile pattern for packaging the API with uvicorn for containerized serving. - Use Case: A student or engineer building the PI-Guard capstone project can scaffold the guardrail API, connect it to Ollama or HuggingFace LLM targets, and demo live prompt injection blocking through the dashboard. ## Quick Start Ask the AI to scaffold the FastAPI guardrail endpoint and Streamlit dashboard for the PI-Guard project using a trained TF-IDF classifier with a 0.65 detection threshold.