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 usingvestauth.tool.verify():
How It Works
1
Agent sends signed request
The agent signs each HTTP request with its private key using This automatically adds three signature headers to the request:
vestauth agent curl:Signature- The cryptographic signatureSignature-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:- Validates that required headers are present
- Checks signature hasn’t expired
- Extracts agent identity from
Signature-Agentheader - Fetches agent’s public key from
.well-knowndiscovery endpoint - Verifies cryptographic signature matches the request
4
Tool receives agent identity
On success,
verify() returns the agent’s identity:Verification Logic
Thetool.verify() function is implemented in /src/lib/helpers/toolVerify.js:
Response Format
Success Response
When verification succeeds, return the agent object:Error Response
When verification fails, return a 401 error:Missing Signature-Agent headerInvalid Signature-AgentUntrusted Signature-AgentExpired signatureInvalid signature
Using Agent Identity
Once verified, use the agent’suid 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
Framework Examples
Express.js
Express.js
Fastify
Fastify
Next.js API Route
Next.js API Route
Best Practices
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 wrapverify() in a try-catch block:
URL Construction
Ensure the URL passed toverify() 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