{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://airenine.com/schema/aire-badge.json",
  "title": "AIRE Agent Certification Badge",
  "description": "Signed role credential for an AI agent, anchored to a human principal's unlocked AIRE Assessment result and minted only on settled payment. Issuer signature is Ed25519 over the canonical JSON payload; by design the payload itself carries no signature field — signature_b64 travels alongside this object in the API envelope (action=badge, action=verify). Issuer public key at https://airenine.com/.well-known/aire-badge-pubkey. Agents never sit the assessment.",
  "type": "object",
  "required": ["v", "badge_id", "issuer", "vertical", "role_type", "agent_instance_id", "agent_pubkey_spki_b64", "principal_result_hash", "settlement_rail", "settlement_receipt_digest", "amount_cents", "issued_at"],
  "properties": {
    "v": { "const": 1, "description": "Badge payload version." },
    "badge_id": { "type": "string", "pattern": "^aire-badge-[A-Za-z0-9_-]+$" },
    "issuer": { "const": "airenine.com" },
    "vertical": { "type": "string", "description": "Industry vertical of the anchoring human result (e.g. construction)." },
    "role_type": { "enum": ["pilot", "architect", "analyst", "operator", "steward", "translator", "builder", "verifier", "pragmatist"], "description": "Handler-attested role from the closed AIRE Nine set." },
    "agent_instance_id": { "type": "string", "maxLength": 128 },
    "agent_pubkey_spki_b64": { "type": "string", "description": "Agent-held Ed25519 public key (SPKI DER, base64). Possession is proven via challenge/verify." },
    "principal_result_hash": { "type": "string", "description": "SHA-256 binding to the human principal's result. No PII." },
    "settlement_rail": { "type": "string" },
    "settlement_receipt_digest": { "type": "string", "description": "Digest of the settled payment receipt baked into the signature: no payment, no badge." },
    "amount_cents": { "type": "integer", "minimum": 0 },
    "issued_at": { "type": "string", "format": "date-time" }
  },
  "additionalProperties": false
}
