Skip to main content

Overview

Primitives are low-level commands for cryptographic operations. Use these when you need fine-grained control over keypairs, signatures, and verification without the higher-level abstractions.
Most users should use Agent Commands instead. Primitives are for advanced use cases and library development.

primitives keypair

Generate a new Ed25519 public/private keypair.
Output:

Options

string
Use an existing private JWK instead of generating a new one. Useful for deriving the public key from a known private key.
string
default:"agent"
UID prefix type: agent, tool, or none.
  • agent - Generates UID like agent-4b94ccd425e939fac5016b6b
  • tool - Generates UID like tool-4b94ccd425e939fac5016b6b
  • none - No prefix, just the hash
boolean
Pretty-print JSON output.Alias: --pretty-print

Examples

Key Format (JWK)

Vestauth uses JSON Web Key (JWK) format for Ed25519 keys: Public JWK:
Private JWK:
Never share the private JWK (d field). This is your secret signing key.

primitives headers

Generate HTTP Message Signature headers for a request.
Example:
Output:

Arguments

string
required
HTTP method: GET, POST, PUT, DELETE, etc.
string
required
Full URI including scheme and authority (e.g., https://api.example.com/path)

Options

string
Agent or tool UID. Defaults to AGENT_UID or AGENT_ID environment variable.If not provided, generates a new random UID.Alias: --id
string
Private JWK for signing. Defaults to AGENT_PRIVATE_JWK environment variable.If not provided, generates a new keypair.
string
default:"web-bot-auth"
Signature tag value per Web-Bot-Auth draft.
string
Custom nonce value. By default, a cryptographically random 64-byte nonce is generated.
boolean
Pretty-print JSON output.Alias: --pretty-print

Examples

Signature Components

Signature Header:
The cryptographic signature of the request using Ed25519. Signature-Input Header:
Contains:
  • Covered components: @authority (hostname)
  • created - Unix timestamp when signature was created
  • keyid - Public key identifier
  • alg - Signature algorithm (ed25519)
  • expires - Unix timestamp when signature expires (created + 5 minutes)
  • nonce - Random value to prevent replay attacks
  • tag - Protocol identifier (web-bot-auth)
Signature-Agent Header:
Identifies the agent and provides the discovery domain.

primitives verify

Verify HTTP Message Signature headers using a public key.
Example:
Output:

Arguments

string
required
HTTP method of the request being verified.
string
required
Full URI of the request being verified.

Options

string
required
Value of the Signature header.
string
required
Value of the Signature-Input header.
string
Value of the Signature-Agent header.If provided, fetches the public key from the agent’s .well-known discovery endpoint.If omitted, you must provide --public-jwk.
string
Public JWK to verify against. Defaults to AGENT_PUBLIC_JWK environment variable.Required if --signature-agent is not provided.
boolean
Pretty-print JSON output.Alias: --pretty-print

Verification Modes

Mode 1: With Agent Discovery Provide --signature-agent to fetch the public key automatically:
Mode 2: With Known Public Key Provide --public-jwk directly:

What Gets Verified

  1. Signature Validity: Cryptographic signature matches the request
  2. Expiration: Signature has not expired
  3. Algorithm: Uses supported algorithm (Ed25519)
  4. Key ID: Matches the public key
  5. Components: Signed components match the request

Error Codes

Verification fails with specific errors:
  • Invalid signature: Signature does not match
  • Expired: Current time > expires timestamp
  • Invalid key: Public key format is invalid
  • Algorithm mismatch: Signature algorithm not supported
  • Missing components: Required signature components missing

Use Cases

Custom Agent Implementation

Build your own agent in any language:

Custom Tool Verification

Verify signatures in any language:

Testing Signatures

Test signature generation and verification:

Standards Compliance

Primitives implement these standards: