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.
- Allow Schema
- Deny Schema
If any unhandled error occurs during evaluation, the Vincent Ability SDK automatically returns a deny result with the error message.
Example Implementation
Best Practices
- Use Fresh Data - Query current state rather than relying on cached values
- Consistent with Precheck - Apply the same validation logic as your precheck function
- Handle Errors Gracefully - Provide clear error messages for debugging
- 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

