Skip to main content
The policy engine lets you decide, in code, which changes on your accounts go through on their own, which need sign-off, and which are refused. You register approval keys, write policies as boolean trees, and endorse the actions that open when a policy needs more signatures.

What’s available

The engine is enabled per sandbox organization. Until it’s enabled for yours, the policy endpoints return mocked data only. Today you can register keys and create, read, and archive policies, and the engine evaluates them. Enforcement on withdrawals is being connected and isn’t active in the sandbox yet, so a withdrawal isn’t held or refused by a policy for now. When it is, allow and deny policies take effect as written. An approvals policy can be written now, but until approval groups and endorsements ship there is nobody to endorse, so a change it governs is refused rather than held.

How it works

1

Register approval keys

Nominate existing Anchorage Digital API keys as approvers. No key material is generated or held for you.
2

Group keys

An approval group is a named set of keys. It means nothing on its own. It takes on meaning once a policy points at it.
3

Write policies

A policy targets resources and action types, applies when its conditions match, and says what a matching change needs: nothing (allow), endorsements from groups (approvals), or refusal (deny).
4

Changes are evaluated

Every governed change is checked against the active policies that apply. The engine denies by default: a change no policy governs is refused, an allowed change takes effect at once, and a deny anywhere refuses it outright.
5

Endorsements are collected

When a change needs more sign-off, an action opens and comes back on the 202. Approvers endorse it until the tree is satisfied.
Your integration never creates an action directly. Policy evaluation does.

Permissions

The policy engine endpoints don’t use the permission names the account endpoints use. Your key needs MANAGE_IAAS_POLICY_ENGINE to write and READ_IAAS_POLICY_ENGINE to read. Ask your Anchorage Digital representative to add them to your key.

Policy anatomy

Target

A creation action type governs something that doesn’t exist yet, so there’s no ID to point the policy at. For POLICY_CREATE, KEY_REGISTER, and KEY_GROUP_CREATE, resourceIds lists the top-level accounts the policy governs. That’s also how you write a firm-wide policy: target the top-level account. A create and its archive name different kinds of ID, so they go in separate policies.

Conditions

Only the transaction action types (WITHDRAWAL and DEPOSIT) can carry conditions. A condition tree is made of nodes. A node either combines other nodes (allOf, anyOf, or a single-child not) or carries one or more of these checks: When one node carries more than one check, all of them must match. A not may not contain amount or cumulativeAmount at any depth, because negating a floor would make a larger change need less than a smaller one. Any node can carry a description label.
USD withdrawals of $500,000 or more
Any asset except BTC
A large wire on an account that already moved $10M in two days

Required actions

A requiredActions tree is built from allOf and anyOf nodes and three kinds of requirement. There’s no not here, and a node carrying one is rejected. The top-level requiredActions object may also carry settings.expiresIn, an ISO 8601 duration for how long an opened action stays open before it expires. The default is P14D. When several policies govern one change, the shortest window wins.
The engine denies by default. Until your organization has an allow policy for an account and action type, every such change is refused. The one exception is policy governance itself: creating or archiving a policy that no policy governs is allowed, so you can write your first policies.

Integration steps

Step 1: Register approval keys

POST /v4/approvers/keys registers an existing Anchorage Digital API key as an approver. Registration isn’t governed: the key is ACTIVE at once, but it approves nothing until it belongs to an approval group.
A key is nominated at most once per organization. GET /v4/approvers/keys lists keys in one status (ACTIVE by default, ARCHIVED to audit), GET /v4/approvers/keys/{keyId} returns one, and DELETE /v4/approvers/keys/{keyId} archives one. Archiving takes effect at once, isn’t governed, and is final. Archiving an already archived key answers 202 again.

Step 2: Create approval groups

Under construction. POST, GET, and DELETE /v4/approvers/approval-groups are in the reference but return mocked data only. The contract: a group has a name, its approvalGroupId is reserved and returned on creation even while status is PENDING_APPROVAL, and GET /v4/approvers/approval-groups/{approvalGroupId} returns its members, the keys registered into it. A key names its group at registration. This section will be updated when groups are available for testing.

Step 3: Create a policy

POST /v4/policies The response is 202 with the policy’s reserved id and its status: ACTIVE if it took effect, or PENDING_APPROVAL with an action if a governing policy needs endorsements first. The example below requires two endorsements from an approval group. You can create it today, but it can’t be satisfied until approval groups and endorsements ship, so a change it governs is refused. Use the allow and deny shapes under Common policies for anything you want to take effect now.

Common policies

The first policy an organization writes. Allow withdrawals and deposits everywhere beneath a top-level account. Without it, every transaction is refused.
A hard cap. Refuse every BTC withdrawal from one account, whatever other policies allow.
Tiered approval with an override. Two treasury approvals and one from compliance, or one executive approval, whichever comes first.
Govern policy changes themselves. Require compliance approval before any new policy is written beneath a top-level account.
Every ID in resourceIds must belong to your organization.

Step 4: Read policies

GET /v4/policies resolves the policies that apply to one resource. Both resourceType and resourceId are required. For ACCOUNT, every policy naming the account or any account above it is returned, and chain lists the account IDs that were matched, nearest first. For the other families, pass the resource’s own ID, or for a creation action type, a top-level account ID.
GET /v4/policies/{policyId} returns one policy by ID. DELETE /v4/policies/{policyId} archives it. The definition is kept, status becomes ARCHIVED, and the change itself is governed by any POLICY_ARCHIVE policy that applies.

Step 5: Endorse or reject actions

Under construction. The endorsement endpoints are in the reference but return mocked data only, and the engine doesn’t yet open actions. The contract, so you can design for it:
  • An action is the record of a change waiting for the endorsements its policy requires. It opens automatically and comes back as action on the change’s 202.
  • GET /v4/endorsements/actions lists actions. resourceType is required, since IDs of every kind look the same. Filter with resourceId, actionType, and status (PENDING, ENDORSED, REJECTED, EXPIRED). There’s no push notification, so poll.
  • POST /v4/endorsements/actions/{actionId}/endorse and /reject take keyId, payloadHash, and signature: the approver’s key signs the action’s canonical payload. Each endorsement counts toward the leaf whose group the key belongs to. One rejection resolves the whole action. Endorsing or rejecting a resolved action is a no-op that returns the action as it stands, which makes the call safe to retry.
  • An action’s expiresAt is submittedAt plus the governing policy’s settings.expiresIn. The requirement is fixed when the action opens. A policy changed afterward doesn’t affect it.
This section will be updated when endorsements are available for testing.