Schema Contracts

Schema Contracts are per-tool JSON-Schema files that declare the shape an agent is allowed to send to — and receive from — each tool it calls. The runtime gate validates every call against the matching contract, and the contract-set fingerprint is stamped into the AVAR receipt so anyone with the receipt can prove offline that no drift happened between authoring and execution.

Workflow

  1. aarmos contracts init --from run.avar.json — scaffold contracts from a real receipt.
  2. aarmos contracts watch — proposals for new tools land in .aarmos/contracts/proposals/.
  3. aarmos contracts accept <tool> — promote a proposal into contracts/.
  4. aarmos contracts lint contracts — warn on shape drift, unknown keys, bad mode.
  5. aarmos contracts diff --from run.avar.json — compare promoted contracts against a receipt.
  6. aarmos contracts fingerprint --write — canonical sha256 over the contract set.

Modes

Every contract sets mode to warn or strict. In warn, the gate lets the call proceed and records a drift note on the receipt. In strict, the gate refuses the call before the tool sees it. Modes are set per contract so you can tighten one tool at a time.

Fingerprint binding

fingerprint canonicalises the promoted set (sorted keys, sha256) so two machines with the same contracts always compute the same digest. When the runtime records a receipt, it embeds this fingerprint. The offline avar verify verifier re-computes the fingerprint from the shipped contracts and refuses to validate if they don't match.

What contracts are not

  • Not policy. Policy decides whether a call is allowed; contracts decide whether its shape is well-formed.
  • Not a marketplace — contracts live in your repo, not in a shared registry.
  • No auto-repair. Every promotion is an explicit accept.

See also: ASP spec, AVAR spec.