Skip to main content
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.

Function Parameters

The evaluate function receives two parameters:
object
required
Object containing the ability and user parameters
object
required
Context object provided by the SDK with helpers and metadata

Response Schemas

Allow Response

ZodSchema
required
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.

Deny Response

ZodSchema
required
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.
If any unhandled error occurs during evaluation, the Vincent Ability SDK automatically returns a deny result with the error message.

Example Implementation

Best Practices

  1. Use Fresh Data - Query current state rather than relying on cached values
  2. Consistent with Precheck - Apply the same validation logic as your precheck function
  3. Handle Errors Gracefully - Provide clear error messages for debugging
  4. Return Context - Include current state information in allow/deny responses

Next Steps

Commit Function

Update policy state after successful execution

Publishing Policies

Publish your policy for use in Vincent Apps