I built Guardrail Gateway as an AI safety platform to make interactions with Large Language Models more secure and transparent. It adds a layer of content filtering, policy enforcement, and audit logging between applications and providers such as OpenAI. The system runs on a FastAPI backend with a React frontend, acting as an intelligent proxy that checks every request and response against a set of customizable safety policies before it reaches the model.
The core of the platform is a policy engine that uses regex-based rules with adjustable severity levels and actions like blocking, warning, or redacting content. Right now, I’ve implemented two main policy sets: one for detecting and redacting personally identifiable information, and another for identifying prompt injections or attempts to extract system prompts. Every event is logged for traceability and compliance.
Developers (including myself) can test and tune policies through a web interface, which includes tools for validating configurations, managing policies, and reviewing audit logs. The system uses SQLite for development and PostgreSQL for production, with JWT authentication for secure access and UUID support across databases. Typical requests — from scanning to response logging — complete in about two seconds, with most scans finishing in under 50 ms.
I designed Guardrail Gateway to run quietly in the background, using Python’s asyncio loop on a high port (58001) to minimize interference with other services. It’s written for Python 3.13 and built to scale horizontally thanks to its stateless API design. The frontend, built in React with TypeScript and Vite, includes full documentation for both developers and AI agents.