DEV Community

Cover image for Building Custom Signing Channels for AI Agent Wallets
Wallet Guy
Wallet Guy

Posted on

Building Custom Signing Channels for AI Agent Wallets

When building AI agents that handle real money, custom signing channels become your last line of defense against catastrophic losses. Most developers focus on the happy path—but what happens when your trading bot goes rogue, or when you need to approve a high-value transaction from your phone? WAIaaS provides 3 signing channels out of the box, plus the infrastructure to build custom approval workflows that match your security requirements.

Why Signing Channels Matter for AI Wallet Security

The crypto space is littered with stories of automated systems draining wallets due to bugs, exploits, or unexpected market conditions. When you give an AI agent access to a wallet, you're essentially creating a 24/7 automated trader that never sleeps, never hesitates, and never second-guesses a transaction.

Traditional wallets assume a human is always present to review and sign transactions. But AI agents operate autonomously—they might execute hundreds of transactions per day across multiple DeFi protocols. This creates a fundamental security challenge: how do you maintain human oversight without killing the agent's ability to operate efficiently?

The answer lies in intelligent signing channels that can route different types of transactions through appropriate approval mechanisms based on risk, amount, and context.

WAIaaS 3-Layer Security Architecture

WAIaaS implements a 3-layer security model that progressively filters risky transactions:

  1. Session Auth (Layer 1): AI agents authenticate with time-limited JWT tokens
  2. Policy Engine (Layer 2): 21 policy types with 4 security tiers (INSTANT/NOTIFY/DELAY/APPROVAL)
  3. Signing Channels (Layer 3): Human approval for high-risk transactions

Here's how a transaction flows through the system:

# AI agent sends a transaction
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer wai_sess_<token>" \
  -d '{
    "type": "TRANSFER",
    "to": "recipient-address",
    "amount": "10.5"
  }'

# If policies require APPROVAL tier → routed to signing channel
# If INSTANT/NOTIFY → executes immediately
# If DELAY → queued for time delay, then executes
Enter fullscreen mode Exit fullscreen mode

The policy engine determines which transactions need human approval. For example, this spending limit policy routes transactions over $1000 USD to a signing channel:

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

Built-in Signing Channels

WAIaaS includes 3 signing channels for different security preferences:

1. Push Relay Signing Channel

Sends push notifications to your mobile device with transaction details. You approve or reject with a single tap.

2. Telegram Signing Channel

Routes approval requests through Telegram bots. Useful for teams where multiple people might need to approve high-value transactions.

3. Wallet Notification Channel

Integrates with hardware wallets and mobile wallet apps for cryptographic transaction signing.

Each channel receives structured transaction data including amount, recipient, gas estimates, and risk assessment from the policy engine.

Default-Deny Security Model

WAIaaS implements default-deny policies that block transactions unless explicitly allowed. This prevents your agent from interacting with unknown contracts or tokens:

# Without ALLOWED_TOKENS policy → all token transfers blocked
# Without CONTRACT_WHITELIST policy → all contract calls blocked  
# Without APPROVED_SPENDERS policy → all token approvals blocked
Enter fullscreen mode Exit fullscreen mode

This might seem restrictive, but it's intentional. Your AI agent should only interact with contracts and tokens you've explicitly vetted. Here's how to whitelist Jupiter for Solana swaps:

curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "Content-Type: application/json" \
  -H "X-Master-Password: my-secret-password" \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "CONTRACT_WHITELIST",
    "rules": {
      "contracts": [{
        "address": "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
        "name": "Jupiter",
        "chain": "solana"
      }]
    }
  }'
Enter fullscreen mode Exit fullscreen mode

Building Custom Signing Channels

The signing channel architecture is extensible. Each channel implements a simple interface:

  1. Receive approval request with transaction details and risk assessment
  2. Present to human via your preferred notification method
  3. Return approval/rejection with optional signature

For example, you might build a signing channel that:

  • Sends high-value transactions to a dedicated Slack channel for team approval
  • Integrates with your company's existing workflow tools (Jira, ServiceNow, etc.)
  • Implements multi-signature approval for transactions over certain thresholds
  • Routes different transaction types to different approval groups (DeFi trades vs. NFT purchases)

The channel receives rich context about each transaction:

{
  "transactionId": "uuid",
  "walletAddress": "0x...",
  "type": "ContractCall",
  "amount": "1500.00",
  "amountUSD": 1500.00,
  "recipient": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
  "contractName": "Uniswap",
  "methodName": "swapExactETHForTokens",
  "gasEstimate": "150000",
  "policyViolations": [],
  "riskScore": "medium",
  "requiredApprovals": 1
}
Enter fullscreen mode Exit fullscreen mode

Authentication Methods for Different Security Levels

WAIaaS supports 3 authentication methods for different actors:

# masterAuth — system administrator (Argon2id hashed password)
-H "X-Master-Password: my-secret-password"

# sessionAuth — AI agent (JWT HS256 with expiration)
-H "Authorization: Bearer wai_sess_eyJhbGciOiJIUzI1NiJ9..."

# ownerAuth — fund owner (cryptographic signature)
-H "X-Owner-Signature: <ed25519-or-secp256k1-signature>"
-H "X-Owner-Message: <signed-message>"
Enter fullscreen mode Exit fullscreen mode

The owner can use cryptographic signatures to approve transactions without sharing passwords or API keys. This is crucial for signing channels—the approval mechanism should be as secure as the wallet itself.

Emergency Controls and Kill Switches

Even with perfect policies, you need emergency controls. WAIaaS provides several kill switch mechanisms:

  • Session revocation: Immediately disable all AI agent access
  • Transaction cancellation: Cancel pending DELAY-tier transactions
  • Wallet freeze: Block all outgoing transactions (incoming still work)
  • Owner recovery: Reset master password using owner signature
# Emergency: revoke all sessions for a wallet (masterAuth)
curl -X DELETE http://127.0.0.1:3100/v1/sessions?walletId=<uuid> \
  -H "X-Master-Password: my-secret-password"

# Owner can approve emergency transaction even with revoked sessions
curl -X POST http://127.0.0.1:3100/v1/transactions/<tx-id>/approve \
  -H "X-Owner-Signature: <signature>" \
  -H "X-Owner-Message: <message>"
Enter fullscreen mode Exit fullscreen mode

Real-World Security Scenarios

Here are common scenarios where custom signing channels prove essential:

High-Frequency Trading Bot: Instant execution for trades under $100, delay + notification for $100-$1000, mandatory approval for anything larger.

DeFi Yield Farming: Allow automated staking/unstaking on whitelisted protocols, but require approval for new protocol interactions or large position changes.

NFT Trading Agent: Auto-buy NFTs under 0.1 ETH from verified collections, but require approval for rare/expensive pieces.

Cross-Chain Arbitrage: Allow bridging between trusted bridges, but require approval for new bridge contracts or unusually large amounts.

Quick Start with Security-First Setup

Here's how to set up WAIaaS with security-focused defaults:

  1. Install and initialize:
npm install -g @waiaas/cli
waiaas init
waiaas start
Enter fullscreen mode Exit fullscreen mode
  1. Create wallet with restrictive policies:
# Create wallet
waiaas wallet create --name secure-trading --chain ethereum --network mainnet

# Set spending limits (very conservative)
curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "Content-Type: application/json" \
  -H "X-Master-Password: <password>" \
  -d '{
    "walletId": "<wallet-uuid>",
    "type": "SPENDING_LIMIT", 
    "rules": {
      "instant_max_usd": 1,
      "notify_max_usd": 10,
      "delay_max_usd": 100,
      "daily_limit_usd": 500
    }
  }'
Enter fullscreen mode Exit fullscreen mode
  1. Whitelist only essential contracts:
# Only allow Uniswap interactions
curl -X POST http://127.0.0.1:3100/v1/policies \
  -H "Content-Type: application/json" \
  -H "X-Master-Password: <password>" \
  -d '{
    "type": "CONTRACT_WHITELIST",
    "rules": {
      "contracts": [{
        "address": "0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45",
        "name": "Uniswap V3 Router 2"
      }]
    }
  }'
Enter fullscreen mode Exit fullscreen mode
  1. Set up notification channel:
waiaas notification setup --channel telegram --bot-token <token>
Enter fullscreen mode Exit fullscreen mode
  1. Test the security:
# This should execute instantly (under $1)
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
  -H "Authorization: Bearer <session-token>" \
  -d '{"type": "TRANSFER", "to": "0x...", "amount": "0.0005"}'

# This should require approval (over $100)
curl -X POST http://127.0.0.1:3100/v1/transactions/send \
  -H "Authorization: Bearer <session-token>" \
  -d '{"type": "TRANSFER", "to": "0x...", "amount": "0.1"}'
Enter fullscreen mode Exit fullscreen mode

Custom signing channels transform AI wallet security from an afterthought into a systematic risk management framework. Instead of hoping your agent doesn't make mistakes, you build guardrails that mathematically prevent catastrophic losses while preserving the agent's ability to operate efficiently within defined boundaries.

For detailed implementation examples and advanced signing channel patterns, explore the GitHub repository or check out the complete documentation at waiaas.ai.

What's next? Start with the default signing channels to understand the approval flow, then identify the specific security requirements for your use case. Most custom implementations can reuse 80% of the existing channel infrastructure—you're mainly customizing the notification and approval mechanism, not rebuilding the entire security layer.

Top comments (0)