Deploy AI agents that talk to each other β and to humans β over WhatsApp, Telegram, and Microsoft Teams.
Getting Started Β· Features Β· Providers Β· Security Β· Deploy Β· Docs Β· Contribute
AI COMMS is a multi-agent communication network that connects AI models together through messaging platforms humans already use. Instead of building custom APIs for every agent, just give each one a phone number.
βββββββββββββββ WhatsApp βββββββββββββββ
β GPT-4o βββββββββββββββββΊβ Claude β
β Agent β Encrypted β Agent β
ββββββββ¬βββββββ Protocol ββββββββ¬ββββββββ
β β
β βββββββββββ β
ββββββββββΊβ Human βββββββββββββ
β User β
ββββββ¬βββββ
β
βββββββββ΄ββββββββ
β Telegram β
β Agent β
βββββββββββββββββ
- Agent A runs OpenAI on phone number 1
- Agent B runs Anthropic on phone number 2
- They message each other over WhatsApp using an encrypted JSON protocol
- Humans can jump into the conversation naturally
- If OpenAI goes down, Agent A automatically fails over to Google Gemini
No servers to expose. No webhooks to configure. No custom APIs. Just WhatsApp.
| Feature | Description |
|---|---|
| π 18 AI Providers | Plug in any major AI model with one env variable |
| π¬ WhatsApp + Telegram + Teams | Works on platforms people already use |
| π€ Agent Protocol | Structured JSON messaging between AI agents |
| π₯ Multi-Agent Groups | Create groups with multiple AI agents + humans |
| π End-to-End Encryption | AES-256-GCM encrypted payloads between agents |
| π‘οΈ Jailbreak Defense | 6-layer protection against prompt injection attacks |
| π Auto Failover | Primary provider down? Fallback chain kicks in |
| π Health Monitoring | /health endpoint for load balancers and Docker |
| ποΈ Persistent Storage | Conversations, groups, and registry survive restarts |
| π Audit Logging | Every security event logged and rotated |
| π³ Docker Ready | One command to deploy |
| β‘ Production Hardened | Graceful shutdown, timeouts, env validation, write safety |
git clone https://github.com/Jovancoding/AI-COMMS.git
cd AI-COMMS
npm install
cp .env.example .envSet your provider in .env:
AI_PROVIDER=openai
OPENAI_API_KEY=sk-...Start:
npm startScan the QR code in your terminal β your AI agent is live on WhatsApp.
Switch providers with a single environment variable. Every provider has fetch timeouts, error handling, and failover built in.
| Provider | Model | Env Key |
|---|---|---|
| OpenAI | GPT-4o | OPENAI_API_KEY |
| Anthropic | Claude Sonnet 4 | ANTHROPIC_API_KEY |
| Gemini 2.0 Flash | GOOGLE_API_KEY |
|
| Mistral | Mistral Large | MISTRAL_API_KEY |
| Cohere | Command R+ | COHERE_API_KEY |
| Groq | LLaMA 3.3 70B | GROQ_API_KEY |
| DeepSeek | DeepSeek Chat | DEEPSEEK_API_KEY |
| xAI | Grok 2 | XAI_API_KEY |
| Perplexity | Sonar Pro | PERPLEXITY_API_KEY |
| Together AI | LLaMA 3 70B | TOGETHER_API_KEY |
| Fireworks | LLaMA 3.1 70B | FIREWORKS_API_KEY |
| NVIDIA NIM | Nemotron 3 Super | NVIDIA_API_KEY |
| OpenClaw | Any (self-hosted) | OPENCLAW_BASE_URL |
| Ollama | LLaMA 3 (local) | OLLAMA_BASE_URL |
| Codex | o4-mini | OPENAI_API_KEY |
| GitHub Copilot | GPT-4o via GitHub | COPILOT_TOKEN |
| Claude Code | Claude + thinking | ANTHROPIC_API_KEY |
| Claude Cowork | Claude + collab | ANTHROPIC_API_KEY |
AI_PROVIDER=openai
AI_FALLBACK_PROVIDERS=anthropic,google,groqIf OpenAI fails β tries Anthropic β tries Google β tries Groq. Automatic. Zero downtime.
AI COMMS was built with a security-first mindset. Every layer is configurable.
Incoming Message
β
βΌ
ββββββββββββββββ
β Allowlist ββββΊ Block unknown senders
ββββββββββββββββ€
β Rate Limit ββββΊ Block message flooding
ββββββββββββββββ€
β Size Check ββββΊ Block oversized payloads
ββββββββββββββββ€
β HMAC Auth ββββΊ Verify agent identity
ββββββββββββββββ€
β Jailbreak ββββΊ Block prompt injection (6 layers)
β Defense β Β· Pattern matching (40+ signatures)
β β Β· Encoding detection (base64, hex, reversed)
β β Β· Persona hijack blocking
β β Β· System prompt extraction prevention
β β Β· Multi-turn escalation tracking
β β Β· Output validation
ββββββββββββββββ€
β Encryption ββββΊ AES-256-GCM + HMAC-SHA256
ββββββββββββββββ€
β Audit Log ββββΊ Everything logged to disk
ββββββββββββββββ
β
βΌ
AI Provider
SECURITY_ENABLE_ALLOWLIST=true
SECURITY_ALLOWLIST=+1234567890,+0987654321
SECURITY_BLOCK_PROMPT_INJECTION=true
SECURITY_REQUIRE_AGENT_AUTH=true
SECURITY_AGENT_SECRET=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")
SECURITY_ENCRYPTION_KEY=$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")Agents communicate using a structured JSON envelope:
{
"protocol": "ai-comms",
"version": "1.0",
"from": { "agentId": "agent_001", "agentName": "Atlas" },
"to": { "agentId": "agent_002", "agentName": "Nova" },
"intent": "chat",
"payload": "What's the latest on the research paper?",
"conversationId": "conv_abc123",
"timestamp": "2026-04-04T12:00:00.000Z"
}Messages are signed with HMAC-SHA256 and encrypted with AES-256-GCM. Replay attacks are blocked by timestamp validation.
Create virtual groups where multiple AI agents and humans collaborate:
You (WhatsApp): Create a research group with Nova and Atlas
Agent: β Group created: "Research Team" (3 members)
Broadcasting to all members...
Agents can:
- Join and leave groups
- Broadcast to all members
- Share conversation context
- Delegate tasks between each other
Add your number to ADMIN_LIST in .env, then control your agent from WhatsApp:
| Command | What it does |
|---|---|
!status |
Agent status, uptime, memory usage |
!groups |
List all multi-agent groups |
!agents |
Show registered agents on the network |
!logs 20 |
Last 20 audit log entries |
!provider |
Current AI provider and model |
!security |
Security config overview |
!help |
All available commands |
src/
βββ index.js # Entry β platforms + health + graceful shutdown
βββ orchestrator.js # Message routing: security β AI β response
βββ config.js # Environment variable mappings
βββ protocol.js # Agent-to-agent JSON protocol
βββ groups.js # Multi-agent group management
βββ storage.js # JSON persistence with write safety
βββ security.js # Allowlist, rate limit, HMAC auth
βββ jailbreak-defense.js # 6-layer prompt injection defense
βββ encryption.js # AES-256-GCM payload encryption
βββ failover.js # Provider failover chain
βββ rate-limiter.js # Token-bucket rate limiter
βββ health.js # HTTP /health + /ready endpoints
βββ discovery.js # Agent registry + announcements
βββ admin.js # WhatsApp admin commands
βββ media.js # Image/audio/video/document handler
βββ audit-log.js # Persistent event logging
βββ safe-fetch.js # Fetch wrapper with timeouts
βββ startup-checks.js # Boot-time security validation
βββ test-suite.js # 64 automated tests
βββ whatsapp/
β βββ baileys-client.js # WhatsApp via QR scan (free)
β βββ cloud-api-client.js # WhatsApp via Meta Cloud API
βββ teams/
β βββ teams-client.js # Microsoft Teams Bot Framework
βββ providers/ # 18 AI provider adapters
docker compose up -dnpm install -g pm2
pm2 start ecosystem.config.cjs
pm2 saveNODE_ENV=production node src/index.jscurl http://localhost:9090/health{
"status": "ok",
"agent": "MyAI",
"provider": "openai",
"uptime": 3600,
"stats": { "messagesReceived": 150, "messagesSent": 148, "errors": 2 }
}64 automated tests covering the full stack:
npm test=== AI COMMS β Test Suite ===
β config loads
β protocol builds valid envelope
β createGroup works
β AES-256-GCM roundtrip works
β checkJailbreak blocks direct injection
β checkJailbreak blocks persona hijack (DAN)
β validateOutput catches system prompt leaks
... (64 total)
Results: 64 passed, 0 failed
Contributions are welcome! Open an issue or PR for:
- New AI provider adapters
- New messaging platform integrations
- Security improvements
- Bug fixes
git clone https://github.com/Jovancoding/AI-COMMS.git
cd AI-COMMS
npm install
npm test # make sure all 64 tests passSee .env.example for the full list with descriptions.
| Guide | Description |
|---|---|
| Setup Guide | Step-by-step setup for WhatsApp (Baileys + Cloud API), Teams, Docker, PM2 |
| Providers Guide | How to configure each of the 18 AI providers with examples |
| Security Guide | Full security configuration β allowlists, encryption, jailbreak defense |
| Multi-Agent Guide | Run multiple agents that talk to each other, create groups, failover |
MIT β use it however you want.
Built for the multi-agent future.
β Star this repo if AI agents talking to each other over WhatsApp sounds as cool to you as it does to us.