Guarded WhatsApp logo

Guarded WhatsApp

Governed WhatsApp messaging for AI agents with allowlists, scans, confirmations, rate limits, file checks, and audit logs.

Install Guarded WhatsApp

Run the project’s own setup commands, in order.

Setup steps from the project

Guarded WhatsApp installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/peter-tnc-453/guarded-whatsapp-mcp
    
  2. 2. Run
    cd guarded-whatsapp-mcp
    
  3. 3. Configure
    uv venv --python 3.11 && source .venv/bin/activate   # Python 3.10+
    
  4. 4. Install
    uv pip install -e .
    
  5. 5. Configure
    cp config/allowlist.example.yaml config/allowlist.yaml   # edit your allowlist (git-ignored)
    
  6. 6. Start the server
    python -m wa_guard          # run the MCP server (stdio)
    

Overview

Guarded WhatsApp MCP server places a configurable security gate in front of WhatsApp messages and files sent by AI agents. It checks recipients, scans text and captions for secrets or sensitive data, validates files, applies rate limits, and records attempts in an append-only audit log. The server runs over stdio and sends through an authenticated WhatsApp bridge exposing POST /api/send. Reach for it when an agent needs controlled WhatsApp automation rather than unrestricted messaging.

Use cases

  • Restrict agent messages to approved WhatsApp contacts
  • Preview risky messages and file sends before delivery
  • Block secrets and sensitive data in outbound content
  • Inspect recent blocked, failed, and sent attempts
  • Limit automated WhatsApp traffic by time window

Key features

  • Fail-closed recipient allowlist
  • Secret and sensitive-data scanning
  • File type, size, and filename validation
  • Preview and confirmation-token gate
  • Sliding-window rate limits
  • Append-only audit logging

Tools5

What Guarded WhatsApp lets your agent do. Expand a tool for its parameters.

Self-reported~87 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

15/15 checks healthy over the last 83d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 1Low 1

Scanned 9/15/2026 via OSV.dev

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit5mo agoMost recent push to the default branch.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Guarded WhatsApp works

What Guarded WhatsApp does

The Guarded WhatsApp MCP server governs outbound WhatsApp messages and files from an AI agent. It does not provide a chat workspace, channels, threads, or an inbound messaging interface. Instead, it adds policy checks between MCP tool calls and an existing WhatsApp transport.

Its default transport is an unofficial whatsmeow-based bridge, such as whatsapp-mcp, which communicates through WhatsApp Web’s private protocol. The project identifies this transport as a terms-of-service risk and recommends using a secondary, non-critical number. It is not positioned for production customer messaging; an official WhatsApp Business Cloud API backend is listed as future work.

The Guarded WhatsApp MCP server fails closed for recipients unless configuration permits unlisted contacts. It can also require a preview and confirmation token before selected sends, including file sends or all sends, depending on policy.

How it works

An MCP client starts the server through the wa_guard Python module using stdio. Each send request passes through the configured checks before the bridge is called. A preview runs those checks without sending anything and returns a verdict. When confirmation is required, the preview returns a confirm_token; the subsequent send must provide that token.

Text and file captions are checked for API keys, private keys, cloud, Slack, GitHub, and OpenAI tokens, JWTs, credit-card numbers, and national IDs. Detection can block the request or issue a warning according to configuration. File requests are checked against extension and size rules, and filenames are converted to ASCII-safe names before sending.

Rate limits use per-minute and per-hour sliding windows. Every attempt, including blocked and failed requests, is appended to the audit log. Message bodies are stored as a preview and hash rather than the full body.

Setup and configuration

Install the project with Python 3.10 or newer, preferably in a virtual environment, then install it in editable mode. Copy the example allowlist configuration to config/allowlist.yaml and edit the recipients and policies. The configuration file is ignored by Git in the documented setup.

An authenticated WhatsApp bridge exposing POST /api/send must already be running. With the example stdio registration, set PYTHONPATH to the repository’s src directory and set WA_GUARD_CONFIG to the allowlist file, then run python -m wa_guard.

Important configuration areas include allow_unlisted, require_confirm_for, rate_limit, files, secrets.on_detect, and the recipient allowlist. Configuration edits hot-reload on each call. The default audit path is ~/.guarded-whatsapp-mcp/audit.jsonl.

Tools and capabilities

The Guarded WhatsApp MCP server exposes these tools:

  • wa_list_recipients shows the configured allowlist with numbers masked.
  • wa_preview performs a dry run and returns the result plus a confirmation token when required.
  • wa_send_message sends text through the complete policy gate.
  • wa_send_file sends a validated file with an optional scanned caption.
  • wa_audit_tail returns recent audit records.

A typical controlled flow previews a file send first, then passes the returned token to wa_send_file. An unallowlisted recipient or a failed content check produces an explicit blocked result instead of a send.

Limitations and notes

The current default bridge is unofficial and may violate WhatsApp’s Terms of Service or result in a number ban. The guard reduces operational risks such as wrong recipients, leaked secrets, oversized or disallowed files, and runaway sending; it does not remove the transport’s policy or account risk.

The project is marked alpha. Official Cloud API support, inbound routing, scheduled or templated sends, and per-recipient policies are listed as roadmap items rather than current capabilities.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Guarded WhatsApp

Guarded WhatsApp is an MCP server that connects AI agents to an authenticated WhatsApp bridge through a configurable security gate. Its main tools list recipients, preview sends, send messages, send validated files, and inspect audit records. Allowlisting, scanning, confirmation tokens, rate limits, and logging govern outbound actions.

Install it with Python 3.10 or newer in a virtual environment, then run `uv pip install -e .` from the repository. Copy and edit the example allowlist, ensure an authenticated bridge exposing `POST /api/send` is running, and start the server with `python -m wa_guard`.

It uses `wa_preview` to run the send checks without delivering anything. If policy requires confirmation, the preview returns a `confirm_token`, and the send tool must receive that token. Recipient rules, content scans, file checks, and rate limits can also block the request.

Its documented example uses Claude Code or any MCP client, with a command, arguments, `PYTHONPATH`, and `WA_GUARD_CONFIG`.

No. The project advises against production customer messaging with its default unofficial whatsmeow-based bridge because it may violate WhatsApp’s Terms of Service and may result in a number ban. It recommends a secondary, non-critical number; official Cloud API support is listed as future work.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGuarded WhatsApp AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/guarded-whatsapp?style=directory)](https://allmcps.com/mcp/guarded-whatsapp)
HTML Embed
<a href="https://allmcps.com/mcp/guarded-whatsapp"><img src="https://allmcps.com/api/badge/guarded-whatsapp?style=directory" alt="Guarded WhatsApp on AllMCPs" /></a>