Skip to main content

Overview

Vestauth makes it easy to build tools that authenticate agents using cryptographic signatures. With a single line of code, you can verify an agent’s identity and securely access their unique identifier.

Quick Start

Add Vestauth authentication to any HTTP endpoint using vestauth.tool.verify():

How It Works

1

Agent sends signed request

The agent signs each HTTP request with its private key using vestauth agent curl:
This automatically adds three signature headers to the request:
  • Signature - The cryptographic signature
  • Signature-Input - Signature parameters (created, expires, nonce, keyid)
  • Signature-Agent - The agent’s unique identifier and discovery endpoint
2

Tool receives request

Your tool receives the HTTP request with signed headers.
3

Tool verifies signature

vestauth.tool.verify() performs several checks:
  1. Validates that required headers are present
  2. Checks signature hasn’t expired
  3. Extracts agent identity from Signature-Agent header
  4. Fetches agent’s public key from .well-known discovery endpoint
  5. Verifies cryptographic signature matches the request
4

Tool receives agent identity

On success, verify() returns the agent’s identity:

Verification Logic

The tool.verify() function is implemented in /src/lib/helpers/toolVerify.js:

Response Format

Success Response

When verification succeeds, return the agent object:
Example:

Error Response

When verification fails, return a 401 error:
Common error messages:
  • Missing Signature-Agent header
  • Invalid Signature-Agent
  • Untrusted Signature-Agent
  • Expired signature
  • Invalid signature

Using Agent Identity

Once verified, use the agent’s uid to:
  • Track usage - Store requests per agent for rate limiting
  • Personalize responses - Return agent-specific data
  • Access control - Grant/deny permissions based on agent identity
  • Audit logs - Record which agent performed each action
Example:

Framework Examples

Best Practices

Always use HTTPS in productionVestauth signatures protect request integrity, but you should still use HTTPS to prevent eavesdropping on request/response content.
Cache public keysThe verification process fetches the agent’s public key from their .well-known endpoint. Consider caching these keys to improve performance and reduce network calls.

Error Handling

Always wrap verify() in a try-catch block:

URL Construction

Ensure the URL passed to verify() exactly matches what the agent signed:

Testing Your Tool

Test your tool using the Vestauth CLI:

Next Steps

Key Rotation

Learn how to handle agent key rotation

Security Model

Understand Vestauth’s security architecture