Skip to main content

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:
  1. Agent signs request - Uses private key to create a signature over request components
  2. Agent sends request - Includes signature headers with the HTTP request
  3. Tool receives request - Extracts signature headers
  4. Tool fetches public key - Retrieves agent’s public key from discovery endpoint
  5. 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:
Parameters:

Signature-Agent

Identifies the agent and where to find its public key:
Format: {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
Example signature base:

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 include created and expires timestamps:
Tools verify the signature is still within its validity window.

Nonce Values

Each signature includes a unique 64-byte random nonce:
Tools may optionally track nonces to ensure they’re only used once.
Intercepted requests cannot be reused because signatures are short-lived and tied to unique nonce values.

Using vestauth agent curl

The CLI automatically signs requests:
View the signed headers:
Output:

Tool Verification API

Tools verify agent requests with a single function call:
The verify function returns the verified agent identity:

Security Benefits

Private keys never leave the agent. Tools only need public keys to verify signatures.
Signatures provide mathematical proof that the request was created by the agent holding the private key.
Signatures are computed over request components, so tampering invalidates the signature.
Time windows and nonces prevent intercepted requests from being reused.
Keys can be rotated without updating tools or reconfiguring integrations.