Approval Policies

Configure rules that govern autonomous transaction execution. Policies define which transactions agents can execute automatically and which require human approval.

Overview

Approval policies provide declarative control over agent transaction permissions. Define policies using YAML configuration files that specify conditions and actions for different transaction types.

Policy structure

policies:
  - name: policy_name
    conditions:
      # Transaction criteria
    action: auto_approve | require_human_approval | reject
    notification:
      channels: [email, slack, webhook]
      timeout: 3600

Basic example

Auto-approve small transfers, require approval for large amounts:

policies:
  - name: auto_approve_small_transfers
    conditions:
      transaction_type: transfer
      max_value_usd: 100
      daily_limit_usd: 500
    action: auto_approve

  - name: approve_large_transfers
    conditions:
      transaction_type: transfer
      min_value_usd: 100
    action: require_human_approval
    notification:
      channels: [email, slack]
      timeout: 3600

Condition types

Transaction type

Filter by operation type:

Value limits

Set minimum and maximum transaction values:

Asset filters

Restrict policies to specific tokens:

Contract verification

Require verified contracts:

Recipient constraints

Whitelist or blacklist addresses:

Time restrictions

Limit transaction execution to specific time windows:

Gas price limits

Prevent execution during high gas prices:

Actions

Auto approve

Execute transaction immediately without human intervention:

Require human approval

Pause execution and send notification for manual review:

Reject

Block transaction execution:

Notification channels

Email

Send approval requests via email:

Slack

Post to Slack channel with approval buttons:

Webhook

Send HTTP POST to custom endpoint:

Policy evaluation

Policies are evaluated in order from top to bottom. The first matching policy determines the action.

Example evaluation flow:

Evaluation:

  1. Contract call to unverified contract → Rejected (matches policy 1)

  2. Contract call worth $25 to verified contract → Auto-approved (matches policy 2)

  3. Contract call worth $200 to verified contract → Requires approval (matches policy 3)

Complex policies

Multi-condition policies

Combine multiple conditions with AND logic:

Rate limiting

Limit transaction velocity:

Anomaly detection

Flag unusual patterns:

Loading policies

From file

From object

Dynamic updates

Update policies at runtime:

Handling approval requests

Via SDK

Check pending approvals:

Via webhook

Receive approval requests at your endpoint:

Respond to approve:

Testing policies

Validate policy configuration before deployment:

Best practices

Start restrictive: Begin with require_human_approval as the default action. Gradually add auto_approve policies as confidence builds.

Layer policies: Use multiple policies for defense in depth. Block known-bad patterns, approve known-good patterns, require review for everything else.

Monitor approvals: Track which policies trigger most frequently. Adjust thresholds based on actual agent behavior.

Set timeouts: Always configure approval timeouts. Transactions shouldn't pend indefinitely.

Log everything: Enable audit logging to track all policy evaluations and approval decisions.

Test thoroughly: Use testnet to validate policy behavior before mainnet deployment.

Example: Production policy set

Troubleshooting

Policy not matching

Check condition syntax and values:

Approval timeout too short

Increase timeout or set up escalation:

Too many approval requests

Adjust policy thresholds or add more auto-approve rules:

Next steps

Last updated