Policy Lifecycle
Vincent Policies execute in two phases during Ability execution:1
Precheck
Runs locally to validate that execution will likely succeed. Provides best-effort validation before network resources are used
2
Evaluate
Runs in the Lit Action environment with full blockchain access to make the final allow/deny decision
Only if all policies return
allow results will the Ability’s execute function proceed. After successful execution, the Ability may call the Policy’s commit function to update state.Defining Your Policy
string
required
The npm package name of your Policy (e.g.,
@your-org/policy-name)ZodSchema
required
Zod schema defining what parameters Abilities must provide to your Policy
ZodSchema
required
Zod schema for user-configurable boundaries stored securely on-chain
ZodSchema
Zod schema for successful precheck return values
ZodSchema
Zod schema for denied precheck return values
function
required
Async function providing fast, local validation before using network resources
ZodSchema
Zod schema for successful evaluation return values
ZodSchema
Zod schema for denied evaluation return values
function
required
Async function with full blockchain access making final allow/deny decision
ZodSchema
Zod schema for parameters passed to commit function
ZodSchema
Zod schema for successful commit return values
ZodSchema
Zod schema for failed commit return values
function
Optional async function to update policy state after successful Ability execution
Creating Vincent Policies
Vincent Policies are created usingcreateVincentPolicy from the Vincent Ability SDK:
Example Implementation
Full Spending Limit Policy
Full Spending Limit Policy
Deep Dive Guides
Parameter Schemas
Define parameters from Abilities and user configuration
Precheck Function
Implement fast local validation logic
Evaluate Function
Write blockchain validation with full access
Commit Function
Update state after successful execution

