@agent-custody/receipts 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -10
- package/dist/anchor-evm.d.ts +19 -0
- package/dist/anchor-evm.js +49 -0
- package/dist/anchor.d.ts +167 -0
- package/dist/anchor.js +367 -0
- package/dist/check.js +8 -2
- package/dist/cli.js +68 -4
- package/dist/config.d.ts +9 -0
- package/dist/config.js +23 -1
- package/dist/gateway.d.ts +1 -1
- package/dist/gateway.js +23 -11
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2 -0
- package/dist/log-check.d.ts +15 -0
- package/dist/log-check.js +52 -0
- package/dist/receipt.d.ts +2 -0
- package/dist/verify.d.ts +2 -0
- package/dist/verify.js +7 -1
- package/docs/anchoring.md +115 -0
- package/docs/configuration.md +5 -1
- package/docs/mandates.md +82 -0
- package/docs/scitt.md +186 -0
- package/docs/threat-model.md +16 -2
- package/docs/tutorials.md +3 -0
- package/docs/usage.md +19 -1
- package/docs/verification.md +4 -2
- package/package.json +7 -2
- package/vectors/audit.json +27 -27
- package/vectors/canonical.json +5 -5
- package/vectors/receipts.json +1176 -967
package/docs/scitt.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# Aligning with IETF SCITT
|
|
2
|
+
|
|
3
|
+
SCITT (Supply Chain Integrity, Transparency, and Trust) is the IETF's standard for transparency services. An issuer signs a statement, a transparency service registers it in an append-only log and returns a signed proof called a receipt, and a relying party checks both offline. That is the shape of agent-custody too. This page maps our receipt and our log onto SCITT: what lines up exactly, what differs, the options for each difference, what an agent-action profile would contain, and the steps that would bring one to the working group. It is step 3 of [issue #185](https://github.com/svayatta/agent-custody/issues/185). Nothing here changes the format yet. [The receipt specification](../../../site/receipt/v0.2.md) and [the log API](../../../site/reference/log-api.md) are what this page compares against.
|
|
4
|
+
|
|
5
|
+
The documents were read on 26 October 2026, from the IETF datatracker. Three of the drafts that issue #185 names were published as RFCs this summer. Cite the RFCs from now on, not the drafts.
|
|
6
|
+
|
|
7
|
+
| document | revision and status | what we take from it |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| SCITT architecture | [RFC 9943](https://www.rfc-editor.org/rfc/rfc9943), June 2026, Proposed Standard; published from [draft-ietf-scitt-architecture-22](https://datatracker.ietf.org/doc/draft-ietf-scitt-architecture/22/) | the roles, Signed Statements, Registration, Transparent Statements |
|
|
10
|
+
| COSE Receipts (the "Merkle tree proofs" draft) | [RFC 9942](https://www.rfc-editor.org/rfc/rfc9942), June 2026, Proposed Standard; published from [draft-ietf-cose-merkle-tree-proofs-18](https://datatracker.ietf.org/doc/draft-ietf-cose-merkle-tree-proofs/18/) | receipts as COSE_Sign1, the `RFC9162_SHA256` verifiable data structure, inclusion and consistency proofs |
|
|
11
|
+
| COSE Hash Envelope | [RFC 9995](https://www.rfc-editor.org/rfc/rfc9995), July 2026, Proposed Standard; published from [draft-ietf-cose-hash-envelope-10](https://datatracker.ietf.org/doc/draft-ietf-cose-hash-envelope/10/) | signing a digest of a statement, so a log can register it without seeing it |
|
|
12
|
+
| SCITT Reference APIs (SCRAPI) | [draft-ietf-scitt-scrapi-11](https://datatracker.ietf.org/doc/draft-ietf-scitt-scrapi/11/), in the RFC Editor queue, expires 28 December 2026 | the HTTP API: register a statement, resolve a receipt, discover keys |
|
|
13
|
+
| Fully-specified algorithms for JOSE and COSE | [RFC 9864](https://www.rfc-editor.org/rfc/rfc9864), October 2025 | the COSE algorithm `Ed25519` (-19), which replaces the polymorphic `EdDSA` (-8) |
|
|
14
|
+
| SCITT charter | [charter-ietf-scitt-01](https://datatracker.ietf.org/doc/charter-ietf-scitt/) | scope: building blocks for software supply chains |
|
|
15
|
+
|
|
16
|
+
## In short
|
|
17
|
+
|
|
18
|
+
- **Our inclusion proof is already a SCITT inclusion proof.** We hash with RFC 6962 and prove with RFC 9162, sections 2.1.3 and 2.1.4. RFC 9942 registers exactly that structure as `RFC9162_SHA256` (value 1). The proof `{ leafIndex, treeSize, hashes }` carries the same three values as RFC 9942's `[tree_size, leaf_index, inclusion_path]`, in another order and encoding. The one exception is a tree of one leaf, below.
|
|
19
|
+
- **Our signatures and envelopes are not SCITT's.** SCITT requires COSE_Sign1 in CBOR, with an issuer and subject in a protected CWT Claims header. We sign DSSE envelopes over canonical JSON. Ed25519 is not the problem: COSE has it as -19.
|
|
20
|
+
- **Our log is not yet a transparency service.** It authenticates the client, but it does not verify the issuer's signature, keep trust anchors, or publish its registration policy in its own log. RFC 9943 requires all three.
|
|
21
|
+
- **Recommendation.** Issue each receipt in a second encoding, a COSE_Sign1 hash envelope over the same statement bytes. Teach the hosted log SCRAPI and the mandatory registration checks. Then write the agent-action profile as the rules that sit on top: what goes in the protected header, what a registration policy checks, and how the authorization, receipt, and reconciliation statements relate. Keep DSSE as the primary format until the v1.0 decision in step 1 of issue #185.
|
|
22
|
+
- **The field is crowded.** At least five individual drafts already profile SCITT for agent actions, two of them updated in October 2026, and four more extend one of them. The [next steps](#next-steps) start from them rather than from a blank draft.
|
|
23
|
+
|
|
24
|
+
## The roles
|
|
25
|
+
|
|
26
|
+
| SCITT (RFC 9943, section 3) | agent-custody | notes |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| Issuer | the gateway (`issuer.kind: "gateway"`) or the SDK (`issuer.kind: "sdk"`) | SCITT does not separate an issuer that enforces from one that self-reports. A profile must, because it is the first thing our verifier reads. |
|
|
29
|
+
| Signed Statement | the receipt envelope and the authorization statement, both signed by the issuer; also the delegation grant, the human approval, and the upstream attestation, each signed by another party | today the receipt embeds the other envelopes rather than registering them |
|
|
30
|
+
| Statement | the in-toto Statement v1 with `predicateType` `https://agent-custody.dev/receipt/v0.2` | RFC 9943, section 6, lists in-toto among the expected payload formats, so the payload can stay as it is |
|
|
31
|
+
| Subject (`sub`) | the in-toto subject name, `tool-call:<tool>:<receiptId>` | the authorization statement has the same subject as the receipt that follows it, which is what `sub` is for: grouping statements about one artifact |
|
|
32
|
+
| Artifact | one tool call | |
|
|
33
|
+
| Transparency Service | the log: a log file, `agent-custody log`, or the hosted log at log.agent-custody.dev | multi-tenant through `/t/<tenant>/`. RFC 9943, section 5.1, suggests one issuer identity per tenant, which our `log` id already is. |
|
|
34
|
+
| Receipt | the pair of a signed tree head and an inclusion proof, `treeHead` and `inclusion` in the bundle | one COSE_Sign1 in SCITT; two objects for us. See below. |
|
|
35
|
+
| Transparent Statement | the receipt bundle | SCITT puts the receipts in the statement's unprotected header (label 394). We put them beside the envelope. |
|
|
36
|
+
| Registration Policy | the tenant's bearer token, the rate limit, the monthly quota, and `hashOnly` | none of this is published as a statement in the log, and none of it is checked against the statement |
|
|
37
|
+
| Relying Party, Auditor | `verify`, `audit`, `log-check`, the browser verifier, the witness | |
|
|
38
|
+
|
|
39
|
+
## The receipt as a Signed Statement
|
|
40
|
+
|
|
41
|
+
What a COSE encoding of the same receipt would carry, header by header.
|
|
42
|
+
|
|
43
|
+
| COSE_Sign1 part (RFC 9943, figure 3) | value for an agent-custody receipt | where it comes from today |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| tag | 18 (COSE_Sign1) | |
|
|
46
|
+
| `alg` (1) | -19, `Ed25519` ([RFC 9864](https://www.rfc-editor.org/rfc/rfc9864), section 2.2) | Ed25519, implied by the keyid |
|
|
47
|
+
| `kid` (4) | the 32 bytes of our keyid, the SHA-256 of the key's SPKI DER | `signatures[0].keyid`, hex |
|
|
48
|
+
| CWT Claims (15), `iss` (1) | a URI naming the issuer: the gateway operator's, or the SDK host's | **missing.** We identify issuers by key only. A gateway publishes no identity document. |
|
|
49
|
+
| CWT Claims (15), `sub` (2) | the in-toto subject name | `subject[0].name` |
|
|
50
|
+
| CWT Claims (15), `iat` (6) | the receipt's `timestamp` as seconds since the epoch | `predicate.timestamp` |
|
|
51
|
+
| `typ` (16) | `application/scitt-statement+cose`, registered by RFC 9943, section 10.1 | |
|
|
52
|
+
| `payload_hash_alg` (258) | -16, SHA-256 ([RFC 9995](https://www.rfc-editor.org/rfc/rfc9995)) | in a hash envelope only |
|
|
53
|
+
| `payload_preimage_content_type` (259) | `application/vnd.in-toto+json` | the DSSE `payloadType` |
|
|
54
|
+
| `payload_location` (260) | optional: where the receipt file can be fetched by someone allowed to | |
|
|
55
|
+
| issuer kind | `gateway` or `sdk`, in the protected header so that a registration policy can read it | `predicate.issuer.kind`, in the payload. Needs a header label or CWT claim of its own. |
|
|
56
|
+
| payload | the SHA-256 of the canonical statement (hash envelope), or the canonical statement itself | the DSSE `payload` |
|
|
57
|
+
| unprotected header | empty when registered (RFC 9943, section 6.3); receipts (394) once registered | |
|
|
58
|
+
|
|
59
|
+
The statement bytes do not change. The same canonical JSON is signed twice, once under the DSSE pre-authentication encoding and once under the COSE `Sig_structure`. A verifier that reads COSE checks the second signature and then runs our checks on the payload. A verifier that reads DSSE does what it does today.
|
|
60
|
+
|
|
61
|
+
The hash envelope is the variant that matters for us. The hosted log is hash-only, and strict mode requires that: the log sees a leaf hash and never the receipt. With RFC 9995, a transparency service still verifies the issuer's signature, because the signature is over the digest. It learns the headers: `iss`, `sub`, `iat`, and the issuer kind. So **`sub` must not name the tool when the log may not learn it.** A profile should make `sub` the receipt id alone, `urn:uuid:<receiptId>`, and keep the tool name in the payload, where a capture rule governs it. RFC 9942, section 6.2, requires a privacy analysis of every mandatory header.
|
|
62
|
+
|
|
63
|
+
## The log as a transparency service
|
|
64
|
+
|
|
65
|
+
What RFC 9943 requires of a transparency service, and where the log stands.
|
|
66
|
+
|
|
67
|
+
| requirement | RFC 9943 | the log today | to close it |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| produce COSE Receipts | 5.1 | signed DSSE tree heads and JSON inclusion proofs | emit a COSE Receipt of inclusion beside them |
|
|
70
|
+
| verify the issuer's signature at registration | 5.1.1.1, 6.3 | no: `POST /append` checks the bearer token and nothing in the leaf | verify against the tenant's trust anchors; a hash-only leaf cannot be checked, a hash envelope can |
|
|
71
|
+
| keep trust anchors | 5.1.1.1 | no issuer keys are registered with the log | a list of issuer keyids per tenant, managed through the portal |
|
|
72
|
+
| publish the registration policy and trust anchors as Signed Statements in the log | 5.1.1.1 | no | log them as the tenant's first leaves, and log every change |
|
|
73
|
+
| apply the policy most recently committed | 5.1.1 | policy is configuration | follows from the row above |
|
|
74
|
+
| reproducible registration for auditors | 5.1.1.2 | an auditor can rebuild the tree but not re-run a check, because no check is made | follows from the rows above |
|
|
75
|
+
| append-only, non-equivocation, replayability | 5.1.3 | RFC 9162 tree, consistency proofs, checkpoints on a second host, the witness, the anchor | already met; the witness and the anchor go beyond what SCITT asks |
|
|
76
|
+
| unprotected header emptied before inclusion | 6.3 | the leaf is the whole canonical envelope | define the leaf as the COSE_Sign1 with an empty unprotected header |
|
|
77
|
+
| a receipt for every registered statement, on request | 6.3 | inclusion is returned on append; a later proof needs the tenant's token and a client that rebuilds it | `GET /entries/<id>`, SCRAPI section 2.4 |
|
|
78
|
+
| register | [SCRAPI](https://datatracker.ietf.org/doc/draft-ietf-scitt-scrapi/11/) section 2.3, `POST /entries` with `application/cose` | `POST /append` with JSON | add `POST /entries`, returning 201 with the receipt or 202 with a location |
|
|
79
|
+
| key discovery | SCRAPI section 2.1, `/.well-known/scitt-keys`, a COSE Key Set | `/.well-known/agent-custody-log.json`, JSON with PEM keys | serve both, from the same keys: OKP keys, curve Ed25519 (6), kid set |
|
|
80
|
+
| errors | SCRAPI section 2, Concise Problem Details in CBOR | JSON `{ error }` | on the SCRAPI routes only |
|
|
81
|
+
|
|
82
|
+
SCITT needs the leaf to be defined, and RFC 9942 does not define it. Its verifier applies the proof "to the bytes of a candidate entry" and leaves the entry to the transparency service. Our leaf is the canonical JSON of the DSSE envelope. A COSE leaf would be the encoded COSE_Sign1 with an empty unprotected header. [draft-gruszka-scitt-statement-identification-02](https://datatracker.ietf.org/doc/draft-gruszka-scitt-statement-identification/02/) collects the open questions about how a statement is identified, and the profile should answer them for agent actions.
|
|
83
|
+
|
|
84
|
+
## Inclusion proofs and COSE Receipts
|
|
85
|
+
|
|
86
|
+
The two proofs carry the same values.
|
|
87
|
+
|
|
88
|
+
| ours | RFC 9942, section 5.2 |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `inclusion.treeSize` | `tree_size` |
|
|
91
|
+
| `inclusion.leafIndex` | `leaf_index` |
|
|
92
|
+
| `inclusion.hashes`, hex strings | `inclusion_path`, byte strings, same order |
|
|
93
|
+
| the leaf hash, `SHA-256(0x00 ‖ leaf)` | the same; RFC 9162 |
|
|
94
|
+
| `rootHash` in the tree head payload | the receipt's detached payload, the Merkle tree hash at `tree_size`, recomputed by the verifier |
|
|
95
|
+
| the tree head's signature, by the log's key or the issuer's | the receipt's COSE_Sign1 signature |
|
|
96
|
+
| `log` in the tree head | the receipt's `iss` |
|
|
97
|
+
| `timestamp` in the tree head | a CWT claim in the receipt's protected header, such as `iat` |
|
|
98
|
+
|
|
99
|
+
Three differences are worth recording.
|
|
100
|
+
|
|
101
|
+
1. **A tree of one leaf.** RFC 9942's CDDL requires at least one hash in an inclusion path, `inclusion_path: [ + bstr ]`. The first leaf of a log has an empty path, as the bundle example in the specification shows: `{ "leafIndex": 0, "treeSize": 1, "hashes": [] }`. Consistency paths have the same limit, `[ + bstr ]`, and RFC 9162 makes the proof between two equal sizes empty. Our log produces both: the first receipt of every tenant, and the heartbeat checkpoint that re-signs a quiet log at the size it already had. Ask the working group whether `+` was meant to exclude these cases; if not, raise an erratum. Until it is settled, the profile must say what to do: emit no receipt at size one, or relax the CDDL.
|
|
102
|
+
2. **Where the signature sits.** Our tree head is signed once per size and serves every receipt under it. A COSE Receipt signs the root together with its protected header. RFC 9943, section 6, requires `iss` and `sub` in that header, and its example receipt repeats the statement's subject. So a COSE Receipt is signed once per subject. The log signs heads on request, so the cost is a signature per append, which it pays already. But a receipt can no longer be checked by matching its tree head to a published checkpoint byte for byte. It has to be checked by root and size.
|
|
103
|
+
3. **Order of checks.** RFC 9942 verifies the proof first and the signature second, over the root the proof yields. Our verifier checks the tree head's signature and then recomputes the root from the proof. The result is the same. The vectors should include a bundle that fails in each order.
|
|
104
|
+
|
|
105
|
+
## Checkpoints, consistency, and witnesses
|
|
106
|
+
|
|
107
|
+
A checkpoint is a signed tree head at a size. `GET /consistency` returns an unsigned RFC 9162 consistency proof between two sizes. RFC 9942, section 5.3, defines a **Receipt of Consistency**: a COSE_Sign1 whose detached payload is the newer root, with the proof in the unprotected header. A checkpoint together with the proof from the previous checkpoint is that receipt. The log can serve it as a second form of `GET /checkpoints` and lose nothing.
|
|
108
|
+
|
|
109
|
+
A witness countersigns by adding its signature to the checkpoint's DSSE envelope, which DSSE allows. COSE_Sign1 has one signer. The nearest SCITT construction is a second receipt from a second service, which RFC 9943, section 5, allows. A witness does not register statements, though, so it is not a transparency service. Two options:
|
|
110
|
+
- the witness issues its own Receipt of Consistency over the checkpoint it checked, and a verifier that requires the witness requires that receipt;
|
|
111
|
+
- the profile defines the countersigned checkpoint as a COSE_Sign (several signers) rather than a COSE_Sign1.
|
|
112
|
+
|
|
113
|
+
The first needs no new structure. Prefer it.
|
|
114
|
+
|
|
115
|
+
[draft-mih-scitt-checkpointed-local-log-02](https://datatracker.ietf.org/doc/draft-mih-scitt-checkpointed-local-log/02/) carries a producer's own checkpoints as Signed Statements and registers them with independent transparency services. That fits an SDK that keeps a local log file. It uses a Merkle Mountain Range ([draft-bryce-cose-receipts-mmr-profile-03](https://datatracker.ietf.org/doc/draft-bryce-cose-receipts-mmr-profile/03/)) rather than RFC 9162, so it is a pattern to borrow, not a format to adopt.
|
|
116
|
+
|
|
117
|
+
## Chain anchoring
|
|
118
|
+
|
|
119
|
+
SCITT has nothing to say about anchoring. RFC 9943 leaves the security of each data structure to its own specification (section 5.1.3) and allows adjacent services beside a transparency service (section 5.1.4). The anchor is one. It commits checkpoints to an EVM chain as an RFC 9162 tree of checkpoint leaves; [anchoring](anchoring.md) is the guide. [draft-fassbender-scitt-time-anchor-08](https://datatracker.ietf.org/doc/draft-fassbender-scitt-time-anchor/08/), an independent-stream draft, does the same for Bitcoin through OpenTimestamps and also needs no change to SCITT.
|
|
120
|
+
|
|
121
|
+
Options:
|
|
122
|
+
- **nothing**: anchoring stays an adjacent service, described in an informative appendix of the profile;
|
|
123
|
+
- **an anchor record as a Signed Statement**, issued by the anchor's key and registered like any other statement, so that a relying party can find the anchor through the log;
|
|
124
|
+
- **a new verifiable data structure** in RFC 9942's registry, for "an RFC 9162 tree whose root is in a transaction". This would need a profile of its own and expert review, and it buys nothing that the first option lacks.
|
|
125
|
+
|
|
126
|
+
Choose the first option now. Consider the second once anyone outside agent-custody asks for it.
|
|
127
|
+
|
|
128
|
+
## What differs, and the options for each
|
|
129
|
+
|
|
130
|
+
| difference | an alternative COSE encoding | a profile | nothing | recommendation |
|
|
131
|
+
| --- | --- | --- | --- | --- |
|
|
132
|
+
| DSSE, not COSE_Sign1 | issue each receipt twice: DSSE as now, plus a COSE_Sign1 hash envelope over the same statement bytes | a profile that admits a DSSE statement as the payload of a COSE_Sign1 (signed twice, nested) or as a "bare" presentation beside the enveloped one, as [draft-noa-scitt-ai-agent-receipt-01](https://datatracker.ietf.org/doc/draft-noa-scitt-ai-agent-receipt/01/) does | stay DSSE-only and claim alignment with the data structure alone | **encoding.** RFC 9943 accepts only COSE_Sign1 as a Signed Statement, so the DSSE form cannot be registered with another vendor's service. One statement and two signatures is the smallest change. |
|
|
133
|
+
| JSON, not CBOR | the statement stays canonical JSON; only the envelope is CBOR | | | nothing to decide: a COSE payload can be any bytes, and the preimage content type names them |
|
|
134
|
+
| Ed25519 | `alg` -19 | the profile makes -19 mandatory to implement and rejects -8 | | **encoding**, -19. One key signing under two formats is a reuse that RFC 9943, section 9.4, asks issuers to avoid. The two signed structures cannot be mistaken for each other (DSSE's begins `DSSEv1`, COSE's is a CBOR array that begins `Signature1`), so the profile should argue this in its security considerations rather than require a second key. |
|
|
135
|
+
| keyid, not a named issuer | `kid` from our keyid | the profile requires `iss` as a URI and says how the key behind it is found | | **profile.** It needs an issuer key document for gateways like the log's, which we do not have. |
|
|
136
|
+
| our tree heads | a COSE Receipt of inclusion beside the DSSE tree head | | | **encoding.** The values are the same, and the size-one case goes to the working group. |
|
|
137
|
+
| checkpoints and consistency proofs | Receipts of Consistency | | | **encoding** |
|
|
138
|
+
| witness countersignatures | a witness Receipt of Consistency | | keep DSSE countersignatures | **encoding**, and keep DSSE countersignatures alongside |
|
|
139
|
+
| chain anchoring | | an informative appendix | | **nothing** normative |
|
|
140
|
+
| a log that does not check the issuer | | the profile's registration policy | | **implement** the mandatory checks; it is a requirement of RFC 9943, not an option |
|
|
141
|
+
| a hash-only log | the hash envelope | the profile requires the hash envelope for logs the issuer does not run | | **profile** |
|
|
142
|
+
|
|
143
|
+
## An agent-action profile
|
|
144
|
+
|
|
145
|
+
What an agent-custody profile of SCITT would contain, section by section.
|
|
146
|
+
|
|
147
|
+
1. **Scope and roles.** One tool call is one artifact. Issuers are enforcing gateways and self-reporting SDKs. The transparency service is a log the issuer may or may not run. Relying parties are auditors who hold public keys only.
|
|
148
|
+
2. **Signed Statements.** COSE_Sign1, tagged. `alg` -19 mandatory to implement. `kid` is the SHA-256 of the SPKI. CWT claims `iss` and `sub`, with `sub` as `urn:uuid:<receiptId>`, and `iat`. `typ`. The issuer kind is a protected header. The payload is a hash envelope over an in-toto Statement v1, or the statement itself where the service may read it.
|
|
149
|
+
3. **Statement types**, one `predicateType` each, related by `sub`: the authorization (before the call), the receipt (after it), the reconciliation (the provider's terminal outcome, naming the original), the delegation grant (signed by the principal), the human approval (signed by approvers), and the upstream attestation (signed by the tool). For each, which fields a verifier reads, with their provenance labels: `attested`, `observed`, and `claimed`. The labels are what makes the evidence honest, and no other draft has them in this form.
|
|
150
|
+
4. **Registration policy.** Issuer keyids per tenant as trust anchors, published in the log. Required protected headers. An optional strict claim. The rule that a receipt referring to an authorization is refused unless that authorization was registered earlier in the same log. Today our verifier checks the order; with this rule, the service enforces it.
|
|
151
|
+
5. **Receipts.** `RFC9162_SHA256`, inclusion mandatory and consistency recommended. How the first leaf of a log is handled. Receipts of Consistency for checkpoints, and for witnesses.
|
|
152
|
+
6. **Verification.** The verification steps of the specification, in order, mapped onto COSE verification and payload checks. How a verifier reports a check passed "as committed" when a capture rule withholds a value.
|
|
153
|
+
7. **Privacy considerations.** Capture rules and salted commitments. What the headers reveal to the service (RFC 9942, section 6.2). What the tree size reveals: a per-tenant log leaks the tenant's call count (RFC 9942, section 6.1).
|
|
154
|
+
8. **Security considerations.** An SDK receipt is self-reported. One key under two formats. What SCITT does not give: completeness. An issuer can leave a call unregistered (RFC 9943, section 9.3); strict mode and provider-side completeness ([issue #178](https://github.com/svayatta/agent-custody/issues/178)) are our answers. The threat model in [threat-model.md](threat-model.md).
|
|
155
|
+
9. **Appendices.** Anchoring, informative. Conformance vectors in both encodings. The mapping to DSSE for existing receipts.
|
|
156
|
+
|
|
157
|
+
## Other agent-action drafts
|
|
158
|
+
|
|
159
|
+
None of these is a working group document. All are individual submissions, and the charter scopes the group to software supply chains. Whether the group takes on any agent profile is a charter question for the chairs, not one a better draft answers. Each row is from the draft's abstract, and from its text where noted.
|
|
160
|
+
|
|
161
|
+
| draft | what it records | overlap with ours |
|
|
162
|
+
| --- | --- | --- |
|
|
163
|
+
| [draft-noa-scitt-ai-agent-receipt-01](https://datatracker.ietf.org/doc/draft-noa-scitt-ai-agent-receipt/01/), August 2026 | a signed action receipt over canonical JSON, hash-chained, bare or in a COSE_Sign1 | closest in encoding: its text requires `alg` -19 and rejects -8, uses JCS ([RFC 8785](https://www.rfc-editor.org/rfc/rfc8785)), and defines bare and enveloped forms |
|
|
164
|
+
| [draft-mih-scitt-agent-action-capsule-05](https://datatracker.ietf.org/doc/draft-mih-scitt-agent-action-capsule/05/), September 2026, with [selective disclosure](https://datatracker.ietf.org/doc/draft-mih-scitt-agent-action-capsule-sel-disc/00/), [provenance binding](https://datatracker.ietf.org/doc/draft-rampalli-scitt-capsule-provenance-binding/00/), and two companion drafts | one record per action on every verdict, refusals included; an attempt is distinct from an observed result | our `denied` and `withheld` receipts, `execution.upstream`, and `consumed` |
|
|
165
|
+
| [draft-munoz-scitt-permit-profile-01](https://datatracker.ietf.org/doc/draft-munoz-scitt-permit-profile/01/), July 2026 | a pre-execution authorization bound to the canonical request, paired with a closure record | our authorization statement and precommit |
|
|
166
|
+
| [draft-emirdag-scitt-ai-agent-execution-01](https://datatracker.ietf.org/doc/draft-emirdag-scitt-ai-agent-execution/01/), October 2026 | operator as issuer, an independent evidence custodian as service, sequence completeness, redaction receipts, compliance mappings | our roles, and [compliance.md](compliance.md) |
|
|
167
|
+
| [draft-thaha-scitt-agent-execution-evidence-00](https://datatracker.ietf.org/doc/draft-thaha-scitt-agent-execution-evidence/00/), October 2026 | agent identity and capabilities bound to a hash-chained record of calls; admission records across operators | the delegation grant, and receipts for agent-to-agent calls |
|
|
168
|
+
| [draft-jangra-scitt-digest-evidence-00](https://datatracker.ietf.org/doc/draft-jangra-scitt-digest-evidence/00/), October 2026 | an RFC 9162 log of salted digests only, with completeness chains, selective disclosure, and spot checks | our hash-only log and capture rules |
|
|
169
|
+
| [draft-kamimura-scitt-refusal-events-04](https://datatracker.ietf.org/doc/draft-kamimura-scitt-refusal-events/04/), October 2026 | a claim set for AI content refusals | narrower: content refusals, not tool calls |
|
|
170
|
+
| [draft-mih-sokolov-scitt-payload-binding-06](https://datatracker.ietf.org/doc/draft-mih-sokolov-scitt-payload-binding/06/), October 2026 | declared canonicalization, a derived identifier, and digest references, using RFC 9995 | how our canonical JSON and digests would be declared |
|
|
171
|
+
|
|
172
|
+
## Next steps
|
|
173
|
+
|
|
174
|
+
Nothing has been posted to the IETF. Each step below is for the maintainers to decide, and the first four need no one outside the project.
|
|
175
|
+
|
|
176
|
+
1. **Read the closest drafts in full**: the noa, capsule, and permit drafts first. For each, record what it requires that we cannot meet and what we have that it lacks, in a reply on issue #185. Then decide whether to co-author with one of them or write our own. Our contribution is distinct in three places: provenance labels, an authorization that the service orders before its receipt, and a bridge from DSSE and in-toto. A sixth profile that overlaps the other five on everything else will not be adopted.
|
|
177
|
+
2. **Build the COSE encoding in code before writing a draft.** Add a COSE_Sign1 hash envelope beside the DSSE envelope in `src/receipt.ts`, verify it in `src/verify.ts` and the browser verifier, and add vectors in both encodings. Then add `POST /entries`, `GET /entries/<id>`, and `/.well-known/scitt-keys` to the log, with issuer verification against per-tenant trust anchors. A profile that has running code and vectors gets read.
|
|
178
|
+
3. **Settle the open points in the v1.0 specification** (step 1 of issue #185): `sub` as the receipt id alone; an `iss` URI and the gateway's identity document; the issuer-kind header; the leaf of a COSE entry; what happens at tree size one.
|
|
179
|
+
4. **Interoperate.** Register a receipt with an existing SCITT service that implements SCRAPI, and verify its receipt with our verifier. Verify one of our COSE receipts with someone else's SCITT verifier. Record which implementations were used.
|
|
180
|
+
5. **Ask before submitting.** On the scitt@ietf.org list: whether the inclusion-path CDDL in RFC 9942 was meant to exclude a tree of one leaf; and whether the chairs see agent-action profiles inside the charter, and if not, where they would go. The list's archive is public, so a message there is publication. It needs the maintainers' sign-off and wording.
|
|
181
|
+
6. **The individual draft.** `draft-<author>-scitt-agent-custody-profile-00` (the name is an assumption), in kramdown-rfc, with the sections above and the vectors as an appendix. The Internet-Draft cutoff for IETF 127 is 2 November 2026. That is too soon for steps 1 to 4. Aim for IETF 128 in Kuala Lumpur, which starts 6 March 2027, and for discussion on the list before then.
|
|
182
|
+
7. **The hackathon.** IETF 127's hackathon is on 14 and 15 November 2026 in San Francisco. Its wiki already lists a SCITT time-anchor project. The SCITT session is on Wednesday 18 November, from 16:30 to 17:30 Pacific time. Attending, remotely or in person, is worth it to meet the authors of the drafts above. A project of our own fits IETF 128's hackathon, once step 4 has a result.
|
|
183
|
+
|
|
184
|
+
## Not done here
|
|
185
|
+
|
|
186
|
+
This page changes no code and no format. It does not decide between DSSE and COSE for v1.0; that is step 1 of issue #185. It claims no conformance to SCITT, and none should be claimed until step 2 is built and step 4 has been run against an implementation we did not write.
|
package/docs/threat-model.md
CHANGED
|
@@ -51,7 +51,7 @@ Each row names the attacker, the move, the defence, and whether the defence is a
|
|
|
51
51
|
| attack | defence | kind |
|
|
52
52
|
| --- | --- | --- |
|
|
53
53
|
| Rewrite a receipt after the fact | The receipt's envelope is signed by the gateway key, which the operator holds, so the signature alone does not stop this. What stops it is the log: the leaf hash of the original envelope is in a tree whose head the log signed, and a rewritten receipt has a different hash with no inclusion proof. | evidence, with a remote log; deployment, with a local log the operator can rewrite |
|
|
54
|
-
| Drop a receipt | The log's tree only grows, and consistency proofs between any two heads show nothing was removed. A receipt the operator never logged never existed as evidence, which is the point of `precommit` for consequential calls: the authorization leaf goes in before the action. | evidence for logged receipts; withheld calls for pre-committed tools |
|
|
54
|
+
| Drop a receipt | The log's tree only grows, and consistency proofs between any two heads show nothing was removed. A receipt the operator never logged never existed as evidence, which is the point of `precommit` for consequential calls: the authorization leaf goes in before the action. [Strict mode](usage.md#strict-mode) does that for every call, with a remote hash-only log and no outbox, and its receipts say so, so a verifier can require it; a modified gateway can still claim strict mode. | evidence for logged receipts; withheld calls for pre-committed tools, and for every call under strict mode |
|
|
55
55
|
| Forge a receipt for an action that never happened | Nothing in the log stops the operator logging a fabricated receipt; the log commits to existence, not truth. What limits it: the upstream's signature over the result when the upstream signs, provider attestations where the provider delivers them, and the principal's signature on the grant. A forged receipt for a signing upstream fails its `upstream` checks. | evidence, where the upstream signs; otherwise the operator's word |
|
|
56
56
|
| Replace the policy and claim a different one decided | The receipt carries the sha256 of the policy text; a verifier with the policy file can check it, and a policy change is a different digest in every later receipt. | evidence |
|
|
57
57
|
| Produce a second, cleaner history | With a remote log, both histories would need heads signed by the log's key at the same size with different roots; the checkpoints host and the witness make that detectable. With a local log, a copy taken earlier by someone else is the only defence. | evidence with a witnessed remote log |
|
|
@@ -76,7 +76,7 @@ Each row names the attacker, the move, the defence, and whether the defence is a
|
|
|
76
76
|
| attack | defence | kind |
|
|
77
77
|
| --- | --- | --- |
|
|
78
78
|
| Read receipt contents | The hosted log runs with `--hash-only` and refuses a full leaf at append, so no receipt reaches the log process even from a misconfigured gateway or a stolen token; the tenant's `hashOnly` setting keeps the receipt from ever leaving their machine. A log an operator runs for themselves may accept full leaves. | evidence: the server refuses; deployment on the tenant's side |
|
|
79
|
-
| Rewrite a tenant's tree | Every head is signed and published as a checkpoint on a second host; a rewrite means two signed heads at one size with different roots, or a later head that does not extend an earlier one. Anyone holding an earlier head detects it with `audit`; the monitor does it every ten minutes; the witness countersigns only heads that extend the last it signed. | evidence, given a witness or an earlier head held elsewhere |
|
|
79
|
+
| Rewrite a tenant's tree | Every head is signed and published as a checkpoint on a second host; a rewrite means two signed heads at one size with different roots, or a later head that does not extend an earlier one. Anyone holding an earlier head detects it with `audit`; the monitor does it every ten minutes; the witness countersigns only heads that extend the last it signed; the anchor commits each checkpoint to Ethereum, and `log-check --anchor-url` fails a head that does not extend the anchored one. | evidence, given a witness or an earlier head held elsewhere |
|
|
80
80
|
| Show different histories to different verifiers | Same: checkpoints are public and the witness sees one history. Without a witness, two verifiers who compare heads detect it, and nobody else does. | evidence with a witness; otherwise detection needs comparison |
|
|
81
81
|
| Mint a token for a tenant and append noise | Appends are hashes with no content; the tenant's export and usage show leaves and live tokens they did not make, and the audit trail, which the tenant's export carries, records who minted what and from where. | deployment |
|
|
82
82
|
| Sign with a key not in the key document | Verifiers pin by keyid from the published document; a head signed by an unpublished key fails. Retired keys stay published so old heads keep verifying, and a rotation is announced with its date. | evidence |
|
|
@@ -90,6 +90,20 @@ Each row names the attacker, the move, the defence, and whether the defence is a
|
|
|
90
90
|
| Refuse a true history | An alarm with no consistency failure behind it is a false alarm; the log's consistency proof settles it in public. Verifiers who require a witness signature see a gap, which is the correct outcome for a disputed period. | evidence |
|
|
91
91
|
| Collude with the log operator | Two independent operators are the assumption. A witness on the log operator's machine proves nothing, and the deployment guide says so. | assumption |
|
|
92
92
|
|
|
93
|
+
### By the anchor
|
|
94
|
+
|
|
95
|
+
| attack | defence | kind |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| Publish a record for a checkpoint it never anchored | The record is checked against the chain: the transaction must come from the pinned address to itself, succeed, and carry exactly the root the record's inclusion proof leads to, from a checkpoint the log's keys signed. | evidence |
|
|
98
|
+
| Anchor a rewritten history | The anchor proves each checkpoint extends the last one it anchored, and refuses with an alarm otherwise. An anchor that skipped the proof would still leave two anchored roots that cannot both extend the earlier one, in public. | evidence |
|
|
99
|
+
| Serve an older, genuine record as the current one | Every anchor transaction covers every watched log, and the verifier requires the record's transaction to be the newest from the address, by the address's transaction count on the chain. | evidence |
|
|
100
|
+
| Serve another tenant's record for this log | Tenant logs share the log's keys and the anchor's address, so the verifier pins each log's id; the anchored checkpoint and the current head must both name it. | evidence, given the pinned id |
|
|
101
|
+
| Stop anchoring | A head ahead of its newest anchor fails once that anchor's block, timed by the chain, is older than `--max-anchor-lag`. Between anchors, a rewrite is caught only once a later anchor or another holder of a head disagrees. | detection |
|
|
102
|
+
| Count an anchor a reorg removed | The anchor holds a transaction until its block is finalized, writes its records again if a reorg moves it, and sends the same root again if a reorg drops it. A verifier reports whether the record's block is finalized. | evidence once finalized |
|
|
103
|
+
| Leak its key | Someone else can spend the funds and post transactions from the address. A root that no checkpoint leads to proves nothing, so a leaked key cannot make a false record check out. | evidence |
|
|
104
|
+
| Anchor on a chain a few parties control | The installation chooses the chain, and the record names it. On an L2 a sequencer can delay or refuse an anchor, which shows as an anchor that does not keep up. A finalized block is as hard to rewrite as that chain makes it, which differs by chain (`docs/anchoring.md` lists what each rests on). | assumption: the chain's own guarantees |
|
|
105
|
+
| Lie through a JSON-RPC endpoint | Give `log-check` several endpoints from different providers: they must agree on the transaction and its block, and a block counts as finalized only when every endpoint says so. | assumption: not every endpoint lies the same way |
|
|
106
|
+
|
|
93
107
|
### On the network
|
|
94
108
|
|
|
95
109
|
| attack | defence | kind |
|
package/docs/tutorials.md
CHANGED
|
@@ -42,6 +42,8 @@ Suggested reading order is the numbering. Output lands in `examples-out/`, which
|
|
|
42
42
|
| 30 | payload-bound human approvals | [30-payload-bound-approvals.ts](../examples/30-payload-bound-approvals.ts) | two people sign the exact refund; missing approval, one signer, changed amount or beneficiary, extra arguments, and expiry are refused; the approved call executes once, its replay is refused, and every receipt verifies with separately trusted approval keys | `src/approval.ts`, `src/gateway.ts`, `src/verify.ts` |
|
|
43
43
|
| 31 | enterprise sign-in and roles | [31-enterprise-sign-in.ts](../examples/31-enterprise-sign-in.ts) | an enterprise tenant signs in through its own identity provider, a stand-in OIDC IdP: the operator sets single sign-on, a member joins as readonly and is refused a policy write, an owner promotes them to reviewer, and enforcement turns password sign-in off | `src/sso.ts`, `src/portal.ts` |
|
|
44
44
|
| 32 | the gateway console | [32-console.ts](../examples/32-console.ts) | a gateway that has made two receipts, and its operator's console: a token on every route, the receipts with a verdict each, a stricter policy replayed against the recorded calls before it is saved, the save recorded with the old version kept and a stale edit refused, and a grant inspected, revoked, and then refused by the gateway | `src/console.ts`, `src/console-page.ts` |
|
|
45
|
+
| 33 | anchoring the log on a chain | [33-chain-anchor.ts](../examples/33-chain-anchor.ts) | a log publishes a checkpoint, the anchor commits it to a stand-in chain in one transaction, and `log-check` passes against the chain; the operator swaps in a rewritten log under the same key and log id, and `log-check` fails it from the chain alone |
|
|
46
|
+
| 34 | strict mode | [34-strict-mode.ts](../examples/34-strict-mode.ts) | `check` lists what strict mode would refuse; a local log and a log that is not hash-only are refused at startup; behind a hash-only log with a pinned key, a read is precommitted and its receipt says `issuer.strict`; `requireStrict` accepts it and refuses an ordinary receipt; with the log down the call is not forwarded and the outbox stays empty | `src/config.ts`, `src/gateway.ts`, `src/check.ts`, `src/verify.ts` |
|
|
45
47
|
|
|
46
48
|
## How policies are defined, in one paragraph
|
|
47
49
|
|
|
@@ -53,6 +55,7 @@ A policy is a Cedar file. The gateway turns each tool call into a Cedar request:
|
|
|
53
55
|
- [codex-recovery.md](codex-recovery.md): the opt-in live Codex support incident, operator-reviewed recovery, and its offline state example
|
|
54
56
|
- [approvals.md](approvals.md): exact-action signatures, two-person thresholds, consumption, and privacy limits
|
|
55
57
|
- [console.md](console.md): the admin console: run it, what each tab does, how it is protected, and its limits
|
|
58
|
+
- [anchoring.md](anchoring.md): the log's checkpoints on Ethereum: what an anchor proves, running it, and checking a log against the chain
|
|
56
59
|
- [financial-operations.md](financial-operations.md): payment retries, budget reservations, provider contract, and operator reconciliation
|
|
57
60
|
- [sdk.md](sdk.md): the interceptor and every adapter
|
|
58
61
|
- [policies.md](policies.md): the Cedar mapping, evaluation rules, tested examples, gotchas
|
package/docs/usage.md
CHANGED
|
@@ -135,7 +135,7 @@ Exactly one of the two. The bearer token comes from the named environment variab
|
|
|
135
135
|
|
|
136
136
|
To test a different policy against the history already collected, run `agent-custody policy simulate --policy proposed.cedar --receipts receipts --issuer-key keys/gateway.pub --principal-key keys/principal.pub --out simulation.json`. It replays recorded arguments and fact values without calling upstreams, lists changed decisions by tool and reason with the receipt ids, and records the proposed policy digest. Missing replay inputs make the report incomplete. See [the policy simulation guide](policies.md#simulating-a-policy-against-recorded-history).
|
|
137
137
|
|
|
138
|
-
The grant is checked on every call, not only when the session opens: a call after `expiresAt` is denied with a receipt that says so, the check is repeated just before the forward (a grant that ran out while the facts were gathered leaves the call `withheld`), and over HTTP a session whose grant has expired or been revoked is closed on its next request with `403`. `"revokedGrants": "revoked.json"` names a file of grant digests the gateway re-reads whenever it changes. The digest is sha256 over the grant's signed payload, so extra signatures or fields on the envelope do not change it, and revoking a grant also revokes every grant delegated from it. A file that cannot be read denies every call until it can be read; `agent-custody revoke --config gateway.json --grant grant.json` appends a grant's digest to it, after which every session under that grant refuses its next call and no new session opens for it, with no key rotation. The Cedar policy is re-read the same way: when `policyFile` changes (device, inode, mtime, ctime, or size; a file written in the last two seconds is re-read on each call until it settles), the next call is evaluated under the new policy, with no restart and no dropped session, and a call already evaluating finishes under the policy it started with, whose digest its receipt carries. A changed file that does not parse, or that cannot be read, is refused: the policy in force stays, never an allow, and the gateway prints `POLICY NOT RELOADED` on stderr. Every change and every refusal is appended to `receipts/policy-reloads.jsonl` as `{ at, file, event: "reloaded" | "refused", from, to, errors?, warnings? }`, with the digest in force and the digest of the new file (`null` when the file was removed or cannot be read), so the change between two receipts' `policyDigest`s has a time. A reloaded policy with no permit rule is applied, since it denies every call, but is printed and recorded with the warning `no permit rule: every call is denied`. Write the file by rename, as `agent-custody console` does. A file written in place can be read half-written: a prefix that parses, missing a trailing `forbid`, decides calls until the write finishes and the settled file is read. `precommit` names the consequential tools, or `["*"]` for all of them. For every other tool the gateway forwards the call and then records it, so if the log is unreachable at that moment the side effect exists before its evidence is in the log: the receipt waits in the outbox. With a remote log and an empty `precommit`, the gateway prints a warning at startup and `agent-custody check` reports it; `"requirePrecommit": true` makes it a startup error. For a tool in `precommit` the gateway first signs an authorization statement, everything the receipt will say except the outcome, and appends it to the log. Only if the log took it does the call go upstream. The receipt then embeds that authorization with its own inclusion proof, and a verifier checks that it names this call and sits in the log before the receipt does. If the log will not take it, or answers with a head or proof that does not verify, the call is not forwarded, the agent is told `Not executed`, and the receipt records `execution.status: "withheld"` with the policy's `allow` beside it. The authorization is also written on its own as `receipts/<receiptId>.authorization.json`, which is the evidence that survives if the gateway dies between forwarding and the receipt. Use it for money, for anything irreversible, and for anything a counterparty could later dispute; the cost is one extra log append per call.
|
|
138
|
+
The grant is checked on every call, not only when the session opens: a call after `expiresAt` is denied with a receipt that says so, the check is repeated just before the forward (a grant that ran out while the facts were gathered leaves the call `withheld`), and over HTTP a session whose grant has expired or been revoked is closed on its next request with `403`. `"revokedGrants": "revoked.json"` names a file of grant digests the gateway re-reads whenever it changes. The digest is sha256 over the grant's signed payload, so extra signatures or fields on the envelope do not change it, and revoking a grant also revokes every grant delegated from it. A file that cannot be read denies every call until it can be read; `agent-custody revoke --config gateway.json --grant grant.json` appends a grant's digest to it, after which every session under that grant refuses its next call and no new session opens for it, with no key rotation. The Cedar policy is re-read the same way: when `policyFile` changes (device, inode, mtime, ctime, or size; a file written in the last two seconds is re-read on each call until it settles), the next call is evaluated under the new policy, with no restart and no dropped session, and a call already evaluating finishes under the policy it started with, whose digest its receipt carries. A changed file that does not parse, or that cannot be read, is refused: the policy in force stays, never an allow, and the gateway prints `POLICY NOT RELOADED` on stderr. Every change and every refusal is appended to `receipts/policy-reloads.jsonl` as `{ at, file, event: "reloaded" | "refused", from, to, errors?, warnings? }`, with the digest in force and the digest of the new file (`null` when the file was removed or cannot be read), so the change between two receipts' `policyDigest`s has a time. A reloaded policy with no permit rule is applied, since it denies every call, but is printed and recorded with the warning `no permit rule: every call is denied`. Write the file by rename, as `agent-custody console` does. A file written in place can be read half-written: a prefix that parses, missing a trailing `forbid`, decides calls until the write finishes and the settled file is read. `precommit` names the consequential tools, or `["*"]` for all of them. For every other tool the gateway forwards the call and then records it, so if the log is unreachable at that moment the side effect exists before its evidence is in the log: the receipt waits in the outbox. With a remote log and an empty `precommit`, the gateway prints a warning at startup and `agent-custody check` reports it; `"requirePrecommit": true` makes it a startup error, and [strict mode](#strict-mode) precommits every tool. For a tool in `precommit` the gateway first signs an authorization statement, everything the receipt will say except the outcome, and appends it to the log. Only if the log took it does the call go upstream. The receipt then embeds that authorization with its own inclusion proof, and a verifier checks that it names this call and sits in the log before the receipt does. If the log will not take it, or answers with a head or proof that does not verify, the call is not forwarded, the agent is told `Not executed`, and the receipt records `execution.status: "withheld"` with the policy's `allow` beside it. The authorization is also written on its own as `receipts/<receiptId>.authorization.json`, which is the evidence that survives if the gateway dies between forwarding and the receipt. Use it for money, for anything irreversible, and for anything a counterparty could later dispute; the cost is one extra log append per call.
|
|
139
139
|
|
|
140
140
|
#### When the log fails
|
|
141
141
|
|
|
@@ -152,6 +152,24 @@ Several gateways, or a gateway and a command, can share one `receipts/` director
|
|
|
152
152
|
|
|
153
153
|
When the log takes a receipt, the gateway records the log's answer in the outbox entry before it writes the bundle. If the bundle write then fails (a full disk, a permission error), the gateway prints the error on stderr, and the next flush writes the bundle from the recorded answer and does not append the leaf again. A process that dies between the append and that record appends the leaf again on the next flush; the log then holds it twice, and either copy proves the receipt. A gateway that dies after the forward and before the outbox write leaves no receipt; `precommit` is the guard for the calls where that matters. Before the gateway appends an outbox entry, it checks the entry. It renames an entry to `<name>.bad`, does not append it, and prints a warning, when the file is damaged, when the entry carries this gateway's key id but the signature does not verify, or when the receipt id in the statement is not the id in the file name. An entry that another key signed (a rotated gateway key, or a restored backup) is not appended, is not called forged, and stays in the outbox; the gateway prints a warning on each flush. Restore the key that signed it, or move the entry away. Until the log takes a pending receipt, `receipts/<id>.json` does not exist, so `verify`, `explain`, `blast`, the review console, and `prune` do not see the call yet.
|
|
154
154
|
|
|
155
|
+
#### Strict mode
|
|
156
|
+
|
|
157
|
+
The outbox keeps the receipt of a call through a log outage, but the operator runs the gateway: killing it between the forward and the outbox write, or deleting the outbox entry, leaves a call with no receipt, and a local log can be rewritten outright. `"strict": true` closes that for the calls the agent makes:
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"strict": true,
|
|
162
|
+
"log": { "url": "https://log.example.com/t/acme/", "tokenEnv": "AGENT_CUSTODY_LOG_TOKEN", "hashOnly": true, "keys": ["keys/log.pub"] }
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
- The gateway does not start with `logFile`, with a `log` that is not `hashOnly`, or with a `log` without `keys`. Each is a startup error that names the setting, and `agent-custody check` reports it. On a config without `strict`, `check` lists what strict mode would refuse.
|
|
167
|
+
- Every tool is precommitted, as with `precommit: ["*"]`: the authorization is in the log before the call is forwarded, and a call whose authorization the log will not take is `withheld`. In observe mode too, where a call the policy would deny is still forwarded and is precommitted like any other.
|
|
168
|
+
- No receipt goes to the outbox. A receipt that the log refuses after the forward is not kept, the call returns an error to the agent, and the authorization in the log stands. A gateway killed at any point leaves either no call or an authorization with no outcome, which a verifier reports as incomplete. Receipts left in the outbox from before strict mode was turned on are appended once, at start; there is no 30-second retry.
|
|
169
|
+
- Every receipt and authorization carries `issuer.strict: true`, and `verify --require-strict` refuses a receipt without it, or a forwarded call without its authorization ([verification.md](verification.md)).
|
|
170
|
+
|
|
171
|
+
The cost is one extra log append per call, and a log outage stops every call. What strict mode does not cover: a fact lookup and a `reconcile` read are reads the gateway makes itself, before the policy decides or on the operator's command, and go out before any log entry; each is on the receipt that follows. The flag is the gateway's own statement, signed with its key: it binds an honest gateway's operator to a mode a verifier can hold them to, and a modified gateway can still claim it. Only a gateway the operator cannot change ([the plan](../README.md#plan)) closes that.
|
|
172
|
+
|
|
155
173
|
**5. Run the gateway.** It speaks MCP on stdin/stdout and logs to stderr only.
|
|
156
174
|
|
|
157
175
|
```bash
|
package/docs/verification.md
CHANGED
|
@@ -24,7 +24,7 @@ node src/cli.ts verify receipts/<id>.json \
|
|
|
24
24
|
--log log.jsonl
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
`--approval-key` is needed for forwarded calls carrying human approvals (not for a refusal), `--log-key` for a remote log, and `--upstream-key` when checking a signed upstream result. `--log` is optional.
|
|
27
|
+
`--approval-key` is needed for forwarded calls carrying human approvals (not for a refusal), `--log-key` for a remote log, and `--upstream-key` when checking a signed upstream result. `--log` is optional. `--require-strict` refuses a receipt that a gateway in [strict mode](usage.md#strict-mode) did not issue, and a forwarded call without its precommitted authorization.
|
|
28
28
|
|
|
29
29
|
Exit code 0 when every check passes, 1 otherwise. Add `--json` for machine-readable output. `--issuer-key`, `--principal-key`, and `--approval-key` can be repeated to accept rotated keys; signatures are matched by keyid. `--gateway-key` is an alias for `--issuer-key`. `--principal-key` may be omitted for SDK receipts, which carry no delegation.
|
|
30
30
|
|
|
@@ -103,12 +103,14 @@ A refused call's `execution` row carries the reason the receipt records, for exa
|
|
|
103
103
|
| authorization log inclusion proof | the authorization statement is a leaf of that tree | an authorization that was never logged |
|
|
104
104
|
| authorization logged before execution | the authorization's leaf precedes the receipt's leaf, at a tree size no larger than the receipt's | evidence written after the side effect, dressed up as before |
|
|
105
105
|
| tree head signature | the tree head was signed by a trusted issuer key | forged log position |
|
|
106
|
+
| strict mode in force | with `--require-strict`: a gateway receipt whose issuer says `strict: true`. It is the gateway's own statement, signed with its key, so it binds the operator to a mode it can be held to; it does not prove the gateway's code | an ordinary receipt presented where strict ones are required |
|
|
107
|
+
| strict: call precommitted before forwarding | with `--require-strict`: a call that was executed, failed, or errored carries its authorization, which the `authorization …` checks then place in the log before the receipt. A reconciliation receipt is a provider read and needs none | a strict claim on a call that went out before any log entry |
|
|
106
108
|
| tree head names the expected log | with `--log-id`: the tree head carries that log id, so a head from another tenant's log on the same server cannot be presented as this one's | a receipt logged to a different log than claimed |
|
|
107
109
|
| tree head matches inclusion proof size | the proof and the tree head describe the same tree | mismatched bundle parts |
|
|
108
110
|
| log inclusion proof | this exact envelope is a leaf of the tree with that root | receipt never logged, or logged then changed |
|
|
109
111
|
| log file root matches tree head | recomputing the root from your copy of the log at that size gives the same value | your log copy and the issuer's history diverge: deletion, reordering, or edit |
|
|
110
112
|
|
|
111
|
-
Approval-bearing forwarded calls add four approval checks. A refused call runs only `approval consistent with execution`, so it verifies without approval keys, with a valid approval or with the invalid approval that caused its refusal. Gateway receipts otherwise run seventeen checks, eighteen with a log file, one more (`execution result digest`) when the call was executed or failed, and five more when the tool was committed before it ran (`precommit` in the gateway config). SDK receipts run fewer, because there is no delegation to check, and the report says so on the `principal is claimed` line. A receipt issued to a sub-agent under a delegation chain runs one more, `delegation chain to the principal`.
|
|
113
|
+
Approval-bearing forwarded calls add four approval checks. A refused call runs only `approval consistent with execution`, so it verifies without approval keys, with a valid approval or with the invalid approval that caused its refusal. Gateway receipts otherwise run seventeen checks, eighteen with a log file, one more (`execution result digest`) when the call was executed or failed, and five more when the tool was committed before it ran (`precommit` in the gateway config). `--require-strict` adds two. SDK receipts run fewer, because there is no delegation to check, and the report says so on the `principal is claimed` line. A receipt issued to a sub-agent under a delegation chain runs one more, `delegation chain to the principal`.
|
|
112
114
|
|
|
113
115
|
Financial receipts add `operation …` checks and `authorization names this operation` for the durable id (absent under a private capture rule; the provider key then links the receipts), provider key, precommitted lookup, and budget. Reconciliation receipts embed their original receipt or authorization and run its checks under `reconciliation original …`, reject nested reconciliation evidence, preserve identity at `reconciliation links the original operation`, and check the configured mapping and provider record at `reconciliation lookup matches authorization`, `reconciliation lookup args match request`, and `reconciliation provider status`. The provider's terminal state must agree with the financial outcome and its record must echo the idempotency key. `reconciliation logged after original` checks ordering. These observations do not independently prove settlement without trusting the gateway and provider; private provider results verify as committed until disclosed or decrypted. See [financial operations](financial-operations.md).
|
|
114
116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-custody/receipts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"mcpName": "io.github.svayatta/agent-custody",
|
|
5
5
|
"description": "Chain of custody for AI agents: signed, independently verifiable receipts for tool calls. MCP gateway + Cedar policy + Merkle transparency log",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -84,6 +84,7 @@
|
|
|
84
84
|
"langchain": "1.5.15",
|
|
85
85
|
"tsx": "^4.23.13",
|
|
86
86
|
"typescript": "^7.0.2",
|
|
87
|
+
"viem": "2.57.4",
|
|
87
88
|
"vitest": "^5.0.0",
|
|
88
89
|
"xml-crypto": "^6.1.2"
|
|
89
90
|
},
|
|
@@ -92,7 +93,8 @@
|
|
|
92
93
|
"@node-saml/node-saml": ">=5.1.0",
|
|
93
94
|
"@openai/agents": ">=0.1.0",
|
|
94
95
|
"ai": ">=5.0.0",
|
|
95
|
-
"pg": ">=8"
|
|
96
|
+
"pg": ">=8",
|
|
97
|
+
"viem": ">=2.30.0"
|
|
96
98
|
},
|
|
97
99
|
"peerDependenciesMeta": {
|
|
98
100
|
"@langchain/core": {
|
|
@@ -109,6 +111,9 @@
|
|
|
109
111
|
},
|
|
110
112
|
"pg": {
|
|
111
113
|
"optional": true
|
|
114
|
+
},
|
|
115
|
+
"viem": {
|
|
116
|
+
"optional": true
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
}
|
package/vectors/audit.json
CHANGED
|
@@ -7,26 +7,26 @@
|
|
|
7
7
|
"description": "The tree head from the first remote receipt and the log's later head, with the proof the log served.",
|
|
8
8
|
"older": {
|
|
9
9
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
10
|
-
"payload": "
|
|
10
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNTJhOWM4YThkZGIzN2M1NTE5NjUzOTNkYjc0OTQ0MzJkYTNkNDI4M2IzMDBmZmVmZTVjMDRhZjdhZDA5ODllZCIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjU1WiIsInRyZWVTaXplIjoxfQ==",
|
|
11
11
|
"signatures": [
|
|
12
12
|
{
|
|
13
|
-
"keyid": "
|
|
14
|
-
"sig": "
|
|
13
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
14
|
+
"sig": "p157640WqSaZVAlE7YwWiwFiW/HcI8HRXjV7ejMtCKr63+18OMiOQtYuJeelZjNCRV347Jnx+yvCsecN6yKnDA=="
|
|
15
15
|
}
|
|
16
16
|
]
|
|
17
17
|
},
|
|
18
18
|
"newer": {
|
|
19
19
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
20
|
-
"payload": "
|
|
20
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiZmFmNWFjNzFlOTM5ZDE1ODA2MjgxNmVmNGUxZGFjY2E0YjA4OTBhZjliZjQ4NjliNGE1YmRkNmE1MWIwOWQ4ZiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjYxWiIsInRyZWVTaXplIjoyfQ==",
|
|
21
21
|
"signatures": [
|
|
22
22
|
{
|
|
23
|
-
"keyid": "
|
|
24
|
-
"sig": "
|
|
23
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
24
|
+
"sig": "N0MdqFI31VxcLPpPsewFqRI0h+UqMLiI2KNRFxkow2+GcAnEbj3cBegykfQ+PbfqIvolvEq5y3Zf9hJ2ONCKCw=="
|
|
25
25
|
}
|
|
26
26
|
]
|
|
27
27
|
},
|
|
28
28
|
"proof": [
|
|
29
|
-
"
|
|
29
|
+
"02c80901df5441cc3211b76b815a783f35b8d8b6bf6c9f967333d316be6a6e5e"
|
|
30
30
|
],
|
|
31
31
|
"keys": [
|
|
32
32
|
"log"
|
|
@@ -41,26 +41,26 @@
|
|
|
41
41
|
"description": "The same heads the wrong way round.",
|
|
42
42
|
"older": {
|
|
43
43
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
44
|
-
"payload": "
|
|
44
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiZmFmNWFjNzFlOTM5ZDE1ODA2MjgxNmVmNGUxZGFjY2E0YjA4OTBhZjliZjQ4NjliNGE1YmRkNmE1MWIwOWQ4ZiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjYxWiIsInRyZWVTaXplIjoyfQ==",
|
|
45
45
|
"signatures": [
|
|
46
46
|
{
|
|
47
|
-
"keyid": "
|
|
48
|
-
"sig": "
|
|
47
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
48
|
+
"sig": "N0MdqFI31VxcLPpPsewFqRI0h+UqMLiI2KNRFxkow2+GcAnEbj3cBegykfQ+PbfqIvolvEq5y3Zf9hJ2ONCKCw=="
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
"newer": {
|
|
53
53
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
54
|
-
"payload": "
|
|
54
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNTJhOWM4YThkZGIzN2M1NTE5NjUzOTNkYjc0OTQ0MzJkYTNkNDI4M2IzMDBmZmVmZTVjMDRhZjdhZDA5ODllZCIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjU1WiIsInRyZWVTaXplIjoxfQ==",
|
|
55
55
|
"signatures": [
|
|
56
56
|
{
|
|
57
|
-
"keyid": "
|
|
58
|
-
"sig": "
|
|
57
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
58
|
+
"sig": "p157640WqSaZVAlE7YwWiwFiW/HcI8HRXjV7ejMtCKr63+18OMiOQtYuJeelZjNCRV347Jnx+yvCsecN6yKnDA=="
|
|
59
59
|
}
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
"proof": [
|
|
63
|
-
"
|
|
63
|
+
"02c80901df5441cc3211b76b815a783f35b8d8b6bf6c9f967333d316be6a6e5e"
|
|
64
64
|
],
|
|
65
65
|
"keys": [
|
|
66
66
|
"log"
|
|
@@ -77,26 +77,26 @@
|
|
|
77
77
|
"description": "Tree heads checked against the app key, which did not sign them.",
|
|
78
78
|
"older": {
|
|
79
79
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
80
|
-
"payload": "
|
|
80
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNTJhOWM4YThkZGIzN2M1NTE5NjUzOTNkYjc0OTQ0MzJkYTNkNDI4M2IzMDBmZmVmZTVjMDRhZjdhZDA5ODllZCIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjU1WiIsInRyZWVTaXplIjoxfQ==",
|
|
81
81
|
"signatures": [
|
|
82
82
|
{
|
|
83
|
-
"keyid": "
|
|
84
|
-
"sig": "
|
|
83
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
84
|
+
"sig": "p157640WqSaZVAlE7YwWiwFiW/HcI8HRXjV7ejMtCKr63+18OMiOQtYuJeelZjNCRV347Jnx+yvCsecN6yKnDA=="
|
|
85
85
|
}
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
88
|
"newer": {
|
|
89
89
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
90
|
-
"payload": "
|
|
90
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiZmFmNWFjNzFlOTM5ZDE1ODA2MjgxNmVmNGUxZGFjY2E0YjA4OTBhZjliZjQ4NjliNGE1YmRkNmE1MWIwOWQ4ZiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjYxWiIsInRyZWVTaXplIjoyfQ==",
|
|
91
91
|
"signatures": [
|
|
92
92
|
{
|
|
93
|
-
"keyid": "
|
|
94
|
-
"sig": "
|
|
93
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
94
|
+
"sig": "N0MdqFI31VxcLPpPsewFqRI0h+UqMLiI2KNRFxkow2+GcAnEbj3cBegykfQ+PbfqIvolvEq5y3Zf9hJ2ONCKCw=="
|
|
95
95
|
}
|
|
96
96
|
]
|
|
97
97
|
},
|
|
98
98
|
"proof": [
|
|
99
|
-
"
|
|
99
|
+
"02c80901df5441cc3211b76b815a783f35b8d8b6bf6c9f967333d316be6a6e5e"
|
|
100
100
|
],
|
|
101
101
|
"keys": [
|
|
102
102
|
"app"
|
|
@@ -114,21 +114,21 @@
|
|
|
114
114
|
"description": "A proof with a hash removed.",
|
|
115
115
|
"older": {
|
|
116
116
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
117
|
-
"payload": "
|
|
117
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNTJhOWM4YThkZGIzN2M1NTE5NjUzOTNkYjc0OTQ0MzJkYTNkNDI4M2IzMDBmZmVmZTVjMDRhZjdhZDA5ODllZCIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjU1WiIsInRyZWVTaXplIjoxfQ==",
|
|
118
118
|
"signatures": [
|
|
119
119
|
{
|
|
120
|
-
"keyid": "
|
|
121
|
-
"sig": "
|
|
120
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
121
|
+
"sig": "p157640WqSaZVAlE7YwWiwFiW/HcI8HRXjV7ejMtCKr63+18OMiOQtYuJeelZjNCRV347Jnx+yvCsecN6yKnDA=="
|
|
122
122
|
}
|
|
123
123
|
]
|
|
124
124
|
},
|
|
125
125
|
"newer": {
|
|
126
126
|
"payloadType": "application/vnd.agent-custody.treehead+json",
|
|
127
|
-
"payload": "
|
|
127
|
+
"payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiZmFmNWFjNzFlOTM5ZDE1ODA2MjgxNmVmNGUxZGFjY2E0YjA4OTBhZjliZjQ4NjliNGE1YmRkNmE1MWIwOWQ4ZiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMjRUMjE6NDM6MTYuNjYxWiIsInRyZWVTaXplIjoyfQ==",
|
|
128
128
|
"signatures": [
|
|
129
129
|
{
|
|
130
|
-
"keyid": "
|
|
131
|
-
"sig": "
|
|
130
|
+
"keyid": "7218437659a7b9b522de300ad9b9e6a8d0f0cb0aef7dc1237a040efb405ce00d",
|
|
131
|
+
"sig": "N0MdqFI31VxcLPpPsewFqRI0h+UqMLiI2KNRFxkow2+GcAnEbj3cBegykfQ+PbfqIvolvEq5y3Zf9hJ2ONCKCw=="
|
|
132
132
|
}
|
|
133
133
|
]
|
|
134
134
|
},
|
package/vectors/canonical.json
CHANGED
|
@@ -53,18 +53,18 @@
|
|
|
53
53
|
}
|
|
54
54
|
],
|
|
55
55
|
"keyid": {
|
|
56
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\
|
|
57
|
-
"keyid": "
|
|
56
|
+
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAE1GO+bv5vEy6uyagTf6Cx4AqW6oK611ZiuhsebVQyAw=\n-----END PUBLIC KEY-----\n",
|
|
57
|
+
"keyid": "1110dfb85d3cc62d08cbf0cf04c40428795879d7ed443a377e20b37419a337dd"
|
|
58
58
|
},
|
|
59
59
|
"dsse": {
|
|
60
|
-
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\
|
|
60
|
+
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAE1GO+bv5vEy6uyagTf6Cx4AqW6oK611ZiuhsebVQyAw=\n-----END PUBLIC KEY-----\n",
|
|
61
61
|
"envelope": {
|
|
62
62
|
"payloadType": "application/vnd.example+json",
|
|
63
63
|
"payload": "eyJoZWxsbyI6IndvcmxkIn0=",
|
|
64
64
|
"signatures": [
|
|
65
65
|
{
|
|
66
|
-
"keyid": "
|
|
67
|
-
"sig": "
|
|
66
|
+
"keyid": "1110dfb85d3cc62d08cbf0cf04c40428795879d7ed443a377e20b37419a337dd",
|
|
67
|
+
"sig": "dbMD0AfxaklCHox+9e+EuxQveMfznxuxQ69AQxsECjO9FWOiuTylr/p0EnWUXnHEBoMj+DptPgAISqGEF9+RAQ=="
|
|
68
68
|
}
|
|
69
69
|
]
|
|
70
70
|
},
|