This guide will walk you through the process of setting up and using HMAC authentication in Vellum. HMAC authentication provides an additional layer of security for outgoing API calls and webhooks.
Create a new secret token securely: You can do this in Python using the secrets module. Here’s a simple example:
Provide your secret token to Vellum: Navigate to Workspace Settings. Click the “Provide HMAC Token” button and enter your secret token.
HMAC authentication is automatically applied to specific types of outgoing requests from Vellum, but not all.
HMAC signatures are automatically included in the following scenarios:
HMAC signatures are NOT automatically included for :
Code Execution Nodes in Workflows
If you need to make authenticated requests from within a Code Execution Node, you’ll need to implement HMAC signature generation yourself.
Consider also storing your HMAC secret as a Workspace Secret for secure access within your Code Execution Nodes.
When Vellum automatically applies HMAC authentication, each request will contain two headers: X-Vellum-Timestamp and X-Vellum-Signature.
You can reference these headers to verify the authenticity of requests made to your service from Vellum.
Verify the timestamp: Check that the value of X-Vellum-Timestamp is within the last 60 seconds.
Create the message string: Concatenate the following values together, separated by one newline character, into a new string message:
X-Vellum-TimestampVerify the signature. Use the HMAC algorithm with SHA-256 to verify the authenticity of X-Vellum-Signature.