Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.spellguard.ai/llms.txt

Use this file to discover all available pages before exploring further.

Evidence Building (RFC 9334 RATS)

After the client approves the Verifier, the agent constructs Evidence — a set of claims about itself that the Verifier can check.

Evidence Structure

interface Evidence {
  /** Unique identifier for the agent */
  agentId: string;

  /** Claims about the agent */
  claims: {
    /** Hash of the agent's code */
    codeHash: string;
    /** Agent's callback endpoint URL */
    endpoint: string;
    /** URL to the agent's A2A Agent Card */
    agentCardUrl: string;
    /** Capabilities the agent supports */
    capabilities: string[];
    /** Preferred encryption algorithm */
    preferredAlgorithm?: string;
  };

  /** Ed25519 signature over the claims */
  signature: string;
}

Building Evidence

import { buildEvidence, signEvidence } from '@spellguard/ctls';

const evidence = buildEvidence({
  agentId: 'my-agent',
  codeHash: 'sha256:abc123...',
  endpoint: 'https://my-agent.com/_spellguard/receive',
  agentCardUrl: 'https://my-agent.com/.well-known/agent.json',
});

const signed = await signEvidence(evidence, privateKey);
Evidence is signed with an Ed25519 key. The public key should be registered with the management server for verification.