Skip to main content
The execute function contains your Ability’s core logic and runs in the Lit Action environment with access to signing capabilities. This is where the actual work happens.

Function Parameters

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

Response Schemas

Success Response

ZodSchema
required
A Zod schema that defines the structure of successful execution results. Include details about the completed operation, such as transaction hashes, amounts transferred, or other relevant outcomes.

Failure Response

ZodSchema
required
A Zod schema that defines the structure of failed execution results. Include error details to help the executor understand what went wrong, including error codes, reasons, and relevant context.
If any unhandled error occurs during execution, the Vincent Ability SDK automatically returns a fail result with the error message.

Executing Vincent Policy Commit Functions

After your ability’s execute function successfully completes, the last step should be calling the commit functions for any supported Vincent Policies that have them. These commit functions allow policies to update their internal state based on what actions your ability performed.
Your ability’s execute function should always call the commit functions for any supported Vincent Policies that have a commit function defined. Failing to do so could cause the Vincent Policies to operate incorrectly.
For our token transfer ability example, after successfully executing the transfer, we call the Vincent spending limit policy’s commit function to update the amount spent:

Example Implementation

Next Steps

Supporting Policies

Learn how to integrate Vincent Policies with your Ability

Publishing

Deploy and publish your Ability to the Vincent Registry