Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.cloud.coinbase.com/llms.txt

Use this file to discover all available pages before exploring further.

Policies let you govern wallet behavior by defining rules that accept or reject operations based on transaction parameters like destination address, value, and network.

Policy fields

FieldDescriptionValid values
scopeLevel at which the policy appliesproject or account (API key auth only)
rulesOrdered list of rulesArray of rules
actionWhat to do when criteria matchaccept or reject
operationThe wallet operation being governedSee Supported operations
criteriaLogical expressions evaluated against the operationArray of criteria

Evaluation

Rules are processed in order. The first matching rule’s action is applied. If no rule matches, the request is rejected (fail-secure default). For API key auth wallets, a project-level policy is evaluated first, followed by any account-level policy.

API key configuration

To manage policies via SDK or API, your API key must have the Manage (modify policies) scope enabled under API restrictions > API-specific restrictions.

Create a policy

User authentication wallets support project-scope policies only. Create policies using the CDP SDK from your backend.
const policy = await cdp.policies.createPolicy({
  policy: {
    scope: "project",
    description: "Accept EVM txs to allowlisted addresses",
    rules: [
      {
        action: "accept",
        operation: "signEndUserEvmTransaction",
        criteria: [
          {
            type: "evmAddress",
            addresses: ["0x000000000000000000000000000000000000dEaD"],
            operator: "in",
          },
        ],
      },
    ],
  },
});
console.log("Created policy:", policy.id);

Supported operations

User authentication

OperationDescription
signEndUserEvmTransactionEnd-user EVM transaction signing
sendEndUserEvmTransactionEnd-user EVM transaction signing and sending
signEndUserEvmMessageEnd-user EIP-191 message signing
signEndUserEvmTypedDataEnd-user EIP-712 typed data signing
signEndUserSolTransactionEnd-user Solana transaction signing
sendEndUserSolTransactionEnd-user Solana transaction signing and broadcast
signEndUserSolMessageEnd-user Solana message signing

API key authentication

OperationDescription
signEvmTransactionEVM transaction signing
sendEvmTransactionEVM transaction signing and sending
signEvmMessageEIP-191 message signing
signEvmTypedDataEIP-712 typed data signing
signEvmHashHash signing
prepareUserOperationSmart account user operation preparation
sendUserOperationSmart account user operation sending
signSolTransactionSolana transaction signing
sendSolTransactionSolana transaction signing and sending
signSolMessageSolana message signing