Pular para o conteúdo

Manage policies

Use this page for post-genesis policy operations. For policy mechanics, see Policies. For launch design, see Design your policies.

Policy actions

API reference and shared process

TaskAPI reference
Propose a policy intentPropose an intent
Dry run a policy intentPerform a dry run
List policiesList policies
Get policy detailsGet policy details
Check remaining approversGet remaining users

Policy changes use the standard intent flow. For signing, approval, and status checks, see Manage intents and approvals, Sign intents, and Check updates.

The SDK examples on this page assume a configured client. To configure one, see Integrate via SDK. The SDK methods build, sign, and submit the intent for you. They return a pending intent that you can wait on.

Common operations

OperationIntent typeUse when
Create policyv0_CreatePolicyAdd a new approval rule.
Update policyv0_UpdatePolicyChange matching, condition, workflow, scope, rank, or metadata.
Lock policyv0_LockPolicyDisable a policy without deleting it.
Unlock policyv0_UnlockPolicyRe-enable a locked policy.

Create a policy in the UI

The UI creates the policy in the domain you are working in.

  1. Go to Policies.
  2. Select Create policy.
  3. Complete the Information, Conditions, Evaluation order, and Approval workflow steps.
  4. On the Review step, review the policy, and then select Submit for approval.
  5. Sign the operation with the mobile app.

The policy is created after the intent is approved and executed.

Information

Enter a policy name and, optionally, a description. The UI generates the policy ID, and you can't change it.

Select the Scope: Self applies the policy to intents that target the current domain, Descendants applies it to intents that target its subdomains, and Self & descendants applies it to both. The default is Self. A policy with Descendants or Self & descendants scope adds its workflow to matching subdomain intents. It doesn't replace the subdomain's own policy. For details, see Policy selection.

Optionally, add custom properties as name-value pairs. Under Initial lock status, keep Unlocked so the policy starts matching intents as soon as it exists. To create the policy in a locked state, select Locked.

Conditions

Select the intent types that the policy manages. The UI groups the intent types by entity, such as Accounts, Transactions & Transfers, and Policies. Select all intent types selects every intent type the UI offers. You must select at least one intent type. For the selectable intent types, see Intent types in the UI.

To add conditions that the intent must also fulfill, select Create an additional condition. Select a condition from Predefined conditions, enter its Value, and select Add condition +. The UI combines each condition you add with the existing condition using And. You can also edit the condition JSON directly in the editor, for example to combine conditions with Or. For the predefined conditions and the expressions they generate, see Condition types in the UI. For the JavaScript syntax used in conditions, see JavaScript rules for conditions.

Evaluation order

Enter the Importance rank, from 0 to 1000. The default is 1. The step lists the existing policies in the current domain by rank, so you can place the new policy among them. Rank orders only the policies of one domain. For help choosing a rank, see Rank guidance.

Approval workflow

Select Approval workflow (recommended) to require approvals in one or more steps, Always approve to approve matching intents without user approvals, or Always reject to reject them without user intervention. For how each option maps to the policy's workflow field, see Workflow options in the UI.

To build an approval workflow, enter the number of required approvals in Amount and select the Role that provides them. Select Add condition + to add another approval group to the step, and combine the groups with And (both groups must approve) or Or (either group can approve). Select Add step + to add a sequential step.

When you submit an intent, you count as the first approver in the selected policy of your own domain, so include your user role in the first step. For all workflow rules, including system-signed behavior, see Workflow objects.

Review

The Review step shows the policy information, including the rank as Evaluation order, followed by the intent types, the additional conditions as JSON, and the approval workflow. Review the policy, and then select Submit for approval.

Create a policy with the API

Create a policy by submitting a v0_CreatePolicy intent. The following dry-run request body matches the Perform a dry run operation and can be signed and submitted with the Propose an intent operation after review.

Before you create a policy, prepare a new policy ID and a new intent ID in standard UUID format. Also confirm the role names, intent types, scope, condition paths, workflow, and rank.

The following examples create a policy with the API and with each SDK:

{
  "author": {
    "id": "6ac20654-450e-29e4-65e2-1bdecb7db7c4",
    "domainId": "9067d363-6411-498b-a32b-15d230a86706"
  },
  "expiryAt": "2026-06-30T15:30:00.000Z",
  "targetDomainId": "9067d363-6411-498b-a32b-15d230a86706",
  "id": "7d256a32-812e-4a66-9a56-42ebfac5426a",
  "payload": {
    "id": "5b440ba5-d013-11eb-8cd0-dcfb48cfb3cb",
    "alias": "policy-governance",
    "rank": 700,
    "intentTypes": [
      "v0_CreatePolicy",
      "v0_UpdatePolicy",
      "v0_LockPolicy",
      "v0_UnlockPolicy"
    ],
    "scope": "Self",
    "scriptingEngine": "Javascript_v0",
    "condition": {
      "expression": "context.references.users[context.request.author.id].roles.includes('policy-operator')",
      "type": "Expression"
    },
    "workflow": [
      {
        "left": {
          "role": "policy-operator",
          "quorum": 2,
          "type": "RoleQuorum"
        },
        "right": {
          "role": "compliance",
          "quorum": 1,
          "type": "RoleQuorum"
        },
        "type": "And"
      }
    ],
    "lock": "Unlocked",
    "description": "Controls policy lifecycle operations in the root domain.",
    "customProperties": {},
    "type": "v0_CreatePolicy"
  },
  "description": "Create policy governance policy",
  "customProperties": {},
  "type": "Propose"
}

Dry run before submitting:

curl -X POST "${CUSTODY_API_URL}/v1/intents/dry-run" \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -d @create-policy-intent.json

Submit the signed intent:

curl -X POST "${CUSTODY_API_URL}/v1/intents" \
  -H "Authorization: Bearer ${JWT_TOKEN}" \
  -H "Content-Type: application/json" \
  -H "requestId: 8b6571b9-493c-49fb-9d92-e19b6f39f7cf" \
  -d @signed-create-policy-intent.json

Update a policy

Use v0_UpdatePolicy to replace the mutable policy fields. Include the current policy reference.id and reference.revision, then provide the updated alias, rank, scope, scripting engine, condition, workflow, description, and custom properties.

Update a policy in the UI

  1. Go to Policies.
  2. Open the contextual menu at the end of the policy row and select Edit policy. This option isn't available for a locked policy.
  3. Update the fields in the wizard steps.
  4. On the Review step, select Submit for approval.
  5. Sign the operation with the mobile app.

The UI always submits an explicit list of intent types and never includes intentOrigin. If you edit a policy that someone created through the API, check the payload on the Review step. The UI makes these changes:

  • It gives a policy without intentTypes every intent type that the UI offers.
  • It drops intent types without a UI selector, such as v0_NotarizeData.
  • It turns a system-signed policy into a user-signed one.

For details, see UI policy builder mapping.

Updating a policy changes its revision. Open intents that use the policy fail with StaleIntent, or with PolicyRevisionMismatch if a decision arrives first. For details, see Policy changes and open intents.

Update a policy with the API

The following examples update a policy with the API and with each SDK:

{
  "payload": {
    "reference": {
      "id": "5b440ba5-d013-11eb-8cd0-dcfb48cfb3cb",
      "revision": 3
    },
    "alias": "policy-governance",
    "rank": 750,
    "intentTypes": [
      "v0_CreatePolicy",
      "v0_UpdatePolicy",
      "v0_LockPolicy",
      "v0_UnlockPolicy"
    ],
    "scope": "Self",
    "scriptingEngine": "Javascript_v0",
    "condition": {
      "expression": "context.references.users[context.request.author.id].roles.includes('policy-operator')",
      "type": "Expression"
    },
    "workflow": [
      {
        "left": {
          "role": "policy-operator",
          "quorum": 2,
          "type": "RoleQuorum"
        },
        "right": {
          "role": "compliance",
          "quorum": 2,
          "type": "RoleQuorum"
        },
        "type": "And"
      }
    ],
    "description": "Controls policy lifecycle operations in the root domain.",
    "customProperties": {},
    "type": "v0_UpdatePolicy"
  }
}

Treat policy updates as high-risk operations. A policy update can change the policy that governs future policy updates.

Create a policy for system-signed intents with the API

System-signed intents are API-only proposals from service callers. They are submitted without a client-side payload signature and are matched only by policies whose intentOrigin is SystemSigned.

Use this pattern only for tightly scoped automation. At minimum:

  • Set intentOrigin to SystemSigned.
  • Specify the exact intentTypes the service caller can submit.
  • Use a condition that checks the service submitter. For defense in depth, combine context.submitter.custodyRoles.includes(...) with a context.submitter.subject check for the expected service account.
  • Omit workflow only when automatic execution is intentional. If you include a workflow, user-signed approvers must satisfy it.

The following example allows a service caller with the gas-station-service custody role and gas-station-svc subject to submit transaction order proposals. Replace both values with the role and subject issued by your identity provider.

{
  "author": {
    "id": "6ac20654-450e-29e4-65e2-1bdecb7db7c4",
    "domainId": "9067d363-6411-498b-a32b-15d230a86706"
  },
  "expiryAt": "2026-06-30T15:30:00.000Z",
  "targetDomainId": "9067d363-6411-498b-a32b-15d230a86706",
  "id": "7d256a32-812e-4a66-9a56-42ebfac5426a",
  "payload": {
    "id": "af1d2e33-9a94-4456-bcb3-895bba820d38",
    "alias": "gas-station-system-signed",
    "rank": 420,
    "intentTypes": ["v0_CreateTransactionOrder"],
    "intentOrigin": "SystemSigned",
    "scope": "SelfAndDescendants",
    "scriptingEngine": "Javascript_v0",
    "condition": {
      "expression": "context.submitter.type === 'Service' && context.submitter.custodyRoles.includes('gas-station-service') && context.submitter.subject === 'gas-station-svc'",
      "type": "Expression"
    },
    "lock": "Unlocked",
    "description": "Allows Gas Station service-submitted transaction orders.",
    "customProperties": {},
    "type": "v0_CreatePolicy"
  },
  "description": "Create system-signed Gas Station policy",
  "customProperties": {},
  "type": "Propose"
}

Submit this policy with the normal user-signed policy creation flow. The policy itself is a governance change and should be created, approved, and audited by users with authority to manage policies.

The SDK policy create and update methods and the UI policy wizard don't set intentOrigin. They create user-signed policies only, and an update through any of them turns a system-signed policy into a user-signed one, which then stops matching system-signed proposals. Create and update system-signed policies with the API, and include intentOrigin: "SystemSigned" in every v0_UpdatePolicy payload for them.

Lock and unlock a policy

Lock a policy when it should stop matching new intents without being removed from the environment.

Lock or unlock a policy in the UI

  1. Go to Policies.
  2. Open the contextual menu at the end of the policy row.
  3. Select Lock or Unlock.
  4. Click Submit for approval.
  5. Sign the operation with the mobile app.

Lock or unlock a policy with the API

Submit v0_LockPolicy or v0_UnlockPolicy with the current policy reference:

{
  "payload": {
    "reference": {
      "id": "5b440ba5-d013-11eb-8cd0-dcfb48cfb3cb",
      "revision": 3
    },
    "type": "v0_LockPolicy"
  }
}

Use v0_UnlockPolicy with the same reference shape to re-enable the policy.

Safe rollout sequence

Policy changes can change the rules that govern future policy changes. Use a controlled sequence:

  1. Confirm domain read access and required roles.
  2. Confirm enough users exist for the intended quorum.
  3. Deploy operational policies before policy-governance policies.
  4. Deploy policy-governance policies after the users and fallback path exist.
  5. Deploy emergency "break-glass" policies, high-privilege policies used only during incidents, only after their scope and intent types are explicit.
  6. Dry run representative intents.

Pre-flight checks

CheckWhy it matters
intentTypes are explicitPrevents accidental catch-all behavior.
intentOrigin is intentionalPrevents a user-signed policy from being confused with a system-signed automation policy.
Condition paths are validPrevents policy selection errors.
Workflow is satisfiablePrevents governance lockout.
User-signed first workflow step includes maker roleLets the intent creator count as first approval. For system-signed policies, confirm the workflow can be satisfied by user approvers.
Rank is intentionalEnsures the expected policy wins.
Scope is narrow enoughPrevents parent-domain policies applying too broadly.
Fallback existsGives legitimate unexpected workflows a controlled path.

Common policy mistakes

MistakeProblemFix
Empty workflow: []Matching intents are rejected.Omit workflow for auto-approval or define explicit approval steps.
Missing intentTypesPolicy can match all intents.Specify intent types except for deliberate fallback policies.
Missing intentOrigin on an automation policyPolicy matches only user-signed proposals.Set intentOrigin: "SystemSigned" when the policy is meant for system-signed API proposals.
High-rank catch-allSpecific policies may never apply.Give fallback policies low rank.
Required role has no usersWorkflow cannot complete.Create users before deploying the policy.
Role names do not matchApprovers cannot satisfy workflow.Keep role names consistent across users and policies.

Operational checklist

Before submitting a policy intent:

  • Confirm the target domain and policy scope.
  • Confirm the policy's intent types are deliberate.
  • Confirm the condition is null-safe and uses the correct payload paths for each intent type.
  • Confirm every workflow role exists in the target domain.
  • Confirm quorum can be satisfied by independent users.
  • For user-signed policies, confirm the first workflow step includes the maker role.
  • For system-signed policies, confirm the workflow can be satisfied by user approvers, or that automatic execution is intentional.
  • Confirm rank relative to other matching policies.
  • Dry run representative intents before and after the policy change.

Troubleshooting

When a policy does not behave as expected:

  1. Check intent type.
  2. Check target domain and scope.
  3. Check condition expression.
  4. Check rank against other matching policies.
  5. Check workflow roles and quorum.
  6. Check lock state.

For field details, see Policy reference. For reusable models, see Policy examples.