Implement Enna

Everything you need from this project to implement Enna, in any language, is published on this site under open licenses: the specification, its JSON Schemas and the conformance kit. The TypeScript reference implementation is optional, and comes last.

Who implements Enna

Further Machines started this draft and intends to implement it, in work that maps an organization's systems, coordinates agents and evaluates their results. It does not conform today and claims no conformance. No other implementation is known to this project, and none is listed here.

The reference implementation that comes with the draft claims the Producer, Consumer, Enforcement point and Evaluator classes at the Essential level, with the software-delivery profile, for its own draft contract. By default it applies the Controlled level's record rules (separation of duties, thresholds and quorums, expiring approvals), but it does not meet the Controlled level: its stores live in memory, and it consults its own revocation registry rather than a live status. Section 13.6 of the draft says what that claim requires.

Choose what you claim

A claim names one or more classes, one assurance level and the profiles you implement. Claims are self-declared and published in your own /.well-known/enna.json; there is no certification, no registry and no badge.

ClassYou build
ProducerSomething that creates Enna objects: contracts, manifests, bindings, receipts or evaluations.
ConsumerSomething that reads and validates Enna documents and acts on their meaning.
Enforcement pointThe gate that checks authority before every action and issues receipts.
EvaluatorSomething that judges criteria against evidence and issues evaluation results.

Choose the level by the risk of the work, not by headcount: Essential for one accountable owner and local enforcement, Controlled once one person should not both ask and approve, Assured for regulated work or external auditors. The conformance section lists what each level adds.

What the draft publishes

The specification states the rules, and names the standards it builds on in its references. The schemas, fixtures, vectors and catalogs are its machine-readable parts, published byte for byte as the reference implementation's protocol package holds them.

WhatWhereLicense
The specification, 20 pages /spec/v0.1/, and each page as Markdown, such as /spec/v0.1/overview.md CC BY 4.0
The JSON Schemas, 10 files /spec/v0.1/schemas/, listed on the reference page Apache-2.0
The conformance kit page: what its files hold, and how to run the fixtures /spec/v0.1/conformance-kit/ CC BY 4.0
The conformance fixtures: 22 valid documents and 296 invalid cases /spec/v0.1/fixtures/valid/ and /spec/v0.1/fixtures/invalid/ Apache-2.0
Canonicalization and digest vectors /spec/v0.1/fixtures/vectors/: canonicalization.json and digests.json Apache-2.0
Catalogs of the draft's tables /spec/v0.1/catalogs/: error-codes.json, extensions.json, identifiers.json, lifecycle.json and profiles.json Apache-2.0
The manifest: the media type, SHA-256 and license of every other file under /spec/v0.1/ but the pages /spec/v0.1/manifest.json Apache-2.0
The conformance checklist /spec/v0.1/conformance-checklist/ CC BY 4.0
A discovery document: this site's own, which runs no agents and claims no conformance /.well-known/enna.json Apache-2.0

The specification's Markdown, the schemas, the conformance kit and the manifest are also in a public repository on GitHub, furthermachines/enna, generated from the project's build at each release, with the project's governance, licensing, security and conduct documents. Questions and proposals go in its issues. The License section of the governance page says which license covers what, and links both texts.

Build a Consumer

A Consumer checks a document in the order of section 8.2 and stops at the first step that finds an error. Every object a Producer emits must pass the first four steps below (section 13.1). In any language:

  1. Decode strictly. Read the bytes as UTF-8 JSON. Text that is not well-formed, a byte order mark, and a lone surrogate in a string or a member name are each invalid_json at ""; a member name repeated in one object is one duplicate_member, at the first member whose name repeats an earlier one. Many JSON parsers let some of these through, so check the text itself (section 2.1). The json fixtures test this step, such as json-lone-surrogate.json.
  2. Check the version and the type. The document must be a JSON object, otherwise schema_violation at "". A protocol_version that is a string other than "0.1" is unsupported_version at /protocol_version, and nothing else is reported; a missing or non-string one is a schema_violation. Then type must name one of the five objects, otherwise schema_violation at /type (section 2.14, and steps 2 to 4 of section 8.2). Fixtures: object-unsupported-version.json and object-type-unknown.json.
  3. Validate against the schemas. Any JSON Schema 2020-12 validator will do. Bundle it with the schemas from /spec/v0.1/schemas/: an $id is an identifier, not a location to fetch. Have it report every failing assertion of a step, since a step reports all of its errors together, where most validators stop at the first unless they are told otherwise. Apply the object's own schema, then, once that passes, the schema of a profile it names that you know: section 8.2 stops at the first step that finds an error, so a profile's errors are never reported beside the object schema's. Assert format by the draft's rules, not the validator's: date-time is the timestamp rule of section 2.7, and a uri is RFC 3986's URI with a hierarchical part that is not empty (section 2.14). A $ in a pattern matches only at the very end of a value. Then map the validator's failures to (code, path) pairs as the conformance kit says. Fixtures: object-unknown-member.json, object-timestamp-calendar.json and object-schema-before-profile.json.
  4. Apply the object rules. These are reported together: an unsupported critical extension (unsupported_critical_extension), an identifier repeated within a list (schema_violation), an evaluation's pass or fail without evidence (evidence_missing) or a decided acceptance in its first revision (acceptance_premature), and a receipt time earlier than the one before it (schema_violation). That is step 7 of section 8.2. Fixture: object-rules-reported-together.json.
  5. Check a record. A record, every object of one contract revision in a JSON array, is decoded as one document. Each object must be valid on its own, with its errors under /<index>, and the record must hold exactly one work contract and no object twice. Only then come the thirteen invariants of sections 9.2 to 9.14 and the rule that a record describes the past (9.15), with, at the Controlled and Assured levels, the rules of 9.16, all reported together. The check takes the current time, the level, the separation-of-duties threshold, the live revocation status and the supported extensions as inputs (section 9.1), which a fixture gives in its options. Fixtures: bundle-tenant-mismatch.json and, at the Controlled level, bundle-approval-without-expiry.json.
  6. Report errors. An error response names the kind of failure in error, such as invalid_object or invalid_bundle, and gives details, each with a code from the catalog, a path and a message. The path is an RFC 6901 JSON Pointer in its string form, into the document as checked: under /objects/<index> for an envelope, and under /<index> for a record. The message is for people: it is not stable, and a Consumer must not parse it. Each (code, path) pair should be reported once, sorted by path, then by code, comparing strings by UTF-16 code units, as every fixture's expected list is (section 8.3). The codes are in error-codes.json.

Envelopes and discovery documents follow the same order with their own checks (section 8.2 and section 12.7), and the fixtures hold cases for both.

Compute digests

A digest is sha256: and 64 lowercase hexadecimal digits: the SHA-256 hash of the UTF-8 bytes of a value's canonical form under the JSON Canonicalization Scheme, JCS (RFC 8785). Every number in a member the draft defines is an integer and money is a string, so canonical forms agree on every platform while those integers stay within what a double holds exactly, and a canonicalizer must fail on a lone surrogate (section 2.15).

  • The receipt digest covers the receipt with integrity.digest removed and every other member kept, integrity.previous_digest and integrity.attestation included (section 6.6).
  • The binding digest covers the binding with approvals, revision, revision_author, change_summary and created_at removed. Each approval states it in covers.binding_digest (section 5.3).
  • The chain links the receipts of one contract revision in creation order: the first has no previous_digest, every other names the digest of a receipt created no later than itself, and no two name the same receipt. Anything else is chain_broken (section 9.14).

Test a canonicalizer against the canonicalization vectors, and both digests against the digest vectors, which give the canonical form each digest covers. A digest shows that a record is unchanged only against a digest you already trust: an edited record can be resealed.

Run the conformance fixtures

The fixtures hold 22 valid documents and 296 invalid cases, for objects, envelopes, records and discovery documents, and for decoding. For the kinds you validate, passing means two things (section 13.1, checklist item C-11):

  • Every valid document is accepted. Its check reports no (code, path) pair.
  • Every invalid case is refused. Its check reports at least each of the case's expected (code, path) pairs. Reporting exactly the expected list is a SHOULD.

Every Consumer decodes, so the json cases apply to all. The conformance kit gives the steps: how to build each case's input, which check to run on it with which options, and how to compare what it reports.

Build an Enforcement point or an Evaluator

An Enforcement point is also a Producer of receipts, and an Evaluator a Producer of evaluation results (section 13.1). What each section requires:

  • The gate before every action (section 11.1). Look up the idempotency key first. Then check the contract's state, the record so far, the agent, the window, revocation, the grant, approvals, the tenant boundary, context freshness and limits, and refuse before any side effect, with a deny receipt that gives every failing check's code.
  • Idempotency (section 11.2). The first permitted attempt reserves a key. The same key with the same action, resource and payload is replayed, never performed again; with any of them different, it is refused with idempotency_conflict. Compute the payload digest yourself.
  • Unknown outcomes (section 11.3). Record unknown, never failed, and do not perform the action again, under any key, until its outcome is known, unless the downstream system deduplicates by that key. Then reconcile it with one more receipt under the same key.
  • The lifecycle (section 10). Move a contract only by the transition table, which lifecycle.json gives as data with the A2A and PAP mappings. There is no failed state.
  • Evaluation and acceptance (section 7). Derive the technical result from the required criteria, back every pass and fail with evidence, and record acceptance only as a later revision, after execution, from the owner, an acceptor the contract names, or the owner's delegate.

Check the first profile

The software-delivery profile, software-delivery/0.1, adds the vocabulary of software delivery: seven actions in the repo, ci, preview, production and feature_flag namespaces, the artifacts they leave and the evidence an evaluation may cite, the commit digest rule, and the rule that a production deploy needs a grant of its own and an approval that is not standing (section 14). An authority binding, an execution receipt or an evaluation result that names it in profile must also pass its schema, profiles/software-delivery-0.1.schema.json. The profiles catalog lists it, and fixtures such as receipt-profile-action-namespace.json hold its rules.

A Consumer that does not know a profile still applies the core rules. An Enforcement point refuses every action under a contract or a binding whose profile it does not know, with unsupported_profile (section 2.14). A new profile, for customer operations for example, would get its own schema, its own fixtures with their expected errors, and its own section of the draft.

Assess yourself

The conformance checklist restates every requirement of the draft by class and level, with the section that states it. Use the items for the classes you claim, at your level and every level below it, and record your evidence for each one in your conformance statement. A Consumer that claims conformance must accept every valid conformance fixture and reject every invalid one.

The conformance kit gives evidence to cite: the fixtures a run passed, for item C-11, and the vectors your digests match, for item P-12. The kit changes with the draft at the same addresses, so name the files you ran by their SHA-256 in the manifest.

The TypeScript reference (optional)

The draft comes with a reference implementation in TypeScript: the protocol package (schemas, validators, conventions, invariants, the lifecycle and the mappings), the reference runtime with its two mock adapters, and the command-line tool. They stay in the project's private repository, so they cannot be installed from outside; the public repository holds the specification and the conformance kit only. Nothing above needs them. The examples below run against them when this site is built, and show what they printed; where one checks a document or a record, an implementation in any language should reach the same result.

Validate a complete record

validateBundle checks one contract revision's objects as a closed world: each object on its own, then every invariant and the rules the requested level adds. When an object is malformed it stops at the record's shape and says so. The current time is an argument, so the same record always gives the same answer.

import { readFile } from "node:fs/promises";
import { validateBundle } from "@enna/protocol";

// One closed world: every object of one contract revision, the contract, its context manifest,
// its authority bindings, its receipts in chain order and its evaluation.
const bundle: unknown = JSON.parse(
  await readFile("packages/protocol/fixtures/valid/bundle-brand-approvals.json", "utf8"),
);

// Time is an input, never read from the clock, so the same record gives the same answer.
const result = await validateBundle(bundle, { now: "2026-10-26T17:00:00Z", level: "controlled" });

console.log(result.ok ? "Every invariant holds." : result.errors);
Every invariant holds.
What it printed, run from the private build repository's root when this site was built.

Check an object against the profile

validateObject applies the profile's schema to an object that names it, and PROFILES lists the profiles the package knows. A receipt that follows the profile passes, and the same receipt with an action the profile does not define is refused:

import { readFile } from "node:fs/promises";
import { validateObject } from "@enna/protocol";

const receipt = JSON.parse(
  await readFile("packages/protocol/fixtures/valid/execution-receipt.json", "utf8"),
);
console.log(receipt.profile, validateObject(receipt).ok);

// The software-delivery profile owns the repo, ci, preview, production and feature_flag action
// namespaces, so an action it does not define in them is refused.
const unknownAction = { ...receipt, action: { ...receipt.action, name: "ci.skip" } };
console.log(validateObject(unknownAction).errors.map((e) => `${e.code} at ${e.path}`));
software-delivery/0.1 true
[ 'schema_violation at /action/name' ]
What it printed when this site was built.

Add a runtime adapter

The reference runtime talks to a runtime through one interface, RuntimeAdapter, with a method for each moment of an action: plan, request, refuse, execute, reconcile, redeliver and replay. Relay, an event bus, and Docket, a task queue, implement it differently on purpose. An adapter maps the runtime's own records, such as events or dispatches, and never decides authority. This wrapper records each call:

import { type RuntimeAdapter, relayAdapter } from "@enna/mock-adapters";

/**
 * Wraps a runtime adapter and records every call the reference runtime makes to it. An adapter
 * never decides authority: execute receives the simulated world only after the gate permits, and
 * calls it exactly once.
 */
export function traced(inner: RuntimeAdapter, log: string[]): RuntimeAdapter {
  return {
    ...inner,
    plan(work, at) {
      log.push(`plan ${work.length} actions`);
      return inner.plan(work, at);
    },
    request(work, at) {
      log.push(`request ${work.step}`);
      return inner.request(work, at);
    },
    refuse(work, at, reasons) {
      log.push(`refuse ${work.step}: ${reasons.join(", ")}`);
      return inner.refuse(work, at, reasons);
    },
    execute(work, at, perform) {
      log.push(`execute ${work.step}`);
      return inner.execute(work, at, perform);
    },
    reconcile(work, at, startedAt, perform) {
      log.push(`reconcile ${work.step}`);
      return inner.reconcile(work, at, startedAt, perform);
    },
    redeliver(work, at) {
      log.push(`redeliver ${work.step}`);
      return inner.redeliver(work, at);
    },
    replay(work, at, receiptId) {
      log.push(`replay ${work.step}`);
      return inner.replay(work, at, receiptId);
    },
  };
}

const log: string[] = [];
const relay = traced(relayAdapter({ random: () => 0.5 }), log);
const requested = relay.request(
  {
    step: "branch",
    action: "repo.branch.create",
    resource: {
      type: "repository",
      id: "harborpine/collab-app",
      scope: { organization: "harborpine.example" },
    },
    actor: { kind: "agent", id: "https://agents.harborpine.example/coding" },
    idempotency_key: "brand-branch",
  },
  "2026-10-13T09:00:00Z",
);
console.log(
  log,
  requested.native.map((record) => record.record),
);
[ 'request branch' ] [ 'event', 'event' ]
What it printed when this site was built: the one call, then the kind of each record Relay made for it.

A new runtime in the reference implementation adds its name to RuntimeName and its records to NativeRecord in the mock-adapters package.

Run the command-line tool

enna validates a document, verifies a record and runs a scenario. In the project's private repository it runs on Node 24 from the root, after npm install and npm run generate, which builds the validators from the schemas. The output below is what each command printed when this site was built.

A chain that verifies shows only that the receipts are consistent with each other: an edited record can be resealed. verify --anchor takes a digest you already trust, such as the last receipt's digest you kept when the work was done, and accepts the chain only if it ends there. verify claims no level: it says what the record carries of what a level asks, and what a record cannot show.

$ npx enna validate packages/protocol/fixtures/valid/work-contract.json
valid work_contract: packages/protocol/fixtures/valid/work-contract.json
Exit code 0.
$ npx enna verify examples/bundles/competitor-response.r1.json --anchor sha256:6a79a7295ddf17a8589d9006b16d49c24eefb4e22adefc0161081281bef34ccb
verified: examples/bundles/competitor-response.r1.json (10 objects, checked as of 2026-10-26T17:00:00Z)
receipts in chain order:
  ok rcpt_brand_branch sha256:c074b7edb7bd... succeeded, unsigned
  ok rcpt_brand_commit sha256:f9cf62a8d4f6... succeeded, unsigned
  ok rcpt_brand_ci sha256:5a42a1e68b7f... succeeded, unsigned
  ok rcpt_brand_pull_request sha256:3a1390bec319... succeeded, unsigned
  ok rcpt_brand_preview sha256:6a79a7295ddf... succeeded, unsigned
chain: the receipts are consistent with each other, and the chain ends at the trusted digest sha256:6a79a7295ddf17a8589d9006b16d49c24eefb4e22adefc0161081281bef34ccb
record checks: every invariant holds, and every rule the controlled level adds to a record
level controlled: this level asks a record for separation of duties, expiring approvals, and an evaluator that says when it also acted; the record checks above say whether this record has them. A record cannot show the rest of the level: durable idempotency, a live revocation status, and boundaries enforced before each effect. This is not a conformance claim.
A digest shows a record is unchanged only against a digest you already trust, and an edited record can be resealed. Nothing here shows that an action was authorized or that its producer was honest.
Exit code 0.
$ npx enna verify examples/bundles/competitor-response.tampered.r1.json
not verified: examples/bundles/competitor-response.tampered.r1.json (9 objects, checked as of 2026-10-26T17:00:00Z)
receipts in chain order:
  ok rcpt_brand_branch sha256:c074b7edb7bd... succeeded, unsigned
  ok rcpt_brand_commit sha256:f9cf62a8d4f6... succeeded, unsigned
  x rcpt_brand_ci sha256:5a42a1e68b7f... succeeded, unsigned
  ok rcpt_brand_pull_request sha256:3a1390bec319... succeeded, unsigned
  ok rcpt_brand_preview sha256:6a79a7295ddf... succeeded, unsigned
chain:
  digest_mismatch /2/integrity/digest: the receipt changed after it was sealed
record checks:
  digest_mismatch /5/integrity/digest: the receipt changed after it was sealed
level controlled: this level asks a record for separation of duties, expiring approvals, and an evaluator that says when it also acted; the record checks above say whether this record has them. A record cannot show the rest of the level: durable idempotency, a live revocation status, and boundaries enforced before each effect. This is not a conformance claim.
A digest shows a record is unchanged only against a digest you already trust, and an edited record can be resealed. Nothing here shows that an action was authorized or that its producer was honest.
Exit code 1: not valid.
$ npx enna run competitor-response --control cost_limit=10.00
Simulation: fictional company, mock agents, no real actions
A competitor launches a feature (competitor-response 0.1.0) on relay 0.1.0, seed 1, clock 2026-10-12T08:30:00Z
Event-driven mock: a planner publishes each action to a bus, a subscribed worker claims it under a lease, and outcomes are events.
…
s15 2026-10-13T11:05:03Z gate         Policy gate: Refused: run CI on the commit [deny: limit_exceeded]
    The policy gate refused at 11:05 UTC on 13 October 2026, before any effect, because it would pass a cost or count limit (limit_exceeded, invariant 8). Receipt rcpt_brand_ci records the refusal; the effect log is unchanged.
    relay: action.denied evt_26165a88
    lifecycle: executing
s16 2026-10-13T11:05:03Z block        Orchestrator: Blocked: run CI on the commit
    Nothing ran. The contract is blocked because it would pass a cost or count limit (limit_exceeded, invariant 8).
    lifecycle: blocked

result: blocked. Blocked: the gate refused to run CI on the commit (limit_exceeded), so nothing after it ran.
receipts: 3 (2 permitted, 1 denied, 0 replayed), all unsigned (attestation none); simulated effects: 2
validateBundle wc_brand_approvals revision 1: valid; receipts consistent with each other
The first three lines, then the step the gate refused and the result: with a cost limit of 10.00, the gate refuses the first action whose quoted cost would pass it, and nothing after it runs. The limit is a hard stop: once recorded costs pass it, the gate refuses every further action, whatever it quotes. Exit code 0.