Aegis
Aegis is a blast-radius auditor for AI agents that detects toxic capability combinations and data exfiltration paths deterministically, all without using LLM tokens for detection.
Connect tools: Use
connect_toolto attach tools (Gmail, Dropbox, Postgres, Slack, Filesystem, Calendar) to an agent, granting it their capabilities.Visualize capabilities:
get_capability_graphreturns a graph with nodes, edges (danger flags in red), attack paths, and an overall risk score.Detect attack paths:
detect_attack_pathsruns a deterministic engine that identifies dangerous combinations (e.g.,READ_PRIVATE_DATA+SEND_EXTERNALfor exfiltration,READ_PRIVATE_DATA+WRITE_PUBLICfor public leak,DELETE_DATA+EXECUTEfor destructive automation) and reports severity and affected tools.Automatically remediate:
apply_policy_fixdisconnects the tool providing the dangerous sink capability, neutralizing the attack path and resetting the risk score.Explain findings:
explain_attack_pathprovides plain-English explanations via an LLM (Groq), which is only invoked on rule matches and cached.Access policies: Retrieve the full set of toxic-combination rules in JSON from the
aegis://policiesresource.
Connects Dropbox to an AI agent and audits its permissions for risky capability combinations such as reading private data and writing to public locations.
Connects Gmail to an AI agent and audits its permissions for dangerous combinations like reading private data and sending it externally.
Connects Slack to an AI agent and audits its permissions for attack paths like exfiltration of private data through Slack messages.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Aegis check my connected MCP tools for dangerous combinations"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Aegis π‘οΈ
A Blast-Radius Auditor for AI Agents Track 03: Enterprise AI & Workplace Automation β NitroStack Hackathon
Aegis is a Model Context Protocol (MCP) server built on NitroStack that audits the combined effective permissions of an AI agent across all connected tools. It deterministically detects toxic capability combinations and data-exfiltration vectors before deployment β at zero LLM token cost.
π΄ Live server: https://aegis-6a6d76ee-teamx-srmist.app.nitrocloud.ai/mcp β connect it to Claude, ChatGPT, or NitroStack Studio and try the walkthrough below for real.
π Table of Contents
Related MCP server: AgentWard
π The Problem
Enterprises connect AI agents to dozens of tools β Gmail, Dropbox, Postgres databases, Slack, filesystem execution. Each integration gets approved individually on its own merits, but nobody audits what the agent can do when tools are combined.
ββββββββββββββββββ ββββββββββββββββββ
β Dropbox MCP β β Gmail MCP β
β (Read Private) β β (Send External)β
βββββββββ¬βββββββββ βββββββββ¬βββββββββ
β β
βββββββββββββ¬ββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β Support Agent β
ββββββββββββββ¬βββββββββββββ
βΌ
π¨ TOXIC COMBINATION: DATA EXFILTRATION PATHREAD_PRIVATE_DATA(Dropbox) +SEND_EXTERNAL(Gmail) = π΄ Data Exfiltration PathREAD_PRIVATE_DATA(Postgres) +WRITE_PUBLIC(Slack) = π Public Leak PathDELETE_DATA(Postgres) +EXECUTE(Filesystem) = π Destructive Automation Vector
This isn't hypothetical β it's how the Supabase MCP leak happened (an agent with legitimate database read access was steered via prompt injection into exfiltrating private records through an external channel), how the postmark-mcp supply-chain compromise turned an ordinary "send email" tool into a covert BCC-to-attacker exfiltration path, and the exact mechanism behind documented tool-poisoning attacks, where malicious instructions hidden in a tool's own description hijack agent behavior without ever calling an obviously malicious endpoint. Individually-reasonable permissions become dangerous the moment they're combined, and nothing in the stack today computes that union before it's exploited.
πΈ See It Work
Real, live-rendered screenshots β the actual widgets, fed the actual output of get_capability_graph / detect_attack_paths after connecting gmail + dropbox to one agent.
The graph β dangerous capability paths render in red:

The alert β severity, affected tools, and one-click remediation:

After clicking Fix, apply_policy_fix disconnects every tool supplying the sink capability and the graph goes back to riskScore: 0 β no attack paths, clean state.
π System Architecture
flowchart TD
subgraph Host["Chat Host / Client"]
Client["User / AI Agent Host\n(NitroStudio, ChatGPT, Claude)"]
end
subgraph MCP["Aegis MCP Server (NitroStack)"]
Tools["Governance Tools Controller\n(connect_tool, get_capability_graph,\ndetect_attack_paths, apply_policy_fix)"]
Guard["OAuthGuard\n(scaffolded, opt-in via OAUTH_REQUIRED β\nopen by default for the hackathon build)"]
Resources["Resource Server\n(aegis://policies)"]
Prompts["Prompt Controller\n(explain_attack_path)"]
Guard -. wraps connect_tool only .-> Tools
end
subgraph Engine["Deterministic Engine β 0 Tokens"]
Registry["Tool Capability Registry\n(gmail, dropbox, postgres, slack,\nfilesystem, calendar)"]
Store["Per-Agent Connected-Tool Store\n(in-memory)"]
Union["Effective Capability Union\n(getEffectiveCapabilities)"]
Detector["Policy Rule Matcher\n(detectAttackPaths)"]
Registry --> Store --> Union --> Detector
end
subgraph UI["NitroStack Widgets"]
GraphWidget["capability-graph\n(live risk graph)"]
AlertWidget["attack-path-alert\n(severity + one-click Fix)"]
end
subgraph LLM["Groq Explanation Layer β only LLM spend"]
Groq["Llama 3.1 8B Instant\ncached by SHA-256(ruleId + sorted(viaTools))"]
end
Client -->|STDIO / HTTP JSON-RPC| Tools
Tools --> Engine
Detector -->|risk score + danger edges| GraphWidget
Detector -->|threat path list| AlertWidget
Prompts -->|only on a detected path, cache miss| Groq
Groq -->|plain-English finding| Client
AlertWidget -->|Fix click| Toolsπ Detection & Remediation Lifecycle
flowchart LR
A["1. Connect Gmail"] -->|connect_tool| B["READ_PRIVATE_DATA + SEND_EXTERNAL"]
B --> C["π’ SAFE β riskScore 0"]
C --> D["2. Connect Dropbox"]
D -->|connect_tool| E["+ WRITE_DATA"]
E --> F["Detector checks policy table"]
F -->|source+sink both present| G["π¨ exfiltration DETECTED"]
G --> H["3. Render widgets"]
H -->|get_capability_graph| I["Graph edge turns RED β riskScore 1"]
H -->|explain_attack_path| J["Groq: plain-English summary"]
I --> K["4. Remediate"]
K -->|apply_policy_fix| L["Every tool supplying the sink\ncapability is disconnected"]
L --> M["Status cleared β riskScore 0"]π οΈ Tool & Capability Registry
Tool | Tool ID | Granted Capabilities | Risk Profile |
π§ |
|
| π High |
π¦ |
|
| π High |
ποΈ |
|
| π΄ Critical |
π¬ |
|
| π‘ Medium |
π» |
|
| π΄ Critical |
π |
|
| π’ Low |
π― Toxic-Combination Policy Rules
Rule ID | Source | Sink | Severity | Violation |
|
|
| π΄ Critical | Agent can read private data AND transmit it externally. |
|
|
| π High | Agent can read private records AND post them publicly. |
|
|
| π High | Agent can delete data AND execute unvalidated actions. |
Both tables are just data (TOOL_REGISTRY and POLICY_RULES) β adding a 7th tool or a 4th rule is a one-line change, not new logic.
π MCP Interface Reference
Tools
connect_toolβ connects a tool (gmail,dropbox,postgres,slack,filesystem,calendar) to an agent. Wrapped inOAuthGuard(scaffolded β enforced only ifOAUTH_REQUIRED=trueis set; open by default for local/demo use).get_capability_graphβ@Widget('capability-graph'). Returns nodes, danger edges, active attack paths, and risk score.detect_attack_pathsβ@Widget('attack-path-alert'). Runs the deterministic rule engine.apply_policy_fixβ disconnects every tool supplying a detected rule's sink capability.
Resource
aegis://policiesβ the toxic-combination policy table as JSON.
Prompt
explain_attack_pathβ takesagentId+ruleId, returns a plain-English explanation via Groq (llama-3.1-8b-instant). Only fires on an already-detected path, cached bySHA-256(ruleId + sorted(viaTools))β this is the only step in the entire system that spends a token.
MCP surface map
flowchart LR
Agent(("π‘οΈ Aegis"))
Agent --> T1["π§ connect_tool"]
Agent --> T2["π§ get_capability_graph"]
Agent --> T3["π§ detect_attack_paths"]
Agent --> T4["π§ apply_policy_fix"]
Agent --> R1["π aegis://policies"]
Agent --> P1["π¬ explain_attack_path"]
T2 -.renders.-> W1["π¨ capability-graph widget"]
T3 -.renders.-> W2["π¨ attack-path-alert widget"]βΆοΈ Try It Yourself
Every step below works against the live server β no local setup needed. Connect https://aegis-6a6d76ee-teamx-srmist.app.nitrocloud.ai/mcp to Claude (Settings β Connectors β Add custom connector) or ChatGPT (Developer Mode β Plugins β Add), or point NitroStack Studio at this repo locally, then walk through the same scenario the screenshots above were taken from:
Connect a tool. "Connect gmail to demo-agent." β
connect_toolfires. One tool, nothing alarming yet.Connect a second tool. "Now connect dropbox to demo-agent." β the agent can now both read private data and send it externally.
See the risk. "Show me its capability graph." β
get_capability_graphrenders β the exfiltration edge is red. This step is pure deterministic rule matching: zero LLM tokens spent to catch it.Get a plain-English explanation. "What does this mean?" β
explain_attack_pathfires β the only step in the whole system that calls an LLM, and only because a rule already matched.Fix it. "Fix it." β
apply_policy_fixdisconnects every tool supplying the dangerous capability. The graph goes back toriskScore: 0.
Use any agentId you like β it's just an in-memory key, not a real account.
π Quickstart (run it locally)
git clone https://github.com/prince-rai88/aegis-mcp.git
cd aegis-mcp
npm install
cp .env.example .env # add GROQ_API_KEY β free at console.groq.com
npm run devVerify without any GUI:
bash scripts/test-mcp.shOr connect NitroStack Studio β Add Server β Nitro Project β select this folder, then run through the walkthrough above against your local server instead of the live one.
β FAQ
Why deterministic rules instead of having the model decide what's risky?
Because then the audit trail is "the model thought so." Detection here is a fixed rule table (source capability β sink capability), so every flag is reproducible and explainable without re-running an LLM.
Does this scale beyond 6 tools and 3 rules?
TOOL_REGISTRY and the policy rules are both just data β adding a 7th tool or a 4th rule is a one-line addition, not new logic.
What does the LLM actually do, then?
Only explain_attack_path, only after a rule has already fired, cached by SHA-256(ruleId + sorted(viaTools)) so the same finding is never re-explained twice.
π Project Structure
aegis-mcp/
βββ src/
β βββ app.module.ts # NitroStack root module
β βββ index.ts # Server bootstrap
β βββ modules/governance/ # Security governance engine
β β βββ capability.ts # Capability model + TOOL_REGISTRY
β β βββ detector.ts # 0-token deterministic detector
β β βββ policies.ts # Toxic-combination policy rules
β β βββ oauth.guard.ts # Scaffolded OAuth guard
β β βββ governance.tools.ts # The 4 MCP tools
β β βββ governance.resources.ts # aegis://policies
β β βββ governance.prompts.ts # Groq explanation prompt
β β βββ governance.module.ts
β βββ widgets/app/
β βββ capability-graph/ # Capability graph widget
β βββ attack-path-alert/ # Attack path alert widget
βββ docs/screenshots/ # Real rendered widget screenshots
βββ scripts/
β βββ test-mcp.sh # Stdio JSON-RPC smoke test
β βββ preview-widgets.html # Local widget preview, no Studio needed
βββ README.mdπ License
Available Tools
4 toolsapply_policy_fixA
Remediate a detected attack path by disconnecting the tool that supplies its riskier (sink) capability from the agent, then return the refreshed capability graph.
Inputs: ruleId (required), agentId (required).
connect_toolA
Connect a third-party tool (gmail, dropbox, postgres, slack, filesystem, calendar) to an agent, granting it that tool's capabilities. Returns the agent's updated effective capability set.
Inputs: toolId (required), agentId (required).
detect_attack_pathsA
Run the deterministic toxic-capability-combination detector for an agent and return any detected attack paths with severity and an overall risk score.
Inputs: agentId (required).
get_capability_graphA
Return the agent's capability graph: nodes (agent/tool/capability), edges (danger=true when part of a detected attack path), detected attack paths, and an overall risk score.
Inputs: agentId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: connect_tool adds capabilities, get_capability_graph inspects state, detect_attack_paths analyzes for risks, and apply_policy_fix remediates. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern with underscore separation: connect_tool, get_capability_graph, detect_attack_paths, apply_policy_fix. The style is uniform and predictable.
Four tools is well-scoped for a focused security/capability management server. Each tool covers a necessary step and none feel extraneous.
The set covers the core lifecycle: connect, inspect, detect, and remediate. The only minor gap is the lack of a direct 'disconnect_tool' independent of attack-path remediation, but apply_policy_fix effectively serves that purpose.
Related MCP Connectors
Zero-secret MCP gateway for AI agents: risk-scored, audited calls with human-in-the-loop approval.
Security gateway for AI agents: policy, approval, and audited execution, no secrets shared.
Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
Identity, authorization, audit trails, and revocable permissions for AI agents accessing MCP tools.
Related MCP Servers
- AlicenseAqualityCmaintenanceSecurity co-pilot for AI agents. Scans for vulnerabilities like prompt injection, infinite loops, and token bombing in AI Agents, audits MCP servers, verifies AGENTS.md governance, and generates EU AI Act compliance reports.10109 npm3Apache 2.0
- AlicenseAqualityDmaintenanceOpen-source permission control plane for AI agents β scan, enforce, and audit every tool call with code-level policies that prompt injection can't bypass.1419Business Source 1.1
- FlicenseNot gradedqualityCmaintenanceMCP server for auditing AI agent permissions and access by scanning for the trifecta of credentials, injection, and reach without heavy infrastructure.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to securely manage Linux, Docker, Kubernetes, and SSH infrastructure through MCP with permission control, audit logging, and dangerous command filtering.MIT