# build an onchain AI agent

> Coinbase AgentKit is the default when the product is an autonomous agent that acts onchain: it supplies the agent wallet and composable actions and stays framework-agnostic. x402 lets the agent pay for gated services, Circle (USDC) is the settlement asset, ERC-8004 gives the agent verifiable identity and reputation, and EigenCloud can attest to agent computations where trust matters. Privy is excluded as a human-user wallet layer rather than the agent's own wallet, though it remains useful on the human-facing side.

## Recommended stack

- **Coinbase AgentKit** (wallet_and_identity) — readiness 81/100, difficulty medium — Use Coinbase AgentKit to give the agent a wallet and composable onchain actions, framework-agnostic across LangChain, Vercel AI SDK, and others.
- **x402** (payments_and_commerce) — readiness 89/100, difficulty medium — Let the agent programmatically pay for x402-gated APIs and services.
- **Circle (USDC & CCTP)** (payments_and_commerce) — readiness 84/100, difficulty low — Settle agent payments and payouts in USDC.
- **ERC-8004** (agent_identity_and_trust) — readiness 78/100, difficulty medium — Give the agent verifiable identity, discovery, and reputation for other agents and services to rely on.
- **EigenCloud** (supporting_protocol) — readiness 76/100, difficulty high — Use verifiable compute to attest to agent computations or outputs where trust-minimization matters.

## Considered and excluded

- privy — Privy provisions wallets for human users via auth; this intent is about an autonomous agent's own wallet, where AgentKit's agent-wallet model fits better. Privy is still useful for the human-facing side of an agent app.

## Risks

- Agent-controlled funds require explicit spend limits, action allowlists, and key-management guardrails before production.
- Prompt injection can drive unintended onchain actions; validate and constrain the agent's tool surface.
- Token and chain support vary; confirm the agent's actions are available on the target chain.
- Agent behavior is non-deterministic; add simulation, dry-run, and human-in-the-loop checks for high-value actions.

## Next steps

- Scope the exact onchain actions the agent may take, then set spend caps and allowlists.
- Pick an agent framework and wire AgentKit's wallet + actions into it.
- Fund and test the agent wallet on a testnet before mainnet.
- Add an x402/USDC payment flow if the agent must pay for services.

## What the agent receives

```json
{
  "intent": "I want to build an AI agent that can hold a wallet and transact, pay, or call contracts onchain",
  "matched_intent": "build-an-onchain-ai-agent",
  "recommended_stack": [
    {
      "slug": "agentkit",
      "name": "Coinbase AgentKit",
      "role": "wallet_and_identity",
      "readiness_score": 81,
      "integration_difficulty": "medium",
      "reason": "Use Coinbase AgentKit to give the agent a wallet and composable onchain actions, framework-agnostic across LangChain, Vercel AI SDK, and others."
    },
    {
      "slug": "x402",
      "name": "x402",
      "role": "payments_and_commerce",
      "readiness_score": 89,
      "integration_difficulty": "medium",
      "reason": "Let the agent programmatically pay for x402-gated APIs and services."
    },
    {
      "slug": "circle",
      "name": "Circle (USDC & CCTP)",
      "role": "payments_and_commerce",
      "readiness_score": 84,
      "integration_difficulty": "low",
      "reason": "Settle agent payments and payouts in USDC."
    },
    {
      "slug": "erc-8004",
      "name": "ERC-8004",
      "role": "agent_identity_and_trust",
      "readiness_score": 78,
      "integration_difficulty": "medium",
      "reason": "Give the agent verifiable identity, discovery, and reputation for other agents and services to rely on."
    },
    {
      "slug": "eigencloud",
      "name": "EigenCloud",
      "role": "supporting_protocol",
      "readiness_score": 76,
      "integration_difficulty": "high",
      "reason": "Use verifiable compute to attest to agent computations or outputs where trust-minimization matters."
    }
  ],
  "excluded_candidates": [
    {
      "slug": "privy",
      "reason": "Privy provisions wallets for human users via auth; this intent is about an autonomous agent's own wallet, where AgentKit's agent-wallet model fits better. Privy is still useful for the human-facing side of an agent app."
    }
  ],
  "risks": [
    "Agent-controlled funds require explicit spend limits, action allowlists, and key-management guardrails before production.",
    "Prompt injection can drive unintended onchain actions; validate and constrain the agent's tool surface.",
    "Token and chain support vary; confirm the agent's actions are available on the target chain.",
    "Agent behavior is non-deterministic; add simulation, dry-run, and human-in-the-loop checks for high-value actions."
  ],
  "next_steps": [
    "Scope the exact onchain actions the agent may take, then set spend caps and allowlists.",
    "Pick an agent framework and wire AgentKit's wallet + actions into it.",
    "Fund and test the agent wallet on a testnet before mainnet.",
    "Add an x402/USDC payment flow if the agent must pay for services."
  ],
  "generated_with": "composewith.eth",
  "registry_version": "2026.07.02-5a6fd5e"
}
```

---
Canonical: https://composewith.eth/intents/build-an-onchain-ai-agent
