Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Approval Notifications and Webhooks

The dmint-mcp gateway can send an outbound notification when an MCP tool call needs human approval or is explicitly denied. Supported destinations are Slack incoming webhooks, Discord webhooks, and Microsoft Teams connectors.
Notifications are an integration-layer side effect. They are not part of the authorization decision, and Core (Dmint) does not dispatch them.

Architecture and Guarantees

MCP tool call │ ▼ EnforcementGate (asyncio event loop) │ decision: APPROVAL_REQUIRED or DENY ├───────────────────────────────┐ ▼ ▼ Persist / reject asyncio.to_thread(...) (decision is final) │ ▼ serialized notifier (one dispatch at a time) │ ┌────────────┼────────────┐ ▼ ▼ ▼ Slack Discord Teams
Authorization isolation: webhook failures, timeouts, HTTP 4xx/5xx responses, malformed URLs, and DNS failures never change the authorization decision and never cause the protected tool to execute. The MCP gateway catches and logs dispatch failures. A slow webhook blocks only that request’s notification handoff; it does not block the event loop, and concurrent dispatches are serialized.
route_call awaits the notification handoff before returning the approval/denial response. Dispatch is therefore at-most-once and synchronous from the caller’s perspective, not fire-and-forget. There is no automatic retry. If delivery is operationally important, monitor webhook logs and use a separate reliable queue.

Configuration

Set any combination of the following environment variables in the gateway process:
VariableDestinationDescription
DMINT_SLACK_WEBHOOK_URLSlackIncoming webhook URL.
DMINT_DISCORD_WEBHOOK_URLDiscordChannel webhook URL.
DMINT_TEAMS_WEBHOOK_URLMicrosoft TeamsConnector URL.
DMINT_MSTEAMS_WEBHOOK_URLMicrosoft TeamsLegacy alias used only when DMINT_TEAMS_WEBHOOK_URL is unset.
DMINT_WEBHOOK_TIMEOUTAllPositive request timeout in seconds (default 3.0). Invalid or non-positive values fall back to the default.
DMINT_WEBHOOK_ALLOWED_HOSTSAllOptional comma-separated hostname allowlist. Listed hosts skip the private/metadata address rejection, but still require HTTPS and DNS-pinned delivery. Use only for an operator-controlled internal destination.
The gateway constructs the notifier from these variables when no webhook_notifier was injected. The dmint dashboard and Core Python API do not read these variables for authorization purposes.

Payload Content

Approval notifications include:
  • approval ID (apr_...);
  • agent/principal ID;
  • tool and action (tool.action);
  • resource/target, or (none);
  • a CLI approval command (dmint approve apr_..., with --deployment-epoch when non-default);
  • the destination-specific formatting for Slack Block Kit, Discord embeds, or Teams MessageCard.
Denial notifications include the tool/action, resource, agent ID, and request ID.
The payload does not include raw argument values, a request fingerprint, or the full approval command with database credentials. The CLI command intentionally relies on DMINT_DATABASE_URL / local environment configuration rather than embedding a connection string in a chat message.

Security Defenses

1. Mention neutralization

Model-generated text can contain Slack/Discord mention syntax. Dmint inserts a zero-width space so injected approval arguments cannot notify a channel:
  • @everyone → @\u200beveryone
  • @here → @\u200bhere
  • <!channel> → <!&#8203;channel> (zero-width inserted after <!)
  • <@123456> / <@&role> → neutralized
These transformations apply to the fields that are rendered in notifications.
Markdown link syntax [label](url) is rewritten to [label] (url), and Slack-style bracketed URLs are neutralized. This reduces spoofed-link risk in approval messages.

3. Length and line bounds

Fields are stripped of carriage returns/newlines and truncated to 256 characters. Resource values and webhook credentials are redacted where applicable.

4. DNS pinning and SSRF guard

For every webhook URL Dmint:
  1. requires https://;
  2. rejects userinfo, empty labels, trailing-dot hostnames, and non-public literal addresses;
  3. resolves the hostname once and rejects loopback, RFC 1918 private, link-local, reserved, multicast, unspecified, shared-address (100.64.0.0/10), and cloud-metadata destinations;
  4. connects to the validated IP while preserving the original Host header and TLS SNI;
  5. disables redirects and environment HTTP proxies;
  6. rejects invalid or ambiguous webhook URLs with MCPConfigurationError before any connection.
The pinned connection removes the DNS-rebinding window between validation and POST. DMINT_WEBHOOK_ALLOWED_HOSTS is an explicit operator override for private destinations; it does not disable TLS verification or the no-redirect policy.

Programmatic MCP Usage

Hosts that construct the gateway directly can inject a notifier:
from dmint.core.webhooks import WebhookConfig, WebhookNotifier from dmint.mcp import MCPGateway notifier = WebhookNotifier( WebhookConfig( slack_url="https://hooks.slack.com/services/...", timeout=3.0, ) ) gateway = MCPGateway(config, webhook_notifier=notifier)
Do not pass webhook_notifier to Dmint(...) expecting Core to dispatch it. That parameter is deprecated and inert: Core emits a DeprecationWarning, and the notifier is never invoked. This preserves Core’s zero-network-call authorization invariant.

Failure Behavior

FailureEffect on authorizationEffect on notification
Webhook timeoutNone; decision unchangedLogged warning; no retry
HTTP 4xx/5xxNone; decision unchangedLogged warning; no retry
DNS/SSRF rejectionNone; decision unchangedLogged warning; no connection
Notification disabled/unconfiguredNoneNo-op
If notification delivery is a compliance requirement, run a durable event pipeline outside Dmint based on the persisted approval records; do not make tool execution depend on webhook availability.

Next Steps