loki-mode

Agent Change Receipt (spec, schema loki.v10.receipt/1)

An Agent Change Receipt is the JSON file a Loki 10 run seals at .loki/runs/<run-id>/receipt.json. It records what an agent changed, what was checked, and what was not proven. Every field below is taken from the Receipt interface at loki-ts/src/engine10/types.ts:143-189; the writer is loki-ts/src/engine10/stages/seal.ts:257.

Fields

Verify the signature

loki verify path/to/receipt.json --pubkey signer.jwk

loki verify recomputes receipt_sha256, checks the Ed25519 signature, and with --pubkey FILE (Ed25519 JWK or PEM) checks against that key only, never the local key set (verify_cmd.ts:121-150). Exit codes: 0 verified, 1 tampered, 2 unchecked, 3 unsigned, 4 run outcome not verified, 66 no runs. loki keys export prints the signer’s public JWK (keys_cmd.ts:1).

DSSE export

loki verify --export-dsse prints a VERIFIED or ALREADY_SATISFIED receipt as an in-toto Statement v1 inside a DSSE envelope signed Ed25519 over the DSSE PAE bytes (loki-ts/src/features/receipt_dsse.ts:1-33). The subject is git+commit:<head_sha> with gitCommit (and gitTree) digests, the predicate type is https://autonomi.dev/loki/receipt/v10, and the predicate is the receipt unchanged. loki verify accepts that envelope file too.

GitHub attestation (opt-in)

The issue-to-pr action (.github/actions/issue-to-pr/action.yml) takes attest: true (default false). It then runs actions/attest-build-provenance with the run’s receipt.json (action output receipt) as the subject, producing a Sigstore-signed DSSE attestation tied to the repository. The calling job needs:

permissions:
  contents: read
  issues: read
  id-token: write
  attestations: write

Those permissions are not read-only. The action’s Rule of Two guidance keeps the agent job read-only, so if you want that boundary, upload receipt.json as an artifact and run actions/attest-build-provenance in a second job that runs no agent. Verify with:

gh attestation verify receipt.json --repo owner/repo

This proves the file’s sha256 was attested by a workflow in that repository. It does not replace loki verify, which checks the receipt’s own hashes and Ed25519 signature; run both.