{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://adcontextprotocol.org/schemas/latest/trust/v1/trust.json",
  "title": "trust.json",
  "x-status": "experimental",
  "description": "An organization's agent trust record, hosted at /.well-known/trust.json on the organization's own host. Protocol-neutral core: the agents the organization runs (agents[]), the authority it delegates to others (grants[]), and the grants it has accepted from others (acknowledgements[]). Protocol-specific semantics live in namespaced roles and scopes (e.g. 'adcp:sales') and in per-protocol `profiles` objects; this draft defines the `adcp` profile. The organization a record speaks for is the host serving /.well-known/trust.json — never a value inside the document. Versioned independently of any one protocol. The v1 in the path is a namespace, not a stability promise: while x-status is experimental the schema may change in breaking ways. EXPERIMENTAL (x-status: experimental, feature id identity.trust_json). In AdCP 3.3 the experimental Web Bot Auth signing profile reads agents[] (origin and roles) when it evaluates a trust record derived from an agent's origin (docs/building/by-layer/L1/security.mdx, Web Bot Auth identities); grants[] are read when a relying party evaluates acts-for authority, at sync_accounts and on the freshness schedule (docs/building/by-layer/L2/accounts-and-agents.mdx, Grants in trust records; DR-0025). Outside those uses, third parties, crawlers and registries MUST NOT treat a published trust.json as authority. brand.json behavior is unchanged for the RFC 9421 signing profile. The document name and its /.well-known path may change before graduation (the JournalList trust.txt naming outreach is still open), so do not treat the file name as frozen. An agent URL anywhere in this record identifies the agent by its canonical origin (see docs/reference/url-canonicalization.mdx): one agent per origin. See RFC #7809 and specs/agent-identity-3-3.md.",
  "x-added-in": "3.3.0",
  "definitions": {
    "domain": {
      "type": "string",
      "pattern": "^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$",
      "description": "A lowercase DNS host name (internationalized names in punycode)."
    },
    "https_url": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://",
      "description": "An HTTPS URL. Every such URL in this document is untrusted input and, when fetched, a fetch target: the pattern is not an SSRF check. Verifiers MUST apply their own SSRF validation (no userinfo, no private or link-local addresses, no redirects) and enforce body-size and item-count limits."
    },
    "namespaced_token": {
      "type": "string",
      "pattern": "^[a-z0-9-]+:[a-z0-9_.-]+$",
      "description": "A '<namespace>:<name>' token. Each namespace is defined by the protocol that owns it (e.g. 'adcp:' by AdCP). Consumers MUST ignore tokens in namespaces they do not implement."
    },
    "role": {
      "description": "Functional role of an agent. Tokens in the adcp namespace MUST be one of the AdCP agent types.",
      "anyOf": [
        {
          "allOf": [
            {
              "$ref": "#/definitions/namespaced_token"
            },
            {
              "not": {
                "pattern": "^adcp:"
              }
            }
          ]
        },
        {
          "type": "string",
          "enum": [
            "adcp:brand",
            "adcp:rights",
            "adcp:measurement",
            "adcp:governance",
            "adcp:creative",
            "adcp:sales",
            "adcp:buying",
            "adcp:signals"
          ]
        }
      ]
    },
    "scope": {
      "description": "An activity a grant covers. Tokens in the adcp namespace MUST be one of the AdCP scopes (brand.json authorized_operator scopes plus 'adcp:brand_identity'). The bare token '*' covers every scope in every namespace.",
      "anyOf": [
        {
          "type": "string",
          "const": "*"
        },
        {
          "allOf": [
            {
              "$ref": "#/definitions/namespaced_token"
            },
            {
              "not": {
                "pattern": "^adcp:"
              }
            }
          ]
        },
        {
          "type": "string",
          "enum": [
            "adcp:all",
            "adcp:media_buying",
            "adcp:creative_generation",
            "adcp:rights_clearance",
            "adcp:governance",
            "adcp:measurement",
            "adcp:agent_operations",
            "adcp:brand_identity"
          ]
        }
      ]
    },
    "grant_source": {
      "description": "Where the grantor publishes the grant being acknowledged. Tokens in the adcp namespace MUST be a grant source AdCP defines: 'adcp:adagents' (the grantor's /.well-known/adagents.json authorized_agents[]) or 'adcp:trust' (the grantor's /.well-known/trust.json grants[]).",
      "anyOf": [
        {
          "allOf": [
            {
              "$ref": "#/definitions/namespaced_token"
            },
            {
              "not": {
                "pattern": "^adcp:"
              }
            }
          ]
        },
        {
          "type": "string",
          "enum": [
            "adcp:adagents",
            "adcp:trust"
          ]
        }
      ]
    },
    "open_profiles": {
      "type": "object",
      "description": "Per-protocol data keyed by namespace. Consumers MUST ignore namespaces they do not implement. Nothing in profiles is key material or authority for another namespace.",
      "propertyNames": {
        "pattern": "^[a-z0-9-]+$"
      },
      "additionalProperties": {
        "type": "object"
      }
    },
    "agent": {
      "type": "object",
      "description": "An agent this organization runs, identified by the canonical origin of `url`. One agent per origin. Its signing keys are published only in the key directory at that origin (`/.well-known/http-message-signatures-directory`, Web Bot Auth), never in this document.",
      "properties": {
        "url": {
          "$ref": "#/definitions/https_url",
          "description": "Agent endpoint URL, which may carry a path. Its host eTLD+1 MUST equal the eTLD+1 of the organization this record speaks for."
        },
        "roles": {
          "type": "array",
          "description": "What this agent does, as namespaced roles.",
          "items": {
            "$ref": "#/definitions/role"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "protocols": {
          "type": "array",
          "description": "Transport protocols the endpoint speaks. Informational.",
          "items": {
            "type": "string",
            "enum": [
              "mcp",
              "a2a"
            ]
          },
          "uniqueItems": true
        },
        "id": {
          "type": "string",
          "description": "Operator-chosen identifier for logging and routing. Not an identity input."
        },
        "description": {
          "type": "string"
        },
        "countries": {
          "type": "array",
          "description": "ISO 3166-1 alpha-2 country codes where this agent operates. Omit for global.",
          "items": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          }
        },
        "profiles": {
          "allOf": [
            {
              "$ref": "#/definitions/open_profiles"
            },
            {
              "properties": {
                "adcp": {
                  "type": "object",
                  "description": "AdCP profile for an agent entry. Carries the rights-agent fields from brand.json brand_agent_entry.",
                  "properties": {
                    "available_uses": {
                      "type": "array",
                      "items": {
                        "$ref": "https://adcontextprotocol.org/schemas/latest/enums/right-use.json"
                      },
                      "minItems": 1
                    },
                    "right_types": {
                      "type": "array",
                      "items": {
                        "$ref": "https://adcontextprotocol.org/schemas/latest/enums/right-type.json"
                      },
                      "minItems": 1
                    },
                    "onboarding": {
                      "$ref": "https://adcontextprotocol.org/schemas/latest/core/buyer-onboarding-posture.json",
                      "x-added-in": "3.3.0",
                      "description": "For a buying agent (role adcp:buying): how it considers sellers. Overrides the record-level profiles.adcp.onboarding for this agent. trust.json is the only home for the buyer posture."
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          ]
        },
        "last_updated": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "url",
        "roles"
      ],
      "additionalProperties": false
    },
    "granted_agent": {
      "type": "object",
      "description": "An agent a grant is limited to, matched by canonical origin. Grants never carry keys.",
      "properties": {
        "url": {
          "$ref": "#/definitions/https_url"
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    },
    "grant": {
      "type": "object",
      "description": "Authority this organization delegates: 'the grantee (optionally only these agents) may act for us, for these scopes, in these countries, during this window.' Non-transitive: a grantee never extends a grant it received. In the AdCP profile this is the demand-side grant (#6033, DR-0025), evaluated as L2 §Grants in trust records describes (docs/building/by-layer/L2/accounts-and-agents.mdx), at sync_accounts and on the freshness schedule.",
      "properties": {
        "grantee": {
          "$ref": "#/definitions/domain",
          "description": "Registrable domain (eTLD+1) of the organization receiving the grant, under the verifier's bundled Public Suffix List, ICANN and private sections (spec R3a step 1). Its agents resolve to this domain through its own trust.json. A host below a registrable domain (t1.vendor.example) is not one, and neither is a public suffix itself (github.io); alice.github.io is one, because github.io is in the private section. A grant whose grantee is not a registrable domain covers no claim, as L2 §Grants in trust records describes (docs/building/by-layer/L2/accounts-and-agents.mdx). A pattern can't evaluate the Public Suffix List, so verifiers apply the rule. To limit a grant to some of the grantee's agents, list them in agents[]."
        },
        "agents": {
          "type": "array",
          "description": "Optional narrowing to specific agents the grantee runs. When absent, any agent that resolves to the grantee acts under the grant.",
          "items": {
            "$ref": "#/definitions/granted_agent"
          },
          "minItems": 1
        },
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/scope"
          },
          "minItems": 1,
          "uniqueItems": true
        },
        "countries": {
          "type": "array",
          "description": "ISO 3166-1 alpha-2 country codes where the grant applies. Omit for global.",
          "items": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          }
        },
        "valid_from": {
          "type": "string",
          "format": "date-time",
          "description": "Consumers MUST ignore the grant before this time."
        },
        "valid_until": {
          "type": "string",
          "format": "date-time",
          "description": "Consumers MUST treat the grant as inactive at or after this time, on every check."
        },
        "profiles": {
          "allOf": [
            {
              "$ref": "#/definitions/open_profiles"
            },
            {
              "properties": {
                "adcp": {
                  "type": "object",
                  "description": "AdCP profile for a grant.",
                  "properties": {
                    "brands": {
                      "type": "array",
                      "description": "Brand IDs from this organization's brand.json that the grant covers. ['*'] or omitted means every brand the grantor owns. On a grantee's own grant to an intermediary, the IDs are those of the brands in the grant it received.",
                      "items": {
                        "type": "string",
                        "pattern": "^([a-z0-9_]+|\\*)$"
                      },
                      "minItems": 1
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          ]
        },
        "last_updated": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "grantee",
        "scopes"
      ],
      "additionalProperties": false
    },
    "acknowledgement": {
      "type": "object",
      "description": "This organization's acceptance of a grant another organization published: 'we accept the grant `grantor` gave to `agent_url`, as published via `via`.' Terms are read ONLY from the grantor's document and are never restated here. Not needed when the grantor has the same eTLD+1 as the host serving this document. In the AdCP profile with via 'adcp:adagents' this is intended to supersede brand.json properties[] entries whose relationship is direct, delegated, or ad_network in a future release; brand.json is unchanged in 3.3.",
      "properties": {
        "grantor": {
          "$ref": "#/definitions/domain",
          "description": "The organization that published the grant."
        },
        "agent_url": {
          "$ref": "#/definitions/https_url",
          "description": "The granted agent. MUST match an agents[] entry in this same document by canonical origin; an acknowledgement for an agent this organization does not run is invalid and MUST be ignored."
        },
        "via": {
          "$ref": "#/definitions/grant_source",
          "description": "Where the grant is published. For 'adcp:adagents', verifiers resolve https://{grantor}/.well-known/adagents.json (following authoritative_location and managed-network rules) and require an authorized_agents[] entry whose canonical url equals agent_url and that reaches the grantor under the reachable-publisher rule. One acknowledgement covers every entry for that agent URL, whatever its authorization_type. The adagents.json comparison is by canonical URL, as that file defines (see docs/reference/url-canonicalization.mdx), not by origin."
        },
        "profiles": {
          "allOf": [
            {
              "$ref": "#/definitions/open_profiles"
            },
            {
              "properties": {
                "adcp": {
                  "type": "object",
                  "description": "AdCP profile for an acknowledgement.",
                  "properties": {
                    "delegation_type": {
                      "type": "string",
                      "enum": [
                        "direct",
                        "delegated",
                        "ad_network"
                      ],
                      "description": "Optional operator-side assertion of the commercial relationship, for sellers.json-style cross-checking. When present it MUST equal the publisher's delegation_type; a mismatch fails the acknowledgement (state 'mismatch'). Omit to defer entirely to the publisher."
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          ]
        },
        "last_updated": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "grantor",
        "agent_url",
        "via"
      ],
      "additionalProperties": false
    },
    "record_profiles": {
      "allOf": [
        {
          "$ref": "#/definitions/open_profiles"
        },
        {
          "properties": {
            "adcp": {
              "type": "object",
              "description": "AdCP profile for the whole record.",
              "properties": {
                "identity_relying_parties": {
                  "type": "array",
                  "description": "Verified-identity relying parties this organization operates (TMP Identity Match attestation provenance). Intended to move here from brand.json in a future release; brand.json is unchanged in 3.3. Experimental.",
                  "items": {
                    "$ref": "https://adcontextprotocol.org/schemas/latest/core/identity-relying-party.json"
                  }
                },
                "onboarding": {
                  "$ref": "https://adcontextprotocol.org/schemas/latest/core/buyer-onboarding-posture.json",
                  "x-added-in": "3.3.0",
                  "description": "Default buyer onboarding posture for every buying agent this record lists; an agent entry's profiles.adcp.onboarding overrides it."
                }
              },
              "additionalProperties": false
            }
          }
        }
      ]
    }
  },
  "oneOf": [
    {
      "type": "object",
      "title": "Authoritative Location Redirect",
      "description": "Pointer for hosted records (a managed network, a platform, AAO hosting). The organization is still the host that served this pointer. Verifiers follow at most one hop, with zero HTTP redirects, and MUST NOT follow a second pointer. Hosts serving records on an organization's behalf MUST only serve records the organization controls.",
      "properties": {
        "$schema": {
          "type": "string"
        },
        "authoritative_location": {
          "$ref": "#/definitions/https_url",
          "description": "HTTPS URL of the authoritative trust.json for this host."
        },
        "last_updated": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "authoritative_location"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "title": "Trust Record",
      "properties": {
        "$schema": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "last_updated": {
          "type": "string",
          "format": "date-time"
        },
        "agents": {
          "type": "array",
          "description": "Agents this organization runs.",
          "items": {
            "$ref": "#/definitions/agent"
          }
        },
        "grants": {
          "type": "array",
          "description": "Authority this organization delegates to others.",
          "items": {
            "$ref": "#/definitions/grant"
          }
        },
        "exclusive_grants": {
          "type": "boolean",
          "default": false,
          "description": "When true, grants[] is exhaustive: relying parties MUST reject an acts-for claim that no active grant covers, whatever its scope. When false or absent, an uncovered claim is at the relying party's discretion. In the AdCP profile, only the parent organization's record counts. Relying parties ignore exclusive_grants in an intermediary's record, and in a brand's own record when the brand has a separate parent organization."
        },
        "acknowledgements": {
          "type": "array",
          "description": "Inline acknowledgements. Mutually exclusive with acknowledgements_url. Organizations acknowledging more than a few hundred grants SHOULD use acknowledgements_url so the key-resolution fetch stays small.",
          "items": {
            "$ref": "#/definitions/acknowledgement"
          }
        },
        "acknowledgements_url": {
          "$ref": "#/definitions/https_url",
          "description": "Same-host HTTPS URL of a trust-acknowledgements.json sub-document (untrusted input; see https_url). Fetched only by verifiers checking a grant relationship, never on the signature-verification path, under its own size and cache profile."
        },
        "profiles": {
          "$ref": "#/definitions/record_profiles"
        },
        "ext": {
          "type": "object",
          "description": "Vendor extensions, namespaced as ext.{vendor}. The top level is closed so it cannot become a catch-all. Never key material or authority.",
          "additionalProperties": {
            "type": "object"
          }
        }
      },
      "anyOf": [
        {
          "required": [
            "agents"
          ]
        },
        {
          "required": [
            "grants"
          ]
        },
        {
          "required": [
            "acknowledgements"
          ]
        },
        {
          "required": [
            "acknowledgements_url"
          ]
        },
        {
          "required": [
            "profiles"
          ]
        }
      ],
      "not": {
        "required": [
          "acknowledgements",
          "acknowledgements_url"
        ]
      },
      "additionalProperties": false
    }
  ]
}
