{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentcall.smartycode.com/schemas/agentcall-persona-profile-0.2.schema.json",
  "title": "AgentCall portable persona profile 0.2",
  "description": "A bounded, non-authoritative identity and behavior artifact. It cannot carry credentials, grants, relationship state, executable endpoints, concrete tool bindings, or vendor model identifiers. 0.2 adds an optional worldview claim, an optional depicted-subject block for personas that portray a real identifiable human, and optional per-asset source provenance. Published whole; see /ext/agentcall-persona/0.2 for consumer duties, consent rules, and the threat model.",
  "type": "object",
  "required": [
    "profile",
    "id",
    "version",
    "identity",
    "values",
    "voice",
    "interactionRules",
    "examples",
    "capabilityIntents",
    "provenance"
  ],
  "properties": {
    "profile": {
      "const": "agentcall-persona-profile-0.2"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 256,
      "format": "uri",
      "description": "Stable persona identity, not a runtime endpoint."
    },
    "version": {
      "type": "string",
      "maxLength": 64,
      "pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z.-]+)?$"
    },
    "identity": {
      "type": "object",
      "required": [
        "displayName",
        "summary"
      ],
      "properties": {
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "summary": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "selfDescription": {
          "type": "string",
          "maxLength": 2048
        }
      },
      "additionalProperties": false
    },
    "worldview": {
      "type": "object",
      "required": [
        "tradition",
        "salience"
      ],
      "properties": {
        "tradition": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[a-z0-9][a-z0-9-]*$",
          "description": "Bounded label for the persona's own religious or philosophical tradition. The registry in the extension document is non-normative; any conforming label validates. Secular positions are traditions here: agnostic, atheist, secular."
        },
        "salience": {
          "enum": [
            "none",
            "nominal",
            "observant",
            "devout"
          ],
          "description": "How strongly the tradition shapes this persona's speech and judgement. It never authorizes, restricts, or implies a capability."
        },
        "expression": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "description": "How the tradition may surface in conversation. Behavioral guidance only. Observance that constrains scheduling, diet, travel, or availability is an enrollment and grant concern and never belongs here."
        }
      },
      "additionalProperties": false,
      "description": "Optional. Absent means the profile makes no worldview claim, which is not the same as declaring an absence of belief."
    },
    "subject": {
      "type": "object",
      "required": [
        "depicts"
      ],
      "properties": {
        "depicts": {
          "enum": [
            "fictional",
            "composite",
            "realPerson"
          ],
          "description": "fictional: an invented character. composite: informed by several people but not identifiable as any one of them. realPerson: portrays one identifiable human, living or dead."
        },
        "legalName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Optional even for realPerson. The artifact travels between devices and families; an exporter may withhold the name without weakening the consent record."
        },
        "birthDate": {
          "type": "string",
          "format": "date"
        },
        "deathDate": {
          "type": [
            "string",
            "null"
          ],
          "format": "date",
          "description": "null or absent means the depicted person is living. A living subject combined with a permissive disclosurePolicy is the case importers must surface most loudly."
        },
        "likenessConsent": {
          "$ref": "#/$defs/likenessConsent"
        },
        "disclosurePolicy": {
          "enum": [
            "atCallStart",
            "onFirstTurn",
            "onDirectQuestion",
            "never"
          ],
          "description": "How the runtime discloses that the caller is speaking to a machine portrayal. Absent means onDirectQuestion. never is permitted and importers must present it as a warning before approval."
        }
      },
      "additionalProperties": false,
      "allOf": [
        {
          "if": {
            "properties": {
              "depicts": {
                "const": "realPerson"
              }
            },
            "required": [
              "depicts"
            ]
          },
          "then": {
            "required": [
              "likenessConsent"
            ]
          },
          "else": {
            "not": {
              "anyOf": [
                {
                  "required": [
                    "likenessConsent"
                  ]
                },
                {
                  "required": [
                    "disclosurePolicy"
                  ]
                }
              ]
            }
          }
        }
      ],
      "description": "Optional. Absent means the profile asserts nothing about a depicted person, and an importer must not present it as portraying one."
    },
    "values": {
      "type": "array",
      "minItems": 1,
      "maxItems": 16,
      "items": {
        "$ref": "#/$defs/namedStatement"
      }
    },
    "voice": {
      "type": "object",
      "required": [
        "traits",
        "rules"
      ],
      "properties": {
        "traits": {
          "type": "array",
          "minItems": 1,
          "maxItems": 12,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          }
        },
        "rules": {
          "type": "array",
          "minItems": 1,
          "maxItems": 16,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          }
        },
        "signaturePhrases": {
          "type": "array",
          "maxItems": 8,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        }
      },
      "additionalProperties": false
    },
    "interactionRules": {
      "type": "array",
      "minItems": 1,
      "maxItems": 24,
      "items": {
        "$ref": "#/$defs/namedStatement"
      }
    },
    "examples": {
      "type": "array",
      "minItems": 2,
      "maxItems": 16,
      "items": {
        "type": "object",
        "required": [
          "kind",
          "user",
          "assistant"
        ],
        "properties": {
          "kind": {
            "enum": [
              "good",
              "bad"
            ]
          },
          "user": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "assistant": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "explanation": {
            "type": "string",
            "maxLength": 512
          }
        },
        "additionalProperties": false
      }
    },
    "capabilityIntents": {
      "type": "array",
      "maxItems": 24,
      "items": {
        "type": "object",
        "required": [
          "id",
          "purpose",
          "whenUnavailable"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "whenUnavailable": {
            "enum": [
              "askForCapability",
              "stateUnavailable",
              "defer"
            ]
          }
        },
        "additionalProperties": false
      },
      "description": "Non-authoritative intent names only. Runtimes independently decide whether a capability exists and whether use is authorized."
    },
    "provenance": {
      "type": "object",
      "required": [
        "authors",
        "createdAt",
        "sourceFormat"
      ],
      "properties": {
        "authors": {
          "type": "array",
          "minItems": 1,
          "maxItems": 8,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "sourceFormat": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "sourceVersion": {
          "type": "string",
          "maxLength": 64
        },
        "sourceUrl": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri",
          "description": "Provenance only; never an executable runtime endpoint."
        }
      },
      "additionalProperties": false
    },
    "presentation": {
      "type": "object",
      "properties": {
        "accentColor": {
          "type": "string",
          "pattern": "^#[0-9A-Fa-f]{6}$"
        },
        "assets": {
          "type": "array",
          "maxItems": 8,
          "items": {
            "type": "object",
            "required": [
              "id",
              "kind",
              "mediaType",
              "sha256",
              "relativePath"
            ],
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[a-z0-9][a-z0-9._-]*$"
              },
              "kind": {
                "enum": [
                  "avatar",
                  "voiceSample",
                  "background"
                ]
              },
              "mediaType": {
                "enum": [
                  "image/jpeg",
                  "image/png",
                  "image/webp",
                  "audio/mp4",
                  "audio/mpeg",
                  "audio/wav"
                ]
              },
              "sha256": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              },
              "provenance": {
                "$ref": "#/$defs/assetProvenance"
              },
              "relativePath": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^assets/[a-z0-9][a-z0-9._-]*(?:/[a-z0-9][a-z0-9._-]*)*$"
              }
            },
            "additionalProperties": false,
            "allOf": [
              {
                "if": {
                  "properties": {
                    "kind": {
                      "enum": [
                        "avatar",
                        "background"
                      ]
                    }
                  }
                },
                "then": {
                  "properties": {
                    "mediaType": {
                      "enum": [
                        "image/jpeg",
                        "image/png",
                        "image/webp"
                      ]
                    }
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "voiceSample"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "mediaType": {
                      "enum": [
                        "audio/mp4",
                        "audio/mpeg",
                        "audio/wav"
                      ]
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "additionalProperties": false
    }
  },
  "$defs": {
    "assetProvenance": {
      "type": "object",
      "required": [
        "sourceName",
        "derivation",
        "verificationStatus"
      ],
      "properties": {
        "sourceName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "derivation": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "verificationStatus": {
          "enum": [
            "verified",
            "candidate",
            "localOnly"
          ]
        },
        "sourceUrl": {
          "type": "string",
          "maxLength": 2048,
          "format": "uri"
        },
        "sourceSha256": {
          "type": "string",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$"
        }
      },
      "additionalProperties": false,
      "description": "Optional display-only attribution and source-verification metadata. It never contributes to cognition or grants consent, likeness rights, capabilities, or authority. sourceUrl is never fetched on import or rendered into instructions; sourceSha256 identifies source bytes, not the packaged asset."
    },
    "likenessConsent": {
      "type": "object",
      "required": [
        "recordedAt",
        "revocable"
      ],
      "properties": {
        "recordedAt": {
          "type": "string",
          "format": "date"
        },
        "language": {
          "type": "string",
          "minLength": 2,
          "maxLength": 35,
          "description": "BCP 47 tag of the language the depicted person gave consent in."
        },
        "evidenceSha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "Digest of the consent recording the custodian holds. The recording itself never travels inside this artifact."
        },
        "revocable": {
          "type": "boolean"
        },
        "custodian": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Display-only label for who holds the consent record and can answer whether it still stands. An importer or runtime never dials, fetches, or resolves it."
        }
      },
      "additionalProperties": false,
      "description": "Required whenever depicts is realPerson. Its presence is the control that stops this format from carrying an unconsented portrayal of an identifiable person."
    },
    "namedStatement": {
      "type": "object",
      "required": [
        "id",
        "statement"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*$"
        },
        "statement": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
