DEV Community

Cover image for Push Relay + Telegram: Real-Time Transaction Approval for AI Agents
Wallet Guy
Wallet Guy

Posted on

Push Relay + Telegram: Real-Time Transaction Approval for AI Agents

AI agents with crypto wallets need real-time approval systems to prevent unauthorized transactions while maintaining operational speed. When your trading bot or DeFi agent encounters a high-value transaction that exceeds policy limits, you need immediate notification and the ability to approve or deny the action without compromising security or custody control.

Why Real-Time Approval Matters

The challenge with autonomous AI agents isn't just preventing them from making bad trades—it's maintaining oversight without becoming a bottleneck. Traditional crypto security assumes human-only access, but AI agents operate at machine speed across multiple protocols simultaneously. A spending limit policy might catch obvious problems, but what about edge cases? Market opportunities that exceed your daily limits? Emergency liquidations during volatile conditions?

You need a system that can instantly notify you when agent actions require approval, provide transaction context, and let you respond immediately from any device. Email notifications are too slow, SMS lacks transaction details, and checking a web dashboard isn't practical when you're away from your computer.

How WAIaaS Implements Real-Time Approval

WAIaaS provides 2 real-time approval channels specifically designed for AI agent oversight: Push Relay notifications and Telegram integration. Both work with WAIaaS's 4-tier security system (INSTANT/NOTIFY/DELAY/APPROVAL) to give you precise control over when human approval is required.

Push Relay: Native Mobile Notifications

The Push Relay service sends native push notifications to your mobile device whenever an AI agent transaction requires approval. Unlike generic notification services, Push Relay is built specifically for crypto transaction approval workflows.

Here's how to set up Push Relay for transaction approval:

# Start both daemon and push-relay services
docker compose up -d

# The push-relay service runs on port 3101 by default
# Check if it's running
curl http://127.0.0.1:3101/health
Enter fullscreen mode Exit fullscreen mode

Configure your wallet policies to trigger APPROVAL tier for high-value transactions:

curl -X POST http://localhost:3100/v1/policies \
  -H 'Content-Type: application/json' \
  -H 'X-Master-Password: <password>' \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "SPENDING_LIMIT",
    "rules": {
      "instant_max_usd": 10,
      "notify_max_usd": 100,
      "delay_max_usd": 1000,
      "delay_seconds": 300,
      "daily_limit_usd": 500
    }
  }'
Enter fullscreen mode Exit fullscreen mode

When your AI agent attempts a transaction exceeding these limits, Push Relay immediately sends a notification containing:

  • Transaction amount and recipient
  • Risk assessment and policy violation details
  • One-tap approve/deny buttons
  • Estimated gas costs and slippage
  • Market context (for DeFi actions)

Telegram Integration: Cross-Platform Approval

Telegram provides a more detailed approval interface with rich transaction previews and conversation history. The Telegram signing channel supports both individual and group-based approval workflows.

Set up Telegram notifications through the CLI:

waiaas notification setup --provider telegram --bot-token <your-bot-token>
Enter fullscreen mode Exit fullscreen mode

Configure a policy to route APPROVAL-tier transactions to Telegram:

{
  "type": "SPENDING_LIMIT",
  "rules": {
    "instant_max_usd": 50,
    "approval_channel": "telegram",
    "delay_seconds": 300
  }
}
Enter fullscreen mode Exit fullscreen mode

When an AI agent transaction requires approval, you receive a Telegram message with:

  • Formatted transaction details
  • Links to block explorers for verification
  • Inline buttons for approve/deny/delay
  • Transaction simulation results
  • Recent agent activity context

3-Layer Security Architecture

Push Relay and Telegram approval integrate with WAIaaS's broader security model:

Layer 1: Session Authentication - AI agents use short-lived JWT tokens with configurable TTL and renewal limits. Sessions can be instantly revoked if agent behavior becomes suspicious.

Layer 2: Policy Engine - 21 policy types provide default-deny protection. The ALLOWED_TOKENS and CONTRACT_WHITELIST policies ensure agents can only interact with pre-approved assets and protocols:

curl -X POST http://localhost:3100/v1/policies \
  -H 'Content-Type: application/json' \
  -H 'X-Master-Password: <password>' \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "ALLOWED_TOKENS",
    "rules": {
      "tokens": [
        {"address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "symbol": "USDC", "chain": "solana"},
        {"address": "So11111111111111111111111111111111111111112", "symbol": "SOL", "chain": "solana"}
      ]
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Layer 3: Real-Time Approval - Push Relay and Telegram provide the final human oversight layer. Even if an agent finds a way around other protections, high-value transactions still require your explicit approval.

Advanced Approval Workflows

Time-Based Delays with Cancellation

Some transactions benefit from a cooling-off period. WAIaaS's DELAY tier queues transactions for a specified time, during which you can review and cancel if needed:

{
  "type": "SPENDING_LIMIT",
  "rules": {
    "delay_max_usd": 2000,
    "delay_seconds": 900,
    "delay_cancellable": true
  }
}
Enter fullscreen mode Exit fullscreen mode

Push Relay sends notifications at three stages:

  1. Immediate: "Transaction queued for 15-minute delay"
  2. Mid-delay: "5 minutes remaining to cancel transaction"
  3. Pre-execution: "Transaction executing in 30 seconds"

Multi-Signature Group Approval

For institutional use cases, Telegram group integration allows multiple team members to review and approve agent transactions:

# Add Telegram group as approval channel
waiaas notification setup --provider telegram --group-id <group-id> --required-approvals 2
Enter fullscreen mode Exit fullscreen mode

Emergency Kill Switch

Both Push Relay and Telegram provide instant kill switch functionality. A single tap can:

  • Revoke all active agent sessions
  • Cancel all pending/delayed transactions
  • Freeze wallet activity until manual review
  • Export transaction logs for forensic analysis

Quick Start: Set Up Real-Time Approval

Here's how to get approval notifications working in under 5 minutes:

Step 1: Deploy WAIaaS with Push Relay enabled:

git clone https://github.com/minhoyoo-iotrust/WAIaaS.git
cd WAIaaS
docker compose up -d
Enter fullscreen mode Exit fullscreen mode

Step 2: Create a wallet and session for your AI agent:

npm install -g @waiaas/cli
waiaas init
waiaas start
waiaas quickset --mode mainnet
Enter fullscreen mode Exit fullscreen mode

Step 3: Set up approval policies that trigger for transactions over your comfort level:

curl -X POST http://localhost:3100/v1/policies \
  -H 'Content-Type: application/json' \
  -H 'X-Master-Password: <your-password>' \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "SPENDING_LIMIT",
    "rules": {
      "instant_max_usd": 25,
      "approval_max_usd": 500
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Step 4: Configure Push Relay or Telegram notifications:

# Option A: Push Relay (iOS/Android app)
waiaas notification setup --provider push-relay --device-token <token>

# Option B: Telegram bot
waiaas notification setup --provider telegram --bot-token <bot-token>
Enter fullscreen mode Exit fullscreen mode

Step 5: Test the approval flow by having your agent attempt a transaction above your instant limit. You should receive a notification within seconds.

What's Next

Real-time approval bridges the gap between AI agent autonomy and security requirements, but it's just one component of comprehensive agent wallet management. For production deployments, you'll also want to explore rate limiting, contract whitelisting, and DeFi-specific policies that understand protocol risks.

Ready to implement bulletproof AI agent security? Check out the full implementation on GitHub or explore the complete security model at waiaas.ai.

Top comments (0)