{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://digitalcortex.tech/schemas/agent-manifest/1.0",
  "title": "CORTEX Seal — Agent Manifest 1.0",
  "description": "Declared manifest of an AI agent. This is the EXACT object over which manifestHash = sha256(canonicalJson(manifest)) is computed — the hash a CORTEX Seal credential binds cryptographically. If the agent's scope changes, the hash changes and the credential stops matching. It must never contain personal data of natural persons: the publicly accountable party is the operating organisation and the role, not the person. Specification and schema: CC BY 4.0. The CORTEX Seal name and seal artwork are trade marks of Cosmolabs OÜ and are not licensed with this schema.",
  "type": "object",
  "required": ["name", "role", "operator", "autonomyMax", "skills", "prohibited"],
  "additionalProperties": true,
  "properties": {
    "schema": {
      "type": "string",
      "const": "https://digitalcortex.tech/schemas/agent-manifest/1.0",
      "description": "Schema version. It enters the hash."
    },
    "name": { "type": "string", "minLength": 1, "description": "The agent's public name." },
    "role": { "type": "string", "minLength": 1, "description": "What the agent does, in one line." },
    "mission": { "type": "string", "description": "The agent's objective, in prose." },
    "operator": {
      "type": "object",
      "description": "Organisation answering for the agent's actions within the authorised scope.",
      "required": ["legalName", "jurisdiction"],
      "additionalProperties": true,
      "properties": {
        "legalName": { "type": "string", "minLength": 1 },
        "registryCode": { "type": "string" },
        "jurisdiction": { "type": "string", "description": "ISO 3166-1 alpha-2." }
      }
    },
    "autonomyMax": {
      "type": "string",
      "enum": ["A0", "A1", "A2", "A3", "A4", "A5"],
      "description": "Ceiling, not the usual operating level. A0 observe · A1 analyse · A2 prepare · A3 execute internally · A4 execute with human approval (highest attainable) · A5 forbidden, the class of vetoed actions. A5 is never a valid value here: it belongs in prohibited."
    },
    "skills": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Actions the agent is authorised to perform. None may also appear in prohibited."
    },
    "prohibited": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Expressly forbidden actions. May be empty, but the field is required: declaring what cannot be done is half the value of the manifest."
    },
    "tools": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Tools and scopes, for example gmail:read or crm:write."
    },
    "dataScope": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Data sets the agent may reach."
    },
    "channels": { "type": "array", "items": { "type": "string" } },
    "limits": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "maxRiskWithoutApproval": { "type": "string", "enum": ["LOW", "MEDIUM", "HIGH"] },
        "maxTransactionEur": { "type": ["number", "null"] },
        "humanEscalation": { "type": "string" }
      }
    },
    "bindingsHash": {
      "type": "string",
      "pattern": "^(sha256:)?[0-9a-f]{64}$",
      "description": "Optional. Hash over the agent's linked resources. Adding or removing a linked resource changes this value and therefore changes manifestHash, invalidating the live credential. That is intended: if the agent's hands change, its identity document changes."
    }
  },
  "examples": [
    {
      "schema": "https://digitalcortex.tech/schemas/agent-manifest/1.0",
      "name": "Soporte",
      "role": "First-line customer support",
      "operator": { "legalName": "ACME Robotics S.L.", "registryCode": "B12345678", "jurisdiction": "ES" },
      "autonomyMax": "A2",
      "skills": ["ticket.read", "ticket.reply"],
      "prohibited": ["payment.execute", "data.delete"],
      "tools": ["helpdesk:read", "helpdesk:write"],
      "limits": { "maxRiskWithoutApproval": "LOW", "maxTransactionEur": null }
    }
  ],
  "x-validation-notes": [
    "A skill present in both skills and prohibited is a scope conflict, not a preference: the API answers 400 scope_conflict.",
    "The hash is computed over recursive canonical JSON (keys sorted by code point, undefined-valued keys removed), not over a plain JSON.stringify.",
    "autonomyMax must be consistent with the declared skills: an agent declaring A0 cannot list a skill that writes.",
    "The manifest is public by design: it is what a third party needs in order to know what the agent may and may not do.",
    "No personal data of natural persons. The accountable party published is the organisation and the role."
  ],
  "x-licence": {
    "specification": "CC BY 4.0",
    "attribution": "Agent Manifest 1.0, Cosmolabs OÜ, CC BY 4.0",
    "trademarks": "CORTEX Seal, the CORTEX Seal logo and the seal artwork are trade marks of Cosmolabs OÜ (trade mark application pending) and are expressly excluded from this licence."
  }
}
