Skip to main content
Every privileged instruction delegates its authorization decision to the vault’s policy program through one uniform cross-program call. The contract is deliberately minimal, so any program that implements it can serve as a policy.

The wire contract

Policy state lives in a PDA seeded by the vault (seeds = [vault]) under the policy’s own program id, so each vault carries an isolated policy configuration. Operations a policy doesn’t constrain return Ok (pass-through).

The 13 operations

Thirteen core instructions each issue exactly one validate(ValidateOperation) CPI, with a 1:1 mapping between instruction and operation variant.

Failure semantics

Rejections surface as typed errors — TransactionAlreadyPending, NotEnoughSigners, AmountTooHigh / AmountTooLow, UnauthorizedSender — and either revert create_tx or leave did_execute false on execute_tx. Authorization leaves no partial state.

Build a custom policy

Implement this interface with a complete Rust skeleton.