explaingit

shauryasinghh25/sentinel-ai-gateway

Analysis updated 2026-06-24

0PythonAudience · ops devopsComplexity · 4/5LicenseSetup · 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
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

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

What is it built with?

PythonFastAPIReactViteDocker ComposePrometheusGrafana

How does it compare?

shauryasinghh25/sentinel-ai-gateway0xhassaan/nn-from-scratcha-little-hoof/dsr
Stars000
LanguagePythonPythonPython
Setup difficultymoderatemoderatehard
Complexity4/54/55/5
Audienceops devopsdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get 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

Frequently asked questions

What is sentinel-ai-gateway?

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.

What language is sentinel-ai-gateway written in?

Mainly Python. The stack also includes Python, FastAPI, React.

What license does sentinel-ai-gateway use?

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

How hard is sentinel-ai-gateway to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sentinel-ai-gateway for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.