HATS
An open specification  ·  v0.1 draft  ·  Apache 2.0

Every AI agent action,
under a signed role contract.

HATS — Human-governed Agent Task Specification — is an open format for declaring exactly what role an AI agent is playing, what it’s allowed to do, who approves the rest, and how every decision is audited.

License
Apache 2.0
Schema
JSON Schema 2020-12
Reference engine
Node 20+, zero deps
Maintained by
Pcnaid Inc.
1. What it is

Personas, system prompts, and tool configs all live in different places — and none of them are auditable.

HATS unifies the three things that determine what an AI agent is allowed to do into a single, signable, versioned manifest. The persona governs tone and voice. The hat governs scope and capability. The policy engine, not the model, decides what runs.

It works with the agent runtime you already have — OpenAI, Anthropic, Bedrock, in-house models, MCP, A2A. The reference implementation is published under Apache 2.0 with zero runtime dependencies. The format is free to use, fork, and extend. The trademark on the name HATS is held by Pcnaid Inc. and licensed permissively for ecosystem use.

2. The problem

Three failure modes most teams are quietly living with.

FAILURE 01

Better system prompts

Don’t survive model behavior under load. A persistent enough user instruction will eventually override most system prompts.

FAILURE 02

Per-vendor safety settings

Don’t survive a model swap. Don’t produce a unified audit trail. Don’t map to compliance frameworks.

FAILURE 03

Building it internally

Takes six to twelve months. Misses the compliance framework mappings. Often ends up shipped without an auditor in the room.

3. How it works

A manifest. A runtime. An audit log.

i.

Author a hat

A YAML or JSON manifest declares the role’s mission, in-scope and out-of-scope behavior, requested capabilities, approval rules, and audit obligations. Validated against the HATS JSON Schema.

ii.

Sign and publish

The manifest is signed (Ed25519) and pinned to a specific version. Any change is a new version, reviewable as a diff, signed again before it can ever be served to a runtime.

iii.

Compile the envelope

At session start, the runtime requests a runtime execution envelope for a (user, tenant, hat, persona) tuple. The policy engine returns the full set of effective permissions.

iv.

Enforce every call

Every tool call passes through the policy engine before it executes. Allow, deny, or require approval. The decision is signed and hash-chained into the audit log.

v.

Generate the evidence

Audit events are mappable to SOC 2, ISO/IEC 42001, EU AI Act Article 14, and NIST AI RMF controls. The report is the evidence, not a screenshot of the dashboard.

4. The four primitives

Four things, kept cleanly separate.

Concept What it governs Example
Persona Voice, tone, style, presentation. The how-it-feels layer. Warm, concise, English.
Hat Role contract. Mission, scope, capabilities requested, approvals required. Client intake coordinator v0.1.0.
Capability A specific tool, dataset, or action the hat is requesting authorization for. records.read on customer_invoices.
Effective permissions What the policy engine actually allows after evaluating all rules. The decision that runs.
5. A real manifest

This is what a hat looks like.

Every hat is a versioned YAML or JSON file. Reviewable as a diff. Signed before deployment.

client-intake-coordinator.v0.1.0.yaml HATS v0.1
apiVersion: hats.dev/v0.1
kind: Hat
metadata:
  id: client-intake-coordinator
  version: 0.1.0
  owner: support@pcnaid.com

spec:
  mission: |
    Help new clients complete intake forms and surface unpaid invoices.
    Never create, modify, or delete financial records.

  in_scope:
    - read customer profiles
    - summarize unpaid invoices for a tenant
    - collect contact information for new prospects

  out_of_scope:
    - records.write
    - records.delete
    - cross-tenant queries
    - refund authorization

  capability_requests:
    - id: records.read
      scope: tenant
      tables: [customers, invoices]
    - id: slack.notify
      scope: channel:#intake

  approvals:
    required_for:
      - any action with risk_level >= medium
    approver_role: customer_admin
    timeout_hours: 24

  audit:
    hash_chain: true
    sinks: [customer_s3, otel]
    retention_days: 365
6. Ecosystem

Built to fit what you already use.

PROTOCOL

Model Context Protocol

MCP tools are HATS capability_requests. The mapping is built into the spec.

PROTOCOL

Agent2Agent (A2A)

Delegation packets between agents follow a HATS-compatible authority envelope.

OBSERVABILITY

OpenTelemetry

Audit events emit as OTel log records with GenAI semantic conventions.

CONVENTION

AGENTS.md

Repository-level conventions for declaring agent expectations alongside code.

7. Get started

Three paths. Pick the one that fits your day.

FREE  ·  10 minutes

Read the spec

Skim the JSON Schema, the example manifests, and the four ADRs that explain the design.

Open the spec
FREE  ·  5 minutes

Run the reference engine

A zero-dependency Node 20 service that evaluates policies against the HATS schema locally.

git clone github.com/Pcnaid/hats-reference-engine
View on GitHub