Skip to content
Bindings · Loading from a runner6 pages

Loading from a runner

Partly built

The files a runner reads and checkLoadable, the check it makes before loading a binding.

A runner fetches a binding’s manifest, gets the bytes by hash, and asks checkLoadable whether it may load them under its own policy. The runner does not call it yet.

The machine files

Path What it is
/v1/index.json every binding name and version, with its manifest id
/v1/manifests/<id>.json one manifest, immutable
/v1/artifacts/<sha256> the bytes, for artifacts under 5 MB; larger ones are fetched from the pinned source and checked by hash
/v1/claims.json, /v1/claims/<id>.json the stand-in claims
/v1/keys.json the trusted keys
/v1/revocations.json the signed revocation list

Manifests and artifacts are served with immutable cache headers: their names are their hashes.

The call

const m = await fetch(`${REGISTRY}/v1/manifests/${id}.json`).then((r) => r.json());
const bytes = await getArtifactBySha256(m.artifact.sha256);
const r = checkLoadable(m, bytes, { trust, revocations, allowedKinds: ["wasm"], allowedDeterminism: ["pure"] });
if (!r.ok) throw new Error(r.reason);

It returns { ok: true, id, signers } or { ok: false, reason }. For a data binding, pass the other pinned files as companions: each is checked for size and fingerprint, and a missing one is a refusal.

In the policy, allowedKinds names forms (wasm, js, process, native, weights) and allowedDeterminism names the answer classes: pure is “Same answer every time”, may-vary-across-versions is “May change between versions”.

Stand-in claims

A host that runs Clay code asks for the claims it may use with verifyClaims. A claim is allowed only if it is well formed, its binding’s manifest loads, neither is revoked, enough trusted keys signed it, and the entry point is listed in the manifest with the same arity. The engine installs only the allowed set; a run reports which claims it used.