# matamdinesh0802/sentinel-ai-governance architecture

> Architecture diagram of the GitHub repository matamdinesh0802/sentinel-ai-governance, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/matamdinesh0802/sentinel-ai-governance
- Repository: https://github.com/matamdinesh0802/sentinel-ai-governance

## Overview

Sentinel governs agent tool calls at the MCP boundary: an agent submits a call, the gate evaluates it, records and signs the decision, and quarantines failing trajectories before the proxy can forward them. Separate branches provide the Streamlit SOC console, dashboard API, and offline ledger verification. The README documents the major runtime capabilities; several backend and UI implementations were not excerpted, so those relationships are included only where documented or indexed, and some internals are represented at directory level.

Main entry points: [`apps/gate.py`](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/gate.py) (Governance gate), [`apps/proxy/main.py`](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/proxy/main.py) (MCP proxy), [`apps/evals`](https://github.com/matamdinesh0802/sentinel-ai-governance/tree/main/apps/evals) (Ten evaluations), [`streamlit_app.py`](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/streamlit_app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingress["Call governance"]
  node_proxy["MCP proxy<br/>[main.py]"]
  node_call_models["Call models<br/>[models.py]"]
  node_gate["Governance gate<br/>[gate.py]"]
end

subgraph group_checks["Evaluation"]
  node_policies["Agent policies<br/>[policies.py]"]
  node_pipeline["Eval pipeline<br/>[pipeline.py]"]
  node_evals["Ten evaluations"]
  node_eval_base["Eval interface<br/>[base.py]"]
  node_judge["LLM judge<br/>[judge.py]"]
end

subgraph group_audit["Audit and response"]
  node_database[("Governance database<br/>[db.py]")]
  node_ledger["Signed ledger<br/>[signer.py]"]
  node_verifier["Ledger verifier<br/>[verify.py]"]
  node_quarantine["Quarantine engine<br/>[engine.py]"]
  node_webhooks["Chat notifications"]
end

subgraph group_services["Interfaces"]
  node_api["Dashboard API<br/>[main.py]"]
end

subgraph group_console["SOC console"]
  node_streamlit["Streamlit app<br/>[streamlit_app.py]"]
  node_ui_pages["Console pages<br/>[pages.py]"]
  node_ui_components["UI components<br/>[components.py]"]
  node_demo["In-process demo<br/>[demo.py]"]
end

node_agent(("Agent"))
node_real_tool(("Downstream tool"))

node_agent -->|"submits call"| node_proxy
node_proxy -->|"processes call"| node_gate
node_proxy -.->|"uses models"| node_call_models
node_gate -->|"evaluates call"| node_pipeline
node_pipeline -->|"runs checks"| node_evals
node_evals -->|"implements interface"| node_eval_base
node_pipeline -.->|"applies policy"| node_policies
node_evals -.->|"consults rules"| node_policies
node_evals -.->|"requests judgments"| node_judge
node_gate -->|"persists records"| node_database
node_gate -->|"appends decision"| node_ledger
node_ledger -->|"stores entries"| node_database
node_gate -->|"freezes failures"| node_quarantine
node_quarantine -->|"sends alerts"| node_webhooks
node_proxy -.->|"forwards approved"| node_real_tool
node_verifier -.->|"verifies chain"| node_ledger
node_api -->|"reads dashboard data"| node_database
node_streamlit -->|"renders pages"| node_ui_pages
node_streamlit -->|"uses components"| node_ui_components
node_ui_pages -->|"renders"| node_ui_components
node_streamlit -->|"drives demo"| node_demo
node_demo -->|"calls in process"| node_gate
node_ui_pages -.->|"reads dashboard"| node_api

click node_proxy "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/proxy/main.py"
click node_call_models "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/proxy/models.py"
click node_gate "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/gate.py"
click node_policies "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/policies.py"
click node_pipeline "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/pipeline.py"
click node_evals "https://github.com/matamdinesh0802/sentinel-ai-governance/tree/main/apps/evals"
click node_eval_base "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/base.py"
click node_judge "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/judge.py"
click node_database "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/db.py"
click node_ledger "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/ledger/signer.py"
click node_verifier "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/ledger/verify.py"
click node_quarantine "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/quarantine/engine.py"
click node_api "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/api/main.py"
click node_streamlit "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/streamlit_app.py"
click node_ui_pages "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/pages.py"
click node_ui_components "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/components.py"
click node_demo "https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/demo.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_proxy,node_call_models,node_gate toneBlue
class node_policies,node_pipeline,node_evals,node_eval_base,node_judge toneAmber
class node_database,node_ledger,node_verifier,node_quarantine,node_webhooks toneMint
class node_api toneRose
class node_streamlit,node_ui_pages,node_ui_components,node_demo,node_agent,node_real_tool toneIndigo
```

## Components

### Call governance

- [MCP proxy](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/proxy/main.py): `apps/proxy/main.py`
- [Call models](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/proxy/models.py): `apps/proxy/models.py`
- [Governance gate](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/gate.py): `apps/gate.py`

### Evaluation

- [Agent policies](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/policies.py): `apps/evals/policies.py`
- [Eval pipeline](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/pipeline.py): `apps/evals/pipeline.py`
- [Ten evaluations](https://github.com/matamdinesh0802/sentinel-ai-governance/tree/main/apps/evals): `apps/evals`
- [Eval interface](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/base.py): `apps/evals/base.py`
- [LLM judge](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/evals/judge.py): `apps/evals/judge.py`

### Audit and response

- [Governance database](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/db.py): `apps/db.py`
- [Signed ledger](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/ledger/signer.py): `apps/ledger/signer.py`
- [Ledger verifier](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/ledger/verify.py): `apps/ledger/verify.py`
- [Quarantine engine](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/quarantine/engine.py): `apps/quarantine/engine.py`
- **Chat notifications**

### Interfaces

- [Dashboard API](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/apps/api/main.py): `apps/api/main.py`

### SOC console

- [Streamlit app](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/streamlit_app.py): `streamlit_app.py`
- [Console pages](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/pages.py): `ui/pages.py`
- [UI components](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/components.py): `ui/components.py`
- [In-process demo](https://github.com/matamdinesh0802/sentinel-ai-governance/blob/main/ui/demo.py): `ui/demo.py`

### Other components

- **Agent**
- **Downstream tool**

## Connections

- Agent → MCP proxy: submits call (evidence: `README.md`)
- MCP proxy → Governance gate: processes call (evidence: `README.md`)
- MCP proxy → Call models: uses models
- Governance gate → Eval pipeline: evaluates call (evidence: `apps/gate.py`)
- Eval pipeline → Ten evaluations: runs checks (evidence: `apps/evals/pipeline.py`)
- Ten evaluations → Eval interface: implements interface (evidence: `apps/evals/pipeline.py`)
- Eval pipeline → Agent policies: applies policy
- Ten evaluations → Agent policies: consults rules (evidence: `apps/evals/unauthorized_scope.py`)
- Ten evaluations → LLM judge: requests judgments (evidence: `apps/evals/prompt_injection.py`)
- Governance gate → Governance database: persists records (evidence: `apps/gate.py`)
- Governance gate → Signed ledger: appends decision (evidence: `apps/gate.py`)
- Signed ledger → Governance database: stores entries (evidence: `apps/ledger/signer.py`)
- Governance gate → Quarantine engine: freezes failures (evidence: `apps/gate.py`)
- Quarantine engine → Chat notifications: sends alerts (evidence: `apps/quarantine/engine.py`)
- MCP proxy → Downstream tool: forwards approved
- Ledger verifier → Signed ledger: verifies chain (evidence: `apps/ledger/verify.py`)
- Dashboard API → Governance database: reads dashboard data (evidence: `apps/api/main.py`)
- Streamlit app → Console pages: renders pages (evidence: `streamlit_app.py`)
- Streamlit app → UI components: uses components (evidence: `streamlit_app.py`)
- Console pages → UI components: renders (evidence: `ui/pages.py`)
- Streamlit app → In-process demo: drives demo (evidence: `streamlit_app.py`)
- In-process demo → Governance gate: calls in process (evidence: `ui/demo.py`)
- Console pages → Dashboard API: reads dashboard
