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.
Quick Start
- For Agents
- For Verifier Operators
import { fetchAndVerifyVerifier, buildEvidence, signEvidence } from '@spellguard/ctls';
import { encryptForVerifier } from '@spellguard/amp';
// 1. Verify Verifier before connecting
const verifier = await fetchAndVerifyVerifier(verifierUrl, expectedImageHash);
if (!verifier.verified) throw new Error('Verifier verification failed');
// 2. Register with the Verifier
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);
// 3. Send encrypted messages
const encrypted = encryptForVerifier(
JSON.stringify(payload),
verifier.sessionX25519PublicKey
);
import {
generateSessionKeys,
generateAttestationDocument,
verifyEvidence
} from '@spellguard/ctls';
import {
initLoggingBackends,
generateCommitment,
logAndArchive
} from '@spellguard/amp';
// 1. Initialize
await generateSessionKeys(); // RAM-only, forward secrecy
await initLoggingBackends(); // Connect to Rekor, S3, etc.
// 2. Handle attestation requests
const attestation = await generateAttestationDocument(clientNonce);
// 3. Verify and register agents
const result = await verifyEvidence(signedEvidence);
if (result.verified) {
registerAgent({
agentId: result.agentId,
channelToken: result.channelToken
});
}
// 4. Process messages with audit trail
const commitment = generateCommitment(message);
await logAndArchive(message, commitment);
Installation
npm install @spellguard/ctls @spellguard/amp