Overview
Vestauth authenticates HTTP requests using cryptographic signatures based on RFC 9421. Each request is signed with the agent’s private key, and tools verify the signature using the agent’s public key. This approach eliminates shared secrets while providing strong cryptographic proof of identity.How It Works
Authentication follows these steps:- Agent signs request - Uses private key to create a signature over request components
- Agent sends request - Includes signature headers with the HTTP request
- Tool receives request - Extracts signature headers
- Tool fetches public key - Retrieves agent’s public key from discovery endpoint
- Tool verifies signature - Validates the signature matches the request
Signatures are computed over specific request components like the authority (domain) and signature parameters, ensuring integrity of the entire request.
Signature Headers
Vestauth adds three headers to authenticate requests:Signature
Contains the base64-encoded cryptographic signature:Signature-Input
Describes what was signed and metadata about the signature:Signature-Agent
Identifies the agent and where to find its public key:{agent-uid}.{discovery-hostname}
The discovery URL is constructed by prepending the agent UID as a subdomain to the discovery hostname.
Creating Signatures
Here’s how Vestauth creates signatures:1. Build Signature Parameters
src/lib/helpers/signatureParams.js
2. Create Signature Base
The signature base is constructed from the authority and signature parameters:src/lib/helpers/authorityMessage.js
3. Sign with Private Key
src/lib/helpers/webBotAuthSignature.js
4. Construct Headers
src/lib/helpers/headers.js
Verifying Signatures
Tools verify signatures using the following process:1. Extract Headers
2. Check Expiration
3. Fetch Public Key
Retrieve the agent’s public key from the discovery endpoint:src/lib/helpers/verify.js
4. Verify Signature
Replay Attack Prevention
Vestauth prevents replay attacks using multiple mechanisms:Time Windows
Signatures includecreated and expires timestamps:
Nonce Values
Each signature includes a unique 64-byte random nonce:Using vestauth agent curl
The CLI automatically signs requests:Tool Verification API
Tools verify agent requests with a single function call:verify function returns the verified agent identity:
Security Benefits
Cryptographic proof
Cryptographic proof
Signatures provide mathematical proof that the request was created by the agent holding the private key.
Request integrity
Request integrity
Signatures are computed over request components, so tampering invalidates the signature.
Replay protection
Replay protection
Time windows and nonces prevent intercepted requests from being reused.
Easy rotation
Easy rotation
Keys can be rotated without updating tools or reconfiguring integrations.