> ## 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.

# Attestation

> How agents verify the Verifier before establishing trust

# Attestation

The Verifier presents a self-attestation document that clients check before establishing trust.

```mermaid theme={null}
sequenceDiagram
    participant Agent as Agent (Client)
    participant Verifier as Verifier (Server)

    Agent->>Verifier: 1. GET /_spellguard/attestation + nonce
    Verifier-->>Agent: 2. VerifierAttestationDocument
    Note right of Verifier: imageHash, hardwareSignature,<br/>sessionPublicKey, nonce
    Note left of Agent: Verify: hash, sig, nonce
```

## Attestation Document Structure

```typescript theme={null}
interface VerifierAttestationDocument {
  /** SHA384 hash of the Verifier Docker image (reproducible build) */
  imageHash: string;

  /** Signature from Verifier hardware (TDX quote or Nitro COSE_Sign1 document) */
  hardwareSignature: string;

  /** Verifier's ephemeral public key for this session */
  publicKey: string;

  /** Timestamp of attestation generation */
  timestamp: number;

  /** Client-provided nonce to prevent replay attacks */
  nonce: string;

  /** Verifier attestation type */
  attestationType?: 'nitro' | 'phala' | 'internal' | 'mock';

  /** Supported encryption algorithms */
  supportedAlgorithms?: string[];
}
```

## Attestation Types

| Type       | Description         | Use Case                            |
| ---------- | ------------------- | ----------------------------------- |
| `nitro`    | AWS Nitro Enclave   | Production workloads on AWS         |
| `phala`    | Intel TDX via Phala | Production workloads on Phala Cloud |
| `internal` | Platform-attested   | Intra-organization only             |
| `mock`     | Development mode    | Local development and testing       |
