Medusa Slack Gate
Human-in-the-loop approval gate for MCP agents, classifying tool calls by risk and requiring Slack-based human approval for medium/high risk actions.
README
Medusa Slack Gate
Human-in-the-loop approval for autonomous AI agents — enforced where teams already work: Slack.
Built for the Slack Agent Builder Challenge (Salesforce/Devpost).
⚠️ Eligibility note: Quebec residents are excluded from this hackathon's prize track per the official rules ("Canada, excluding Quebec"). This submission is a portfolio/proof-of-concept build, not a prize entry.
The Problem
Autonomous AI agents are getting real tool access — posting to channels, updating user roles, writing to databases. Most agent frameworks have no concept of "this action is risky enough that a human should see it first." One bad tool call and an agent can broadcast a false outage notice, grant admin access, or wipe production data — with nobody in the loop until it's already done.
The Solution: 4-Pillar Zero-Trust Gate
Medusa Slack Gate wraps any MCP-connected agent with a deterministic risk gate:
- Risk classification — every tool call is scored LOW / MEDIUM / HIGH based on the tool name and payload (e.g. anything touching
user_role,admin, orbroadcastkeys is automatically HIGH) - Auto-pass for LOW risk — reads, replies, and other non-destructive actions execute immediately, no friction
- Freeze + human approval for MEDIUM/HIGH — the action is held, logged as
PENDINGin an append-only SQLite audit trail, and a real Slack Block Kit card is posted with Approve / Deny buttons - Real-time unblock — a human clicks in Slack, the click flows through a Bolt Socket Mode receiver, the audit log updates, and the waiting agent resumes (or is denied) within seconds
No agent action executes in the MEDIUM/HIGH path without a human's explicit click. No exceptions, no silent timeouts that default to "allow."
Architecture
sequenceDiagram
autonumber
actor User as Administrateur (Phil)
participant Agent as Agent IA (Mock)
participant Gate as Medusa MCP Gate
participant DB as Base SQLite (Audit Log)
participant Slack as Canal #agent-approvals
Note over Agent, Gate: Étape 1 : Action Bas Risque (LOW)
Agent->>Gate: Appelle l'outil 'reply_thread'
Gate->>Gate: Évaluation : Risque Bas (LOW)
Gate-->>Agent: Statut : AUTO_PASSED (Exécution immédiate)
Note over Agent, Slack: Étape 2 : Action Haut Risque (HIGH)
Agent->>Gate: Appelle l'outil 'post_public_announcement'
Gate->>Gate: Évaluation : Risque Élevé (HIGH)
Gate->>DB: Enregistre la requête (Statut: PENDING)
Gate->>Slack: Envoie la carte interactive (Block Kit)
Note over Agent: L'Agent IA se fige (Polling actif)
Note over Slack, Agent: Étape 3 : Validation Humaine en Temps Réel
User->>Slack: Clique sur le bouton vert [Approve]
Slack->>DB: Le récepteur Bolt met à jour la base (Statut: APPROVED)
DB-->>Gate: Le polling détecte le changement de statut
Gate-->>Agent: Renvoie la décision : APPROVED
Note over Agent: L'Agent IA se débloque et s'exécute !
Gate->>Slack: Met à jour la carte (Affichage: ✅ APPROVED)
Stack: Model Context Protocol (MCP) · Slack Bolt SDK (Socket Mode — no public endpoint required) · Slack Block Kit · SQLite (audit trail)
Live Demo Result
Real end-to-end run, real Slack workspace, real human click:
{
"tool_name": "post_public_announcement",
"decision": "APPROVED",
"risk_level": "HIGH",
"request_id": "c2f5206b1b47",
"executed": true,
"result": "[executed] post_public_announcement with {'public_announcement': True, 'channel': '#general'}"
}
The Slack card updated in place to ✅ APPROVED by @Phil Mach-1 the instant the button was clicked — no polling delay visible to the human approver.
A LOW-risk action in the same run passed through instantly with zero Slack noise:
{
"tool_name": "reply_thread",
"decision": "AUTO_PASSED",
"risk_level": "LOW",
"executed": true
}
Installation
git clone <this-repo>
cd slack_agent
pip install -r requirements.txt
Create a Slack app from the manifest below (Create App → From a manifest):
{
"display_information": {
"name": "Medusa Slack Gate",
"description": "Human approval gate for risky agent actions before execution.",
"background_color": "#050810"
},
"features": {
"bot_user": { "display_name": "Medusa Gatekeeper", "always_online": true }
},
"oauth_config": {
"scopes": { "bot": ["chat:write", "commands"] }
},
"settings": {
"interactivity": { "is_enabled": true },
"org_deploy_enabled": false,
"socket_mode_enabled": true,
"token_rotation_enabled": false
}
}
Generate an App-Level Token (connections:write scope), install the app, invite the bot to your approval channel, then create .env:
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。