PoliciesClient
Client for managing policies that govern the behavior of projects and accounts.create_policy
The policy to create, containing scope, description, and rules.
Optional idempotency key for safe retryable requests.
The created policy.
update_policy
The unique identifier of the policy to update.
The updated policy configuration.
Optional idempotency key.
The updated policy.
delete_policy
The unique identifier of the policy to delete.
Optional idempotency key.
Returns None on success.
get_policy_by_id
The unique identifier of the policy to retrieve.
The requested policy.
list_policies
The number of policies to return per page.
The token for the next page of policies, if any.
The scope of the policies to list (“project” or “account”).
A paginated list of policies.
Policy Types
Policy
A single Policy that can be used to govern the behavior of projects and accounts.The unique identifier for the policy.
An optional human-readable description of the policy.
The scope of the policy (“project” or “account”). Only one project-level policy can exist at any time.
A list of rules that comprise the policy.
The ISO 8601 timestamp at which the Policy was created.
The ISO 8601 timestamp at which the Policy was last updated.
CreatePolicyOptions
The scope of the policy (“project” or “account”).
An optional human-readable description of the policy.
A list of rules that comprise the policy.
Rule Types
SendEvmTransactionRule
A policy rule that can accept or reject EVM transactions based on criteria.“accept” or “reject” - determines whether matching the rule will allow or block the transaction.
Must be “sendEvmTransaction”.
The set of criteria that must be matched. Can include:
EthValueCriterion: Compare ETH valueEvmAddressCriterion: Check recipient addressesEvmNetworkCriterion: Restrict networksEvmDataCriterion: Validate contract call dataNetUSDChangeCriterion: Limit USD value changes
SignEvmMessageRule
A policy rule for EVM message signing.“accept” or “reject”.
Must be “signEvmMessage”.
Criteria for matching messages (regex patterns).
SignEvmTypedDataRule
A policy rule for EIP-712 typed data signing.“accept” or “reject”.
Must be “signEvmTypedData”.
Can include:
SignEvmTypedDataFieldCriterion: Validate typed data fieldsSignEvmTypedDataVerifyingContractCriterion: Restrict verifying contracts
SendUserOperationRule
A policy rule for smart account user operations.“accept” or “reject”.
Must be “sendUserOperation”.
Similar to SendEvmTransactionRule criteria.
Solana Rules
Similar rules exist for Solana operations:SignSolanaTransactionRuleSendSolanaTransactionRuleSignSolMessageRule
Criterion Types
EthValueCriterion
Compare transaction ETH value against a threshold.Must be “ethValue”.
The ETH value in wei (as a string of digits).
Comparison operator:
">", "<", ">=", "<=", "==", "!=".EvmAddressCriterion
Check if transaction recipient is in/not in a list of addresses.Must be “evmAddress”.
List of 0x-prefixed 40-character hex addresses (max 300).
“in” or “not in”.
EvmNetworkCriterion
Restrict operations to specific networks.Must be “evmNetwork”.
List of network names: “base-sepolia”, “base”, “ethereum”, “ethereum-sepolia”, “avalanche”, “polygon”, “optimism”, “arbitrum”, “zora”, “bnb”.
“in” or “not in”.
NetUSDChangeCriterion
Limit the USD value of asset transfers.Must be “netUSDChange”.
The amount of USD in cents (non-negative integer).
Comparison operator:
">", ">=", "==", "<", "<=".EvmDataCriterion
Validate contract call parameters.Must be “evmData”.
The ABI of the smart contract.
Conditions to apply against function arguments.