Skip to main content
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 Non-custodial > Manage (modify policies) scope enabled under API restrictions > API-specific restrictions.

Create a policy

Policies can be created from the CDP Portal or via the SDK.

CDP Portal

In the Portal, navigate to Non-custodial Wallet > Security and click Create project policy to open the JSON editor.

SDK

User authentication wallets support project-scope policies only.
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
signEndUserEvmHashEnd-user EVM hash signing (no criteria)
signEndUserSolTransactionEnd-user Solana transaction signing
sendEndUserSolTransactionEnd-user Solana transaction signing and broadcast
signEndUserSolMessageEnd-user Solana message signing
sendEndUserOperationEnd-user smart wallet user operation sending
sendEndUserEvmAssetEnd-user EVM asset send
sendEndUserSolAssetEnd-user Solana asset send
createEndUserEvmSwapEnd-user EVM swap creation

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