# ishamishra0408/noleakmcp architecture

> Architecture diagram of the GitHub repository ishamishra0408/noleakmcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ishamishra0408/noleakmcp
- Repository: https://github.com/ishamishra0408/noleakmcp
- Video tour (about a minute): https://gitdiagram.com/ishamishra0408/noleakmcp/video

## Overview

No-Leak-MCP protects an agent’s message-ingest and tool-egress boundaries, then records security events for live monitoring. Its public arena demonstrates attacks and can investigate where an exposed credential may lead. The durable collector and Convex projection support event processing and real-time viewing. The graph follows README-described behavior and the supplied source excerpts; some arena, bridge, dashboard, and runtime wiring is documented but not shown in sampled source, so uncertain call links are omitted.

Main entry points: [`realtime/convex/ingest.ts`](https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/convex/ingest.ts) (Convex projection), [`render/worker/worker.mjs`](https://github.com/ishamishra0408/noleakmcp/blob/main/render/worker/worker.mjs) (Detection worker), [`render/arena/investigate.mjs`](https://github.com/ishamishra0408/noleakmcp/blob/main/render/arena/investigate.mjs) (Exposure investigation), [`plugins/injection-scorer/index.js`](https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/injection-scorer/index.js) (Injection scorer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controls["Agent controls"]
  node_scorer["Injection scorer<br/>[index.js]"]
  node_guard["Canary guard<br/>[index.js]"]
  node_invariant["Chain invariant<br/>[index.js]"]
end

subgraph group_arena["Arena investigation"]
  node_arenaapp["Public arena<br/>[server.mjs]"]
  node_investigate["Exposure investigation<br/>[investigate.mjs]"]
end

subgraph group_events["Event pipeline"]
  node_collector[("Durable collector<br/>[server.mjs]")]
  node_worker["Detection worker<br/>[worker.mjs]"]
  node_bridge["Log bridge<br/>[tail-to-convex.mjs]"]
end

subgraph group_viewing["Live monitoring"]
  node_convex[("Convex projection<br/>[ingest.ts]")]
  node_dashboard["Live dashboard<br/>[index.html]"]
end

node_engineer(("Agent operator"))
node_dsh["dsh harness"]
node_slack["Slack content"]
node_nebius["Nebius inference"]
node_linkup["Linkup search"]
node_viewer(("Dashboard viewer"))

node_slack -->|"supplies messages"| node_dsh
node_dsh -->|"scores ingested content"| node_scorer
node_scorer -->|"requests scoring"| node_nebius
node_dsh -->|"checks tool calls"| node_guard
node_dsh -->|"tracks read-to-egress"| node_invariant
node_engineer -->|"runs demonstration"| node_arenaapp
node_arenaapp -->|"starts investigation"| node_investigate
node_investigate -.->|"searches destinations"| node_linkup
node_investigate -->|"stores findings"| node_convex
node_worker -->|"reads events"| node_collector
node_worker -->|"updates checkpoint"| node_collector
node_worker -->|"ingests events"| node_convex
node_bridge -->|"ingests harness logs"| node_convex
node_viewer -->|"opens feed"| node_dashboard
node_dashboard -->|"subscribes to projection"| node_convex

click node_scorer "https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/injection-scorer/index.js"
click node_guard "https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/mcp-guard/index.js"
click node_invariant "https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/chain-invariant/index.js"
click node_arenaapp "https://github.com/ishamishra0408/noleakmcp/blob/main/render/arena/server.mjs"
click node_investigate "https://github.com/ishamishra0408/noleakmcp/blob/main/render/arena/investigate.mjs"
click node_collector "https://github.com/ishamishra0408/noleakmcp/blob/main/render/collector/server.mjs"
click node_worker "https://github.com/ishamishra0408/noleakmcp/blob/main/render/worker/worker.mjs"
click node_bridge "https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/bridge/tail-to-convex.mjs"
click node_convex "https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/convex/ingest.ts"
click node_dashboard "https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/dashboard/index.html"

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_scorer,node_guard,node_invariant,node_viewer toneBlue
class node_arenaapp,node_investigate toneAmber
class node_collector,node_worker,node_bridge toneMint
class node_convex,node_dashboard toneRose
class node_engineer,node_dsh,node_slack,node_nebius,node_linkup toneIndigo
```

## Components

### Agent controls

- [Injection scorer](https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/injection-scorer/index.js): `plugins/injection-scorer/index.js`
- [Canary guard](https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/mcp-guard/index.js): `plugins/mcp-guard/index.js`
- [Chain invariant](https://github.com/ishamishra0408/noleakmcp/blob/main/plugins/chain-invariant/index.js): `plugins/chain-invariant/index.js`

### Arena investigation

- [Public arena](https://github.com/ishamishra0408/noleakmcp/blob/main/render/arena/server.mjs): `render/arena/server.mjs`
- [Exposure investigation](https://github.com/ishamishra0408/noleakmcp/blob/main/render/arena/investigate.mjs): `render/arena/investigate.mjs`

### Event pipeline

- [Durable collector](https://github.com/ishamishra0408/noleakmcp/blob/main/render/collector/server.mjs): `render/collector/server.mjs`
- [Detection worker](https://github.com/ishamishra0408/noleakmcp/blob/main/render/worker/worker.mjs): `render/worker/worker.mjs`
- [Log bridge](https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/bridge/tail-to-convex.mjs): `realtime/bridge/tail-to-convex.mjs`

### Live monitoring

- [Convex projection](https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/convex/ingest.ts): `realtime/convex/ingest.ts`
- [Live dashboard](https://github.com/ishamishra0408/noleakmcp/blob/main/realtime/dashboard/index.html): `realtime/dashboard/index.html`

### Other components

- **Agent operator**
- **dsh harness**
- **Slack content**
- **Nebius inference**
- **Linkup search**
- **Dashboard viewer**

## Connections

- Slack content → dsh harness: supplies messages
- dsh harness → Injection scorer: scores ingested content
- Injection scorer → Nebius inference: requests scoring
- dsh harness → Canary guard: checks tool calls
- dsh harness → Chain invariant: tracks read-to-egress
- Agent operator → Public arena: runs demonstration
- Public arena → Exposure investigation: starts investigation
- Exposure investigation → Linkup search: searches destinations
- Exposure investigation → Convex projection: stores findings
- Detection worker → Durable collector: reads events
- Detection worker → Durable collector: updates checkpoint
- Detection worker → Convex projection: ingests events
- Log bridge → Convex projection: ingests harness logs
- Dashboard viewer → Live dashboard: opens feed
- Live dashboard → Convex projection: subscribes to projection
