Skip to content
home-mandatePublic

About

The Home-Mandate Specification: mandates for AI agents in the household, with schemas and conformance tests

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Home-Mandate – AI is coming home. Decide what it may do.

Home-Mandate Specification

Vendor-neutral specification for mandates of software agents in the household: what an AI agent may do on behalf of a household, with the decisions allow, ask and deny, plus test tools with which any implementation demonstrates its conformance.

Status: released, formats frozen since v0.1.0 (Section 14); the newest version is the latest release. The reference evaluator is the Go code in this repository; the first product that implements the specification is Home-Mandate for Home Assistant.

How a gateway is reached from outside through a relay that anyone may run is the subject of the companion Home-Mandate Relay Specification, which has its own repository and versions and builds on Section 11.7 here.

Contents

Path Contents License
SPEC-v0.md Specification: data model, evaluation rule, vocabulary, AuthZEN mapping CC BY 4.0
vocabulary/v0.json Vocabulary: categories, actions, critical actions (normative) Apache 2.0
schema/vocabulary-v0.schema.json JSON Schema of a vocabulary file, also for extensions Apache 2.0
profiles/ Informative mappings of platforms (Home Assistant, Matter) to the vocabulary Apache 2.0
schema/mandate-v0.schema.json JSON Schema of the mandate (Draft 2020-12) Apache 2.0
schema/audit-v0.schema.json JSON Schema of an audit log entry (Draft 2020-12) Apache 2.0
schema/audit-v1.schema.json JSON Schema of an audit log entry of version 1 (Draft 2020-12) Apache 2.0
data/forbidden-codepoints-v0.json Code points not permitted in text displayed to humans (SPEC-v0 section 3.1 item 8), derived from Unicode 17.0.0 Apache 2.0
ct-sources.md Informative list of Certificate Transparency services (SPEC-v0 section 11.7 item 7) CC BY 4.0
pitfalls.md Informative list of mistakes implementers make with the libraries of their languages, with the cases that catch them CC BY 4.0
data/timezone-names.json Informative list of the time zone names of one release of the IANA database in the form of SPEC-v0 section 4.2 Apache 2.0
data/corrections-v0.json Deviations a verifier keeps accepting in existing audit logs (SPEC-v0 section 14) Apache 2.0
examples/ Example mandates Apache 2.0
conformance/cases-v0.json Conformance cases Apache 2.0
conformance/selection-v0.json Cases for the selection of the mandate among several stored ones Apache 2.0
conformance/succession-v0.json Cases for the succession of mandate versions (rollback protection) Apache 2.0
conformance/signed-v0.json Signed mandates that are accepted or rejected Apache 2.0
conformance/keys/ Test keys of the conformance cases; the private parts are public Apache 2.0
conformance/invalid-v0.json Invalid mandates that MUST be rejected Apache 2.0
conformance/mandates/ Test mandates for edge cases Apache 2.0
conformance/digest-v0.json Digests of mandates (RFC 8785 + SHA-256) Apache 2.0
conformance/audit-v0.json Audit logs with the expected result of the hash chain verification Apache 2.0
conformance/audit-v1.json Audit logs of version 1 with the expected result and the findings of the verification Apache 2.0
conformance/origin-v0.json Public origins that are valid or invalid, and htu values of DPoP proofs that match or not (SPEC-v0 section 11.7) Apache 2.0
conformance/ct-v0.json Certificates in Certificate Transparency logs and whether an alarm is raised, the state of monitoring, and the identity of certificates in DER (SPEC-v0 section 11.7 item 7; the Relay Specification uses them too) Apache 2.0
conformance/schema/ JSON Schemas of the conformance files, so that they can be used without the Go code Apache 2.0
conformance/manifest.json All machine-readable files with SHA-256 and number of cases; make manifest rewrites it Apache 2.0
evaluator/ Reference evaluator as a Go library (github.com/home-mandate/spec/evaluator), standard library only plus a JSON Schema validator Apache 2.0
audit/ Entry digests and hash-chain verification of audit logs (SPEC-v0 section 9), checked against conformance/audit-v0.json and conformance/audit-v1.json Apache 2.0
displaytext/ Check of text displayed to humans against the code point list Apache 2.0
jws/ The part of JSON Web Signature the specification uses: compact serialization, EdDSA and ES256, JWK Sets, and the building blocks that protocols on top of it, such as the Relay Specification, sign and verify their own headers with; standard library only Apache 2.0
ratelimit/ Reference for the rate limit bound of SPEC-v0 section 11.2 Apache 2.0
lint/, cmd/mandate-lint/ Warnings about the risky patterns of a mandate that SPEC-v0 section 12.4 names Apache 2.0
jcs/ JSON Canonicalization Scheme (RFC 8785) for the digests of mandates and audit entries Apache 2.0
ijson/ The I-JSON rules (RFC 7493) that encoding/json does not check: valid UTF-8, no lone surrogates or noncharacters, no duplicate keys, one value, bounded nesting Apache 2.0
rfc3339/ Timestamps read by the grammar of RFC 3339, stricter than time.Parse Apache 2.0
manifest/ Builds, reads and compares conformance/manifest.json; a companion specification describes its own files with a manifest.Layout Apache 2.0
schema/*.go, spec.go Go packages that embed the schemas (schema) and the schemas, examples and conformance cases (root package), respectively Apache 2.0
tools/vectors/ Helper for maintaining the conformance files: the manifest, mandate digests, chaining audit entries, signed test mandates and checkpoints, and the certificates of ct-v0.json Apache 2.0
Makefile Checks: make check (vet, staticcheck, coverage ≥ 95 %, govulncheck), make fuzz, make mutation (≥ 90 %) Apache 2.0
cmd/mandate-conformance/ Test tool: plays the conformance cases against any implementation, over standard input and output or over HTTP (SPEC-v0 section 10) Apache 2.0
cmd/mandate-harness/ The reference code behind the process binding of the test interface, and with -serve-authzen the reference PDP over the HTTP binding; example for implementers Apache 2.0
conformance/DECLARATION.md The obligations no case can test, which an implementation declares how it meets (SPEC-v0 section 8.1) CC BY 4.0

The Go packages that are not under internal/ are public. Their versions are those of the specification: a release without a new major keeps every document's verdict (SPEC-v0 section 14), but while the specification is below v1, a minor release MAY change the Go API of these packages, and its changelog says how. From v1 on they follow semantic versioning.

Testing an implementation

go install github.com/home-mandate/spec/cmd/mandate-conformance@latest
mandate-conformance -report report.json -exec ./your-harness

Your harness reads one JSON request per line and writes one JSON response per line (SPEC-v0 section 10.2); it can be written in any language and needs no network. The report states which conformance classes the implementation passes and for which exact set of cases.

Every release of this repository carries the report of the reference code as conformance-report.json, with build provenance (gh attestation verify conformance-report.json --repo home-mandate/spec). To have your classes shown as passed on home-mandate.org/implementations, attach your report to a release the same way and link it with its SHA-256 in the list.

Licenses

The specification text (SPEC-*.md) is licensed under CC BY 4.0, see LICENSE-docs. Everything else is licensed under Apache 2.0, see LICENSE. The name Home-Mandate and its logo are not covered by these licenses; how others may use them, also for their own implementations: TRADEMARKS.md.

Contributing: CONTRIBUTING.md. Reporting vulnerabilities: SECURITY.md.

Why a separate repository

  • Neutrality: Other vendors are more likely to adopt a standard if it does not live in a competitor's product repository.
  • License: Apache 2.0 with a patent clause for everything that others integrate; the product itself remains AGPL.
  • Versioning: The specification has its own, slower cadence (tags v0.1.0 …). From v0.1.0, the first release without a pre-release suffix, the v0 formats (mandate, audit entry, audit checkpoint) are frozen: a change that would make a valid document invalid or evaluate it differently needs a new major version in type (e.g. …/mandate/v1), and implementations keep reading the older one (Section 14 of the specification). The vocabulary and the conformance schemas are versioned independently.
  • Versions of implementations: Implementations keep their own version numbers; only the major version follows the format (format v0 → 0.x, format v1 → 1.x). Each implementation names the exact specification tag it implements.
  • Credibility of testing: Test cases and the test tool are maintained independently of the product; Home-Mandate for Home Assistant must pass them as well.

Rules for changes

  • Every change to the evaluation rule requires new or modified conformance cases.
  • Bugs in an implementation that stem from an ambiguity in the specification are first clarified here.
  • Since v0.1.0, an incompatible change requires a new major version of the format (Section 14); compatible changes are recorded in the Changelog. Until v0.1.0, incompatible changes were permitted and are recorded there too.

About

The Home-Mandate Specification: mandates for AI agents in the household, with schemas and conformance tests

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages