TrigGuard
TRIGGUARD KEY_DISCOVERY

TG-KEY-DISCOVERY

Key Discovery and Management Specification

Status: Draft Standard
Version: 1.0.0
Date: 2026-03-13
Extends: TG-EXECUTION-AUTH-01
Contents
  1. Overview
  2. Well-Known Endpoint
  3. Response Schema
  4. Key Fields
  5. Key Lifecycle
  6. Client Implementation
  7. Examples
  8. Security Considerations
  9. Conformance

Abstract

This document specifies the key discovery mechanism for TrigGuard Execution Receipts. Public keys used to verify receipt signatures are published at a well-known URL, enabling offline verification without runtime dependency on TrigGuard services.

1. Overview

TrigGuard uses Ed25519 public-key cryptography for receipt signing. To verify signatures, clients need access to public keys. This specification defines:

2. Well-Known Endpoint

2.1 URL

GET /.well-known/trigguard-keys.json

2.2 Production URL

https://api.trigguardai.com/.well-known/trigguard-keys.json

2.3 Response Headers

HeaderValue
Content-Typeapplication/json
Cache-Controlmax-age=3600
Access-Control-Allow-Origin*

2.4 Response Status

StatusMeaning
200Success
503Service unavailable

3. Response Schema

3.1 JSON Schema

{
 "$schema": "http://json-schema.org/draft-07/schema#",
 "$id": "https://trigguardai.com/schemas/keys.json",
 "title": "TrigGuard Key Set",
 "type": "object",
 "required": ["keys", "issuer"],
 "properties": {
 "keys": {
 "type": "array",
 "items": { "$ref": "#/definitions/key" }
 },
 "issuer": {
 "type": "string",
 "format": "uri"
 },
 "documentation": {
 "type": "string",
 "format": "uri"
 }
 },
 "definitions": {
 "key": {
 "type": "object",
 "required": ["key_id", "algorithm", "public_key", "status"],
 "properties": {
 "key_id": { "type": "string" },
 "algorithm": { "type": "string", "enum": ["Ed25519"] },
 "public_key": { "type": "string" },
 "status": { "type": "string", "enum": ["active", "deprecated", "revoked"] },
 "created_at": { "type": "string", "format": "date-time" },
 "expires_at": { "type": "string", "format": "date-time" },
 "deprecated_at": { "type": "string", "format": "date-time" }
 }
 }
 }
}

3.2 Example Response

{
 "keys": [
 {
 "key_id": "tg_prod_02",
 "algorithm": "Ed25519",
 "public_key": "MCowBQYDK2VwAyEAn8j/xb4Df2vB1sP+pzRw3Y5kLfKm9vE7h8QaXcW2rD0=",
 "status": "active",
 "created_at": "2026-03-01T00:00:00Z",
 "expires_at": "2026-06-01T00:00:00Z"
 },
 {
 "key_id": "tg_prod_01",
 "algorithm": "Ed25519",
 "public_key": "MCowBQYDK2VwAyEAz7Y2xK4pE8vN3mJ1cR9wB6fT5hL2qS0nG8jD4aX1kM0=",
 "status": "deprecated",
 "created_at": "2026-01-01T00:00:00Z",
 "expires_at": "2026-04-01T00:00:00Z",
 "deprecated_at": "2026-03-01T00:00:00Z"
 }
 ],
 "issuer": "https://api.trigguardai.com",
 "documentation": "https://trigguardai.com/protocol"
}

4. Key Fields

4.1 key_id

PropertyValue
Typestring
Formattg_<environment>_<sequence>
Environmentprod, staging, dev

Examples: tg_prod_01, tg_prod_02, tg_staging_01

4.2 algorithm

PropertyValue
Typestring
Allowed ValuesEd25519

Only Ed25519 is supported in this version of the specification.

4.3 public_key

PropertyValue
Typestring
EncodingBase64 (RFC 4648)
FormatSubjectPublicKeyInfo (SPKI)

4.4 status

StatusMeaningVerification
activeCurrent signing keyAccept signatures
deprecatedPrevious key, still validAccept signatures
revokedCompromised or retiredReject signatures

5. Key Lifecycle

5.1 States

create │ ▼ ┌────────┐ │ active │ └───┬────┘ │ rotate ▼ ┌───────────┐ │deprecated │ └─────┬─────┘ │ expire/revoke ▼ ┌──────────┐ │ revoked │ └──────────┘

5.2 Rotation Schedule

EventTimeline
New key createdQ1, Q2, Q3, Q4
Previous key deprecatedAt new key creation
Deprecated key revoked90 days after deprecation

5.3 Emergency Rotation

In case of key compromise:

  1. New key created immediately
  2. Compromised key revoked (not deprecated)
  3. Alert published to status page
  4. Affected receipts identified

6. Client Implementation

6.1 Key Fetching

Clients MUST:

  1. Request /.well-known/trigguard-keys.json
  2. Parse JSON response
  3. Store keys locally
  4. Handle HTTP errors gracefully

6.2 Caching

Clients SHOULD:

Clients MUST NOT:

6.3 Key Selection

When verifying a receipt:

  1. Extract key_id from receipt
  2. Look up key in cached key set
  3. If not found, refresh key cache
  4. If still not found, verification fails

6.4 Status Validation

Key StatusVerification Action
activeAccept
deprecatedAccept
revokedReject
not foundRefresh cache, then reject if still not found

7. Examples

7.1 Fetching Keys (curl)

curl -s https://api.trigguardai.com/.well-known/trigguard-keys.json | jq

7.2 Key Lookup (Python)

import requests
import json

def fetch_keys():
 response = requests.get(
 "https://api.trigguardai.com/.well-known/trigguard-keys.json",
 timeout=10
 )
 return response.json()

def get_public_key(key_id):
 keys = fetch_keys()
 for key in keys["keys"]:
 if key["key_id"] == key_id and key["status"] != "revoked":
 return key["public_key"]
 return None

7.3 Full Verification (Python)

from nacl.signing import VerifyKey
import base64
import json

def verify_receipt(receipt, keys):
 # Find key
 key_id = receipt["key_id"]
 key_entry = next(
 (k for k in keys["keys"] if k["key_id"] == key_id),
 None
 )
 if not key_entry or key_entry["status"] == "revoked":
 return False
 
 # Decode public key (last 32 bytes of SPKI)
 spki = base64.b64decode(key_entry["public_key"])
 public_key_bytes = spki[-32:]
 
 # Construct payload
 payload = json.dumps({
 "context_hash": receipt["context_hash"],
 "decision": receipt["decision"],
 "receipt_id": receipt["receipt_id"],
 "surface": receipt["surface"],
 "timestamp": receipt["timestamp"]
 }, separators=(',', ':'), sort_keys=True)
 
 # Verify
 signature = bytes.fromhex(receipt["signature"].replace("ed25519:", ""))
 verify_key = VerifyKey(public_key_bytes)
 try:
 verify_key.verify(payload.encode(), signature)
 return True
 except:
 return False

8. Security Considerations

8.1 Transport Security

Clients MUST:

8.2 Key Pinning

Organizations with strict security requirements MAY:

8.3 Offline Operation

For air-gapped environments:

9. Conformance

Implementations MUST:

Implementations SHOULD:

References

← TG-RECEIPT-SCHEMA Back to Protocol TG-EXECUTION-AUTH-01 →

Copyright © 2026 TrigGuard AI Limited. UK Company No. 16597262.