AI agent integration

Build agents that move money safely

Alloy is AI-native: every API is designed for autonomous agent consumption with self-discoverable endpoints, structured errors, scoped authority, and human escalation built in.

Design principles

Self-discovery

Module schemas with x-agent-hints annotations. Agents discover endpoints, parameters, and constraints without documentation lookup.

Same controls

Agents go through the same policy, risk, and compliance checks as human operators. No shortcuts, no backdoors.

Scoped authority

Delegated tokens with explicit scope, amount caps, asset restrictions, and time-bounded expiry. Agents get the minimum authority they need.

Human escalation

High-risk or out-of-policy actions automatically escalate to human approvers. Agents propose; humans approve when policy demands it.

MCP server integration

Alloy exposes a Model Context Protocol server for Claude, GPT, and other MCP-compatible agents.

Configuration

{
  "mcpServers": {
    "alloy": {
      "url": "https://api.alloy.build/mcp/v1",
      "transport": "streamable-http",
      "headers": {
        "Authorization": "Bearer ${ALLOY_AGENT_TOKEN}"
      }
    }
  }
}

Available MCP tools

list_wallets List wallets with balances across providers
get_wallet Get detailed wallet information
create_transaction Submit a policy-bound transaction intent
check_policy Pre-check a transaction against policies
get_risk_score Get risk assessment for an address or amount
list_events Query recent events and alerts
get_recon_status Check reconciliation status

Delegated authority

Create scoped agent tokens with explicit permissions, amount caps, and asset restrictions. Every action is logged with the agent identity for full auditability.

Create an agent token

curl -X POST https://api.alloy.build/v1/agent-tokens \
  -H "Authorization: Bearer $ALLOY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "payment-agent",
    "scopes": [
      "wallets:read",
      "transactions:create",
      "transactions:read"
    ],
    "constraints": {
      "max_amount_per_tx": "5000.00",
      "allowed_assets": ["USDC", "USDT"],
      "require_policy_check": true
    },
    "expires_in": "24h"
  }'

Available scopes

Scope Description Risk
wallets:read List wallets, get balances Low
wallets:create Create new wallets Medium
transactions:read View transaction history Low
transactions:create Submit transaction intents High
policies:read View policy configurations Low
policies:evaluate Trigger policy evaluation Medium
risk:read View risk scores and alerts Low
recon:read View reconciliation data Low
events:subscribe Subscribe to event streams Low

Agent patterns

Payment agent

An autonomous agent that processes vendor payments with policy-bound transaction intents and automatic human escalation.

from alloy import AlloyClient

client = AlloyClient(
    api_key=os.environ["ALLOY_AGENT_TOKEN"],
    base_url="https://api.alloy.build"
)

# Agent discovers available wallets
wallets = client.wallets.list()

# Submit a policy-bound transaction intent
intent = client.transaction_intents.create(
    wallet_id=wallets[0].id,
    asset="USDC",
    amount="1000.00",
    destination="0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18",
    policy="agent-low-risk-transfer",
    metadata={
        "agent_id": "payment-bot-v2",
        "reason": "Vendor invoice #INV-2024-0847"
    }
)

# Handle policy escalation
if intent.status == "pending_human_approval":
    print(f"Escalated to human: {intent.escalation_reason}")
else:
    print(f"Approved: {intent.id} -> {intent.status}")

Monitoring agent

A read-only agent that streams events, detects anomalies, and alerts the team — without any write permissions.

import alloy
import asyncio

client = alloy.AlloyClient(api_key=os.environ["ALLOY_AGENT_TOKEN"])

async def monitor():
    async for event in client.events.stream(
        types=["transaction.completed", "transaction.failed",
               "risk.alert", "policy.violation"]
    ):
        if event.type == "risk.alert":
            # Agent can read risk details but cannot override
            alert = client.risk.get_alert(event.data.alert_id)
            await notify_team(alert)

        elif event.type == "policy.violation":
            # Log violation evidence for audit
            violation = client.policies.get_decision(
                event.data.decision_id
            )
            await log_compliance_event(violation)

asyncio.run(monitor())

Security model

Layer Mechanism
AuthenticationScoped bearer tokens with expiry, IP allowlist, and revocation
AuthorizationFine-grained scopes per resource type; deny-by-default
Policy enforcementEvery write action passes through PolicyKit evaluation
Amount limitsPer-transaction and rolling-window caps enforced at token level
Human escalationOut-of-policy actions pause and notify human approvers
Audit trailEvery agent action logged with agent identity, scope, and policy receipt

Framework compatibility

Claude MCP

Native MCP server with streamable HTTP transport.

LangChain / LangGraph

Schema-based tool definition with structured output.

CrewAI

Agent tool integration via module schema.

OpenAI Assistants

Function calling with JSON Schema definitions.

Vercel AI SDK

TypeScript tool definitions with streaming support.

Coinbase AgentKit

Wallet operations bridge for onchain agents.