Documentation · Schema & format

Readable documents with strict identities.

HATS documents are authored in JSON or YAML and validated against JSON Schema. Version and byte identity matter: a document’s useful meaning depends on knowing exactly which document is in use.

Two versions, deliberately distinct

The published baseline draft uses apiVersion: hats.dev/v0.1 and the AgentRoleProfile manifest kind. The proposed review draft uses apiVersion: hats.dev/v0.2 and a principal-neutral RoleProfile kind.

Do not change a document’s API version in place. A v0.1 reader must not claim v0.2 support by ignoring new fields, and a v0.2 document is not a silent extension of the v0.1 shape.

A proposed v0.2 role profile

This shortened, synthetic example is an illustrative fragment, not a complete schema-valid document. It shows selected role, permission, and audit fields, omits required groups, and does not grant access.

customer-coordinator.fragment.yamlillustrative v0.2 fragment · incomplete
apiVersion: hats.dev/v0.2
kind: RoleProfile
metadata:
id: customer-coordinator
name: Customer Coordinator
version: 1.0.0
status: published
principal_types:
- human
- ai_agent
role:
mission: Continue authorized customer work without losing responsibilities.
in_scope:
- Summarize the assigned customer case.
out_of_scope:
- Other customers and personnel records.
permissions:
requested: [case.read, summary.write]
denied: [payment.send]
audit:
required: true

Schema is necessary, not sufficient

HATS v0.1 schemas use JSON Schema Draft 2020-12. In the v0.2 proposal, schemas and defined document invariants are normative for the Document profile. Validation checks the document’s format and local consistency; it does not fetch remote materials, issue authority, or apply a role to a runtime.

The reference document parser accepts one UTF-8 JSON or YAML object, bounded to 1 MB, 48 nesting levels, and 50,000 nodes. It requires unique string keys and rejects YAML aliases and tags, non-finite numbers, remote schema references, and automatic remote source retrieval. These are reference-tool safety limits, not universal context or enterprise quotas.

Pin references exactly

The v0.2 proposal requires exact version and digest references for roles, assignments, activations, materials, and handoffs. A digest is calculated over the original bytes before parsing or reformatting. JSON and YAML representations with the same apparent values can have different byte digests.

  • Use opaque, stable identifiers in the issuing authority’s namespace.
  • Keep metadata.version distinct from the specification, compiler, adapter, and registry revisions.
  • Do not use latest or version ranges where an exact reference is required.
  • Reject altered bytes under a pinned identity; a cache match alone does not establish issuer trust.
  • Treat a hash as change detection, not authorization, provenance, or proof of truth.

Fields and extensions

Proposed v0.2 profiles are closed by default. Optional extensions use a domain-qualified name. Editors should preserve unknown optional extensions or explicitly report their loss on export. Unknown required extensions block operational preparation until supported.

An extension does not authorize itself and cannot override host policy. New policy language needs separately defined semantics and tested comparison behavior.

Document authoring checklist

Include

  • A bounded mission and responsibilities.
  • In-scope and out-of-scope work.
  • Clear output and escalation expectations.
  • Exact references for required external materials.

Avoid

  • Credentials, customer histories, or personnel dossiers in role text.
  • Unpinned runtime resources or automatic remote loading.
  • A role description that pretends to issue permission.
  • Unresolved changes hidden behind a version label.