The evaluate function provides final validation with full blockchain access in the Lit Action environment. This is where your Policy makes the definitive allow/deny decision.
A Zod schema that defines the structure of successful evaluation results. Include details about why the evaluation passed, such as current state and validation context.
A Zod schema that defines the structure of failed evaluation results. Include details about why the evaluation failed, such as exceeded limits or validation errors.
Allow Schema
Deny Schema
import { createVincentPolicy } from '@lit-protocol/vincent-ability-sdk';import { z } from 'zod';const vincentPolicy = createVincentPolicy({ // ... other policy definitions evalAllowResultSchema: z.object({ maxDailySpendingLimit: z.number(), currentDailySpending: z.number(), allowedTokens: z.array(z.string()), }),});
import { createVincentPolicy } from '@lit-protocol/vincent-ability-sdk';import { z } from 'zod';const vincentPolicy = createVincentPolicy({ // ... other policy definitions evalDenyResultSchema: z.object({ reason: z.string(), maxDailySpendingLimit: z.number(), currentDailySpending: z.number(), allowedTokens: z.array(z.string()), }),});
If any unhandled error occurs during evaluation, the Vincent Ability SDK automatically returns a deny result with the error message.