Skip to main content

Policies

A policy is a condition the account checks before it authorises a call. If the call doesn't meet it, the transaction fails. Use policies to limit what an agent key can do.

The Policies page lists the account's rules. Some templates install several rules that work together; the list shows them as one row that you can expand. View opens a rule's details. The templates are below the list.

Templates​

Add a rule sits above the templates. A template is a short form that prepares a rule's policy and opens it in Add a rule, where you add the signers, set the approval count and name the rule, then install it. You can also write a policy yourself in Add a rule, as a tree or as raw text.

TemplateAllows
Swap on Aquarius, proceeds to custodyDrawing a token from custody, swapping it in one Aquarius pool, and sending the proceeds back to custody. Used in the walkthrough.
Allocate to BlendDrawing a token from custody and supplying it to one Blend pool, with the position held by the Prime Account
Withdraw from Blend to custodyWithdrawing from the Prime Account's Blend position, paid straight to custody
Claim Blend rewards to custodyClaiming the BLND the account's positions on one pool have earned, paid only to custody
Rebalance between two Blend poolsWithdrawing a token from one Blend pool and supplying the same amount to another, in one move
Deposit into an Upshift vaultDrawing a token from custody and depositing it into one Upshift vault, with the shares held by the Prime Account
Withdraw from Upshift to custodyWithdrawing an exact amount from an Upshift vault, paid straight to custody
Rebalance from Blend into UpshiftWithdrawing from a Blend pool and depositing the same amount into an Upshift vault, in one move
Rebalance from Upshift into BlendWithdrawing an exact amount from an Upshift vault and supplying it to a Blend pool, in one move
Spending limitTransfers through one asset contract, capped over a rolling window of ledgers
Pull fundsPulling an asset from your wallet into the account, capped per pull, and sending it on only to one chosen address or back to your wallet
Claim Blend rewards to your walletClaiming the emissions the account's Blend positions have earned on one pool, paid straight to your wallet
Blend poolOnce per Blend pool: lets the execution contract approve the account's own submit and claim on that pool
Upshift vaultOnce per Upshift vault: lets the execution contract approve the account's own withdrawal from that vault

The first nine are rules that run a move through the execution contract and the custody gate, so they need both connected in this browser first. If they aren't, the app offers Manage execution. Some of them need Blend pool or Upshift vault installed for the same pool or vault, and the form names it. Pull funds and Claim Blend rewards to your wallet are offered only with a Stellar wallet connected.

A form asks only for what its template needs, such as the pool, the token and the most per move, and reads the rest from the chain. Values with a default, such as a swap's minimum return of 1 base unit or a wait of 0 ledgers, go straight into the policy; change them in Add a rule before you install.

What a policy can restrict​

  • the contract it may call
  • the method
  • the amount per call
  • the recipients
  • the total spent over a period (with a spending limit)
  • the minimum a trade must return

Rules that expire after a set time can be set on chain but not in the app. For how to set spending limits, see Setting up policies.

Installing and revoking​

Select Install rule in Add a rule and sign. If the account needs more approvals, the other signers co-sign it from the Queue. If the button is greyed out, the reason is shown next to it.

To revoke, open the rule and remove the policy, then sign. This also resets the policy's counters, such as a spending limit's running total.

If a row holds several rules, removing one of them stops the others working too, and they stay listed until you remove them. The confirm dialog warns you when this applies.

Before giving a key to an agent​

Read Setting up policies.

The OctoGate user guide has recordings of a daily claim limit, a monthly subscription cap and a swap minimum, each passing and then failing on testnet.