explaingit

shauryasinghh25/sentinel-ai-gateway

0PythonAudience · ops devopsComplexity · 4/5ActiveLicenseSetup · moderate

TLDR

FastAPI security middleware that proxies LLM traffic, blocks prompt injection and PII leaks via YAML policies, and exposes a React dashboard backed by Prometheus and Grafana.

Mindmap

mindmap
  root((SentinelAI Gateway))
    Inputs
      LLM chat requests
      RAG retrieved chunks
      MCP tool calls
      YAML policy
    Outputs
      Filtered LLM response
      Risk scores
      Dashboard metrics
      Audit logs
    Use Cases
      Block prompt injection
      Redact PII before sending
      Failover across providers
    Tech Stack
      Python
      FastAPI
      React
      Docker
      Prometheus
      Grafana

Things people build with this

USE CASE 1

Front a production OpenAI app with prompt-injection and PII filtering

USE CASE 2

Failover from Anthropic to Gemini when the primary provider returns errors

USE CASE 3

Audit and rate-limit per-team API keys with a live attack dashboard

Tech stack

PythonFastAPIReactViteDocker ComposePrometheusGrafana

Getting it running

Difficulty · moderate Time to first run · 30min

Easiest start is docker compose up which brings API, dashboard, Prometheus and Grafana together; dev mode needs Vite and Python set up separately.

MIT license lets anyone use, modify, and redistribute the code as long as the copyright notice is kept.

In plain English

SentinelAI Gateway is a security middleware that sits between an application and the large language model providers it calls, such as OpenAI, Anthropic, Google Gemini, or a local Ollama instance. According to the README, every request and response passes through the gateway, where it is checked against a stack of security rules, filtered by configurable policies, and then logged for a real-time dashboard. The gateway is built on FastAPI for the proxy layer, with a React dashboard on the front. It handles JWT authentication and per-key rate limiting, and can fail over to a backup provider if the primary one fails. The injection detection engine ships with what the README calls 50 plus attack patterns, covering categories like jailbreak phrasings, role override attempts, direct instructions to ignore prior context, indirect attacks embedded in retrieved documents, unicode obfuscation, hidden base64 payloads, attempts to misuse tools, and attempts to extract the system prompt. Each check returns a structured score, a risk level, an action, and the matched pattern. There are also dedicated layers for PII detection and redaction across 20 plus categories including emails, phone numbers, API keys for various services, and JWT tokens, plus RAG pipeline checks that scan retrieved chunks for poisoned content before they reach the model. A separate MCP tool security layer enforces allow and deny lists for tool calls and redacts sensitive arguments. Rules are defined in a YAML policy file, with three starter profiles named default, strict, and permissive. The project is meant to be started with Docker Compose, which brings up the API, the dashboard, Prometheus, and Grafana together, with an alternative path that runs the FastAPI backend and the Vite frontend separately for development. Authentication uses an X-API-Key header, and the README lists endpoints for chat proxying, input and output checks, RAG validation, analytics, and policy management. The dashboard shows traffic, blocked attempts, attack type breakdowns, and provider usage. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Spin up SentinelAI Gateway with Docker Compose and route my OpenAI calls through it
Prompt 2
Write a strict YAML policy that blocks jailbreak phrasings and base64 hidden payloads
Prompt 3
Add a new PII detector for IBAN numbers to the redaction layer
Prompt 4
Show me the /v1/chat proxy endpoint code and how it scores incoming prompts
Open on GitHub → Explain another repo

Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.