- an Activity kind: the type of activity that this policy should gate.
- a Rule: defines the rule being evaluated to know whether the policy should “activate” (aka “trigger”) or not for a given activity happening in the system.
- an Action: after rule was evaluated, if the policy is triggered, the action defines what action is taken as a consequence.
- optional Filters: these can be used to reduce the scope upon which the policy applies.
Skipped
if the rule did not apply or is triggered executing the associated action. If the action is RequestApproval
, an Approval process is initiated.
Policies do not cover delegated wallets owned by the end users. Because delegated signing is non custodial in nature. All end user activities bypass policy engine governance.
Activities
“Activity” is a generic term describing some activity in the Dfns system. Supported activity kinds are:Wallets:Sign
, Permissions:Assign
, Permissions:Modify
, Policies:Modify
.
Wallets:Sign
activity
A “Wallets:Sign
” activity represents any activity which involves signing with a wallet. Currently, in our API, these can be:
- a Transfer Request (created using the endpoint Transfer Asset from Wallet)
- a Transaction Request (created using the endpoint Broadcast Transaction from Wallet)
- a Signature Request (created using the endpoint Generate Signature from Keys)
Wallets:IncomingTransaction
activity
A “Wallets:IncomingTransaction
” activity represents when our indexers detected an incoming transaction into a wallet. This activity kind has to be used with the rule kind “ChainalysisTransactionScreening
” (see more on Chainalysis integration page), and the action kind “NoAction
”, meaning that no actual action will be taken as a result of the Chainalysis screening, other than notifying you through a webhook event if the policy is triggered. The reason for that, is that the incoming transaction is already on-chain, so the funds are already in the wallet, we cannot block that transfer on chain.
Permissions:Modify
activity
A “Permissions:Modify
” activity represents any activity which involves updating or archiving a permission. These activities are Permission change requests, created as a result of calling either:
- the endpoint Update Permission
- the endpoint Delete Permission
Permissions:Assign
activity
A “Permissions:Assign
” activity represents any activity which involves assigning a permission (or revoking it, aka “deleting a permission assignment”). These activities are Assignment change requests, created as a result of calling either:
- the endpoint Assign Permission
- the endpoint Revoke Permission
Policies:Modify
activity
A “Policies:Modify
” activity represents any activity which involves updating or archiving a policy. These activities are Policy change requests, created as a result of calling either:
- the endpoint Update Policy
- the endpoint Delete Policy
Policy Rules
The policy rule is what gets evaluated to determine whether a given activity will “activate” (aka “trigger”) the policy, therefore applying the policy “Action”, or whether it will skip it. Supported Policy Rule kinds are:AlwaysTrigger
, TransactionAmountLimit
, TransactionAmountVelocity
, TransactionCountVelocity
, TransactionRecipientWhitelist
.
AlwaysTrigger
policy rule
This rule can be used on a policy of any activityKind
. It will always be triggered, meaning that if this rule is defined on a policy, the policy will always trigger the policy action, regardless of the activity details.
TransactionAmountLimit
policy rule
This rule can be used on a policy of activityKind
= Wallets:Sign
. It will trigger if the wallet activity detected is transferring some value which amount is greater than a given limit.
If the fiat amount of the wallet activity cannot be evaluated for any reason (eg. market prices are not available, or eg. the amount cannot be inferred from a wallet signature request, etc.), by default the rule will trigger the policy (this is called “failing closed” and is generally considered a security best practice).
Property | Type | Description |
---|---|---|
limit* | Positive Integer | Amount limit in currency |
currency* | String | Fiat currency, currently only USD |
TransactionAmountVelocity
policy rule
This rule can be used on a policy of activityKind
= Wallets:Sign
. It will trigger if the cumulative amount transferred from a given wallet within a given timeframe is greater than a specified limit. The aggregate amount evaluated is based only on the wallet that triggered the policy.
If the fiat amount of any wallet activity in the given timeframe cannot be evaluated for any reason (eg. market prices are not available, or eg. the amount cannot be inferred from a wallet signature request, etc.), by default the rule will trigger the policy (ie. will fail closed).
Property | Type | Description |
---|---|---|
limit* | Positive Integer | Amount limit in currency |
currency* | String | Fiat currency, currently only USD |
timeframe* | Positive Integer | Time period in minutes. Minimum 1, Maximum 43,200. |
TransactionCountVelocity
policy rule
This rule can be used on a policy of activityKind
= Wallets:Sign
. It will trigger if the number of wallet activities for a given wallet within a given timeframe, is greater than a specified limit. The aggregate number of transactions evaluated is based only on the wallet that triggered the policy.
Property | Type | Description |
---|---|---|
limit* | Positive Integer | Amount limit in currency |
timeframe* | Positive Integer | Time period in minutes. Minimum 1, Maximum 43,200. |
TransactionRecipientWhitelist
policy rule
This rule can be used on a policy of activityKind
= Wallets:Sign
. It will trigger if the wallet activity transfers some value to a recipient and the destination address is NOT whitelisted.
Address comparison is case sensitive when evaluating the rule. For EVM addresses, make sure you use the canonical all lowercase address format, not the mixed-case checksum address format, in your policy rule configuration. Otherwise, the evaluation will fail and trigger the policy.
If the wallet activity is not a value transfer, or the transaction recipient cannot be inferred from the wallet activity (eg if you use Generate Signature), by default the rule will trigger the policy (ie. fail closed).
Property | Type | Description |
---|---|---|
addresses* | List of Strings | Whitelisted recipient addresses |
ChainalysisTransactionPrescreening
policy rule
This rule can only be used once the Chainalysis integration is activated from the Dfns dashboard settings. (see more on Chainalysis integration page)
activityKind
= Wallets:Sign
. It’s a rule based on Chainalysis KYT integration (Know-Your-Transaction). Upon transfer attempt, we will first register the transfer with Chainalysis (as a “withdrawal attempt”), and fetch the screening results (alerts, exposures, addresses detected). Based on the results, and the configuration of this rule, the policy will be triggered.
It’s called “Pre”-screening, because the scanned transaction is not on chain yet, it’s still a transaction attempt (before the transaction actually make it on chain).
Property | Type | Description |
---|---|---|
alerts .alertLevel* | string | Minimum alert level above which the rule should trigger, if any alert is returned in Chainalysis results. Can be LOW, MEDIUM, HIGH, or SEVERE |
alerts .categoryIds* | list of integers | List of Chainalysis category IDs (see here). If you leave this list empty, alerts of any category will trigger the rule. Otherwise, if you only want the rule to trigger on specific categories, you can specify some in the list. |
exposures .direct .categoryIds* | list of integers | List of Chainalysis category IDs (see here). If you leave this list empty, a direct exposure of any category detected by chainalysis will trigger the rule. Otherwise, if you only want the rule to trigger on specific categories, you can specify some in the list. |
addresses .categoryIds* | list of integers | List of Chainalysis category IDs (see here). If you leave this list empty, an address of any category identified by chainalysis will trigger the rule. Otherwise, if you only want the rule to trigger on specific categories, you can specify some in the list. |
fallbackBehaviours.skipUnscreenableTransaction* | boolean | Behaviour if the wallet activity is not screenable (eg. if it’s a signature request of a hash). If true, a transaction which is “unscreenable” will just be skipped, and policy will not trigger |
fallbackBehaviours.skipUnsupportedNetwork* | boolean | Behaviour if the wallet activity is on a network not supported by chainalysis, or not yet supported in the dfns-chainalysis integration. If true, an unsupported network will just be skipped, and policy will not trigger |
fallbackBehaviours.skipUnsupportedAsset* | boolean | Behaviour if the wallet activity is with a asset not supported by chainalysis, or not yet supported in the dfns-chainalysis integration. If true, an unsupported asset will just be skipped, and policy will not trigger |
fallbackBehaviours.skipChainalysisFailure* | boolean | Behaviour if any issue with Chainalysis calls (timeout, results took too long, rate limiting errors, any error). If true, will skip if any error happens |
ChainalysisTransactionScreening
policy rule
This rule can only be used once the Chainalysis integration is activated from the Dfns dashboard settings (see more on Chainalysis integration page)
activityKind
= Wallets:IncomingTransaction
, and with the action kind NoAction
. It’s a rule based on Chainalysis KYT integration (Know-Your-Transaction). Upon an incoming transaction detectedby our indexers, we will register the transfer with Chainalysis, and fetch the results of the analysis (alerts & exposures detected). Based on the results, and the configuration of this rule, the policy will be triggered.
The shape of the rule is almost like the ChainalysisTransactionPrescreening
rule, expect the the address
property is not supported.
ChainalysisTransactionPrescreening
TravelRuleTransactionPrescreening
policy rule
This rule can only be used once the Notabene integration is activated from the Dfns dashboard settings (see more on Notabene integration page)
activityKind
= Wallets:Sign,
and with the action kind Block
. It’s a rule based on Notabene TravelRule integration. It ONLY applies to Dfns Transfer Asset Api Calls. It is NOT supported for Transfers initiated via the dashboard. Upon transfer attempt with an optional TravelRule payload, we will call Notabene’s APIs on your behalf to both confirm the validity of the travel rule message and submit it for processing. Dfns then waits for a response from the counterparty (for custodial transfers) or Notabene (for non-custodial transfers).
It’s called “Pre”-screening, because the transaction is not on chain yet, it’s still a transaction attempt (before the transaction actually make it on chain).
Property | Type | Description |
---|---|---|
vendor | string | TravelRule vendor to use for the prescreening policy. At the moment we only support Notabene. |
autoTrigger TimeoutSeconds | Positive Integer | If we do NOT receive any updates from Notabene regarding the status of the travel rule message we need to eventually time out and reject the transfer. This is the timeout, in seconds, we wait for a response from Notabene before rejecting the transfer. |
autoClearAfterDelivered TimeoutSeconds | Positive Integer(Optional) | This OPTIONAL setting allows you to proceed with a transfer that Notabene has delivered to a counterparty even if the recipient hasn’t responded after delivery. |
Policy Action
An action specifies what should happen if a policy rule is triggered. Supported action kinds are:Block
and
RequestApproval
.
Block
policy action
This action means that the activity will be blocked if the policy is triggered.
RequestApproval
policy action
This action means that activity will first require an Approval process to be completed before it can be executed (or be aborted if someone rejects it during the approval process).
One or several groups of approvers need to be specified. These groups define who is allowed to approve / reject an activity.
The activity will only be executed if all approver groups reach their “quorum” of approvals. Otherwise, if any one user within any approver group rejects, then the activity is aborted and the call is not executed.
The example below shows a RequestApproval
action, configured with one approval group requiring 2 approvals amongst three specific users.
property | Type | Description |
---|---|---|
approvalGroups* | List of Object | List of approval groups. If multiple groups are defined, the approval is complete only when all groups have approved |
approvalGroups[].name | (Optional) String | Optional name of this group. |
approvalGroups[].quorum* | Positive Integer | The quorum is the number of approvals required in this group to reach group consensus. The activity is executed only if all groups reached their approval quorum. |
approvalGroups[].approvers* | Object | Defines all users that are allowed to approve in the group. If set to an empty object {} , it means that anyone within your organisation can be an approver. Otherwise, you can specify an exact list of allowed approvers, by adding their user IDs in this object: { userId: { in: [...] }} |
approvalGroups[].initiatorCanApprove | (Optional) Boolean | Whether the initiator of the activity can participate in the approval (defaults to false ) |
autoRejectTimeout | (Optional) Positive Integer | Number of minutes after which, if the approval has not reach global consensus (all groups reached their consensus), the activity is automatically rejected.If not specified, the activity will never be rejected automatically (the approval process doesn’t “expire” / “times out”). |
Don’t lock yourself upBy default, users cannot approve an activity they initiated themselves, even if they are in an approval group. To allow this, you must set
initiatorCanApprove: true
.Example 1: For any wallet transfer, a policy is setup to require approval from 1 specific admin user (eg. the CEO). initiatorCanApprove
was not set to true
. If the CEO himself initiates a transfer, no-one can approve his transfer and it’s stuck.Example 2: Company has only 3 users. A policy is setup to require approval from any 3 users (quorum: 3
) for any modification of a policy. initiatorCanApprove
was not set to true
. In this case, they are locked, and the policy cannot be modified: whoever requests a modification cannot approve, and the policy is therefore always missing one approver. To unlock, they would need to invite a new user and give him the rights to approve as well.NoAction
policy action
This action kind means that nothing will happen after policy rule evaluation. It’s meant to be used with policy rules “ChainalysisTransactionPrescreening
” or “ChainalysisTransactionScreening
”. This action is for when you just want the KYT analysis rule to be run, and then if triggered, those result returned in a policy.triggered
Webhook Event.
Policy Filters
Policy filters can reduce the scope on which the policy applies. If no filters are specifies, the policy applies to all activities happening in your organisation (all activities of the kind defined by the policyactivityKind
).
For example, you can use filters to setup a policy for activities happening on specific wallets or on groups of wallets. Some examples include:
- “All activities from wallets tagged ‘
group:treasury
’ must first be approved by the CEO - “All transfers from wallet ID 1 larger than $1k must first be approved by the CEO & the CFO”
- “All transfers from wallets tagged ‘
accounting:freeze
’ must be blocked”
activityKind
of your policy (activityKind
)
Filters for "Wallets:Sign"
activity
key | evaluator | Value |
---|---|---|
walletId | in | List of wallet IDs. If the activity is from a wallet within one of these IDs, the policy applies to this wallet. |
walletTags | hasAny | List of tags. If the activity is from a wallet that has any of these tags, the policy will apply to this wallet. |
walletTags | hasAll | List of tags. If the activity is from a wallet that has all of these tags, the policy will apply to this wallet. |
- The policy is scoped only to wallets with IDs
wa-1
orwa-2
:
- The policy is scoped only to wallets tagged either “
domain:accounting
” or “sensitive
”:
- The policy is scoped only to wallets tagged with both “
domain:accounting
” and “sensitive
”:
- The policy is scoped only to wallets containing all these tags (“
domain:accounting
”, “zone:asia
”) AND at least one of these tags (“security:high
”, “security:medium
”):
Filters for "Policies:Modify"
activity
filter key | evaluator | Value |
---|---|---|
policyId | in | List of policy IDs. If the policy being modified is one of these IDs, the policy applies. |
- The policy is scoped only to policies with IDs
plc-1
orplc-2
Filters for "Permissions:Modify"
activity
filter key | evaluator | Value |
---|---|---|
permissionId | in | List of permission IDs. If the permission being modified is one of these IDs, the policy applies. |
- The policy is scoped only to permissions with IDs
pm-1
orpm-2
Filters for "Permissions:Assign"
activity
filter key | evaluator | Value |
---|---|---|
permissionId | in | List of permission IDs. If the permission being assigned/revoked is one of these IDs, the policy applies. |
- The policy is scoped only to permissions with IDs
pm-1
orpm-2