Skip to main content

Agent Delegation

Use agent-delegation to grant scoped permissions to an agent.

Basic Delegation

const proof = await client.verify({
  verifier: 'agent-delegation',
  data: {
    controllerWallet: '0x...',  // Must match signer
    agentWallet: '0x...',
    scope: 'payments:x402',
    permissions: ['execute', 'read'],
  },
  walletAddress: controllerWallet,
});

Full Example with Spending Limits

await client.verify({
  verifier: 'agent-delegation',
  data: {
    controllerWallet: '0x...',  // Must match signer
    agentWallet: '0x...',
    scope: 'payments:x402',
    permissions: ['execute', 'read'],
    maxSpend: '1000000000000000000',   // 1 ETH in wei
    allowedPaymentTypes: ['x402'],     // auto-set if scope=payments:x402
    receiptDisclosure: 'summary',      // auto-set if scope=payments:x402
    expiresAt: Date.now() + 7 * 24 * 60 * 60 * 1000,  // 7 days
    instructions: 'Policy instructions for the delegated agent (max 4000 chars)',
    skills: ['market-data']
  },
  walletAddress: controllerWallet,
});

Fields

FieldRequiredDescription
controllerWalletYesMust match signer
agentWalletYesAgent’s wallet
scopeNoPermission scope (e.g., payments:x402)
permissionsNoexecute, read, etc.
maxSpendNoMaximum spend in wei
allowedPaymentTypesNoPayment types allowed
receiptDisclosureNosummary, full, none
expiresAtNoExpiration timestamp
instructionsNoPolicy instructions (max 4000 chars)
skillsNoAllowed skills

Verification

GET /api/v1/proofs/check?verifierIds=agent-delegation&address=0x...

Security Best Practices

  • Always set expiresAt for time-limited delegation
  • Use maxSpend to limit financial exposure
  • Regularly audit delegation proofs
  • Revoke unused delegations

Revocation

await client.revokeOwnProof(proofId, wallet);