@agent-custody/receipts 0.8.0 → 0.9.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.
@@ -0,0 +1,79 @@
1
+ # The gateway console
2
+
3
+ A small admin service for the person who runs a gateway. It shows what the gateway is configured to do and what it has done, validates and replays a policy change before it is saved, and revokes a grant. It is a separate process from the gateway, behind a token, so the gateway never serves an admin page next to the agents' credentials.
4
+
5
+ It is deliberately limited. It holds **no principal key and signs nothing**, so it cannot issue a grant or widen anyone's authority; everything it shows is read from the gateway's own config, receipts, and revocation file; and the only things it changes are the policy file and the revocation file, both of which the gateway reads. [Example 32](../examples/32-console.ts) runs it end to end.
6
+
7
+ ## Run it
8
+
9
+ ```bash
10
+ export CONSOLE_TOKEN="$(openssl rand -hex 32)" # the sign-in token; it is read from the environment (or a file), never from a flag
11
+ agent-custody console --config gateway.json --gateway-url http://127.0.0.1:8790
12
+ ```
13
+
14
+ It listens on `127.0.0.1:8795` and prints the URL. Open it and sign in with the token.
15
+
16
+ | flag | meaning |
17
+ | --- | --- |
18
+ | `--config <gateway.json>` | the gateway's config, read again on every request, so an edit shows at once |
19
+ | `--token-env NAME` | the environment variable holding the token, default `CONSOLE_TOKEN`; the console refuses to start without one |
20
+ | `--token-file <path>` | read the token from a file instead, such as a container secret at `/run/secrets/console_token`; the contents are the secret, not the path |
21
+ | `--port`, `--host` | default `8795` on `127.0.0.1`; any other host prints a reminder to put TLS in front |
22
+ | `--gateway-url <url>` | the running gateway, for its health (reachable, open sessions); omit it and the console does not look |
23
+ | `--state-dir <dir>` | where the console keeps its audit file and the earlier versions of the policy; default `console/` beside the receipts directory |
24
+
25
+ **In the Docker image** it is the same image as the gateway, run as a second service: `docker compose --profile console up -d` in [deploy/gateway](https://github.com/svayatta/agent-custody/blob/main/deploy/gateway/README.md). The token is a **Docker secret mounted only in the console service** (`openssl rand -hex 32 > console-token`), not an entry in the `.env` file that the gateway reads, because the token can rewrite the policy and revoke grants and the gateway must not hold it. The console service is not given that `.env` either, so it holds none of the upstream credentials. It mounts `./config` read-write, because the policy file is what it edits, and the same data volume as the gateway; the gateway keeps its config read-only. Both run as the same user (`GATEWAY_UID`, `GATEWAY_GID`, default 10001), so what one writes the other can read: the gateway's key is mode 0600. On Kubernetes, run the same image with the argument `console`, the token as a Secret mounted as a file and given only to that pod, the same config and data volumes, and a Service that only your administrators can reach.
26
+
27
+ ## What it shows and does
28
+
29
+ | tab | what it does |
30
+ | --- | --- |
31
+ | **Overview** | the gateway's health and key id, the mode, the upstreams and their kinds, the fact lookups, the log, `precommit`, the trusted principal keys, the number of revoked grants and of receipts, and the config check's result |
32
+ | **Check** | the same checks as `agent-custody check`, except that the credential variables are **not** checked: the console deliberately does not hold the gateway's credentials, so it cannot tell whether they are set where the gateway runs. "Connect" starts the upstreams and lists their tools only for a config that names no credentials; otherwise it says to run `agent-custody check --connect` where the gateway runs, for example `docker compose exec gateway agent-custody check --config /config/gateway.json --connect`. A connect check that does not finish in 60 seconds is stopped and the upstreams it started are closed ([configuration.md](configuration.md#check-it-before-you-start-it)) |
33
+ | **Policy** | the policy file in an editor. *Validate* asks Cedar to parse it. *Replay recorded calls* runs it against the verified receipts, using each call's own arguments and facts, and lists the decisions that would change, with their receipts. **A replay only re-decides calls that already happened**: a limit that no recorded call reached, or removing one, can show no change, so it is not a test of what a policy allows. *Save* writes it, keeping the previous version and recording the change |
34
+ | **Grants** | paste a grant to see whether the gateway would accept it (valid, expired, revoked, signed by a key it does not trust) and what it allows; *Revoke* adds its digest to the revocation file, and the gateway refuses it, and every grant delegated from it, on its next call. Lists the revoked digests |
35
+ | **Receipts** | the newest receipts with their agent, tool, decision, and outcome, each verified against the gateway key, the trusted principals, and the local log; a receipt that does not verify says which checks failed; a row opens the full statement |
36
+ | **Audit** | every change made through the console: who, when, and what, with the policy's digest before and after |
37
+
38
+ ## What a saved policy does
39
+
40
+ The gateway reads `policy.cedar` when it starts, so **a saved policy applies after the gateway restarts**, and the console says so each time. Reloading a policy without a restart is a separate change. The save is guarded: Cedar must parse the text; and the operator must confirm a policy that has no `permit` rule (a `permit(` in a comment does not count), because every call would be denied, or a `permit` rule with **no action and no condition**, which allows every tool in a grant's scopes and which a replay cannot show. A save made from a copy that is no longer the file on disk is refused with `409`. The digest check, the history copy, and the write happen under one lock, in this process and, through a lock file in the state directory, across consoles that share it, so two administrators cannot overwrite each other. The previous version is kept under `console/policy-history/` and the change goes in the audit trail.
41
+
42
+ ## How it is protected
43
+
44
+ - **A token on every API route.** It is compared in constant time. Five wrong tokens from one address lock it out for a minute. A request with no token is refused and does not count towards that.
45
+ - **Loopback by default.** The transport is plain HTTP. Anything beyond one machine needs TLS in front (a proxy or mesh) and a network only administrators can reach. The console has one shared token, not per-user accounts or roles.
46
+ - **No keys.** It never reads a principal's private key. It reads the gateway's key file only to take the public half, so that it can verify receipts.
47
+ - **The page cannot run what it shows.** Every value is written with `textContent`, never as markup, and the page is served with a content-security-policy that allows exactly its own script and style by hash and nothing else (no inline attributes, no outside requests). The page's own tests check both.
48
+ - **Bounded input.** A request body over a megabyte is refused, and a receipt id must be a UUID, so a path cannot be read through it.
49
+ - **Everything it changes is recorded**, in an append-only file in its state directory, and the policy it replaces is kept.
50
+
51
+ ## Limits
52
+
53
+ - It does not issue grants. A grant is signed by a principal's key, which belongs where grants are issued ([configuration.md](configuration.md#the-principals-key)).
54
+ - It does not edit `gateway.json`: upstreams, facts, and `precommit` are changed in the file, and the gateway restarted. The Overview and Check tabs show them.
55
+ - A policy change needs a gateway restart.
56
+ - The credential variables are not checked in the console, and an upstream that needs one is not started there.
57
+ - One token, no per-user accounts, and the audit records the address and not a person.
58
+ - It reads the local receipts directory. With a remote log it verifies receipts against the keys but not the log's inclusion proofs.
59
+ - A shared gateway has one policy and one key for every agent on it, so the console edits one policy.
60
+
61
+ ## API
62
+
63
+ Every route except `GET /` (the page) and `GET /healthz` needs `Authorization: Bearer <token>`.
64
+
65
+ | route | does |
66
+ | --- | --- |
67
+ | `GET /api/overview` | the configuration summary, the gateway's health, and the static check |
68
+ | `POST /api/check` `{ connect? }` | the check; `connect` starts the upstreams |
69
+ | `GET /api/policy` | the policy text, its digest, and the earlier versions kept |
70
+ | `POST /api/policy/validate` `{ text }` | does Cedar parse it, and which things need confirming (`issues`) |
71
+ | `POST /api/policy/simulate` `{ text }` | replay up to 1,000 verified receipts against it |
72
+ | `PUT /api/policy` `{ text, expectDigest, confirm? }` | save it; `400` unless `confirm` is true when the policy has an issue the validate route reported; `409` if the file changed |
73
+ | `POST /api/grants/inspect` `{ grant }` | status, agent, scopes, window, digest |
74
+ | `POST /api/grants/revoke` `{ grant }` | add its digest to the revocation file |
75
+ | `GET /api/revocations` | the revoked digests |
76
+ | `GET /api/receipts?limit=` | recent receipts with their verdicts; `GET /api/receipts/<id>` is one statement |
77
+ | `GET /api/audit` | the console's audit trail |
78
+
79
+ Programmatically: `serveConsole({ configFile, token, port?, host?, gatewayUrl?, stateDir? })` returns `{ url, close() }`.
package/docs/policies.md CHANGED
@@ -114,6 +114,7 @@ The memory server in `@agent-custody/state` is an upstream like any other, so it
114
114
  | `memory.read` | the query, and `includeClaimed` or `requireVerified` when the caller asks for them | |
115
115
  | `memory.retract`, `memory.forget`, `memory.hold`, `memory.release` | `factId` and `reason` | `target`, the fact being changed |
116
116
  | `memory.sweep` | `before`, `space`, `reason` | |
117
+ | `memory.repair` | `reason`, and optionally `before` (an earlier cutoff) | |
117
118
  | `memory.confirm` | `factId` | |
118
119
 
119
120
  A looked-up `target` has `space`, `actor`, `provenance` (`claimed`, `attested`, or `verified`), `subject`, `predicate`, `value`, and `retracted`. Fields that would be null are absent, so test with `has`. The lookup config that makes `target` available is in the [state package README](../../state/README.md#the-memory-server).
@@ -100,6 +100,19 @@ Each row names the attacker, the move, the defence, and whether the defence is a
100
100
  | Steal a tenant token | Tokens are bearer secrets; a stolen one appends noise to that tenant's log until revoked. Rate limits bound the damage per second; the tenant's usage shows it. | deployment |
101
101
  | Escape a per-address limit by forging `X-Forwarded-For` | Behind the proxy the deployment runs, the limiter keys on the address the proxy appended, the rightmost entry, never on one the client supplied. | deployment |
102
102
 
103
+ ### On the portal accounts
104
+
105
+ The portal is not part of the evidence: it publishes policy names and mints log tokens. A stolen account can mint a token, so the portal limits who may.
106
+
107
+ | attack | defence | kind |
108
+ | --- | --- | --- |
109
+ | Guess or steal a member's password | Optional TOTP MFA on the account. A code works once, wrong codes are throttled per address and per account, and the half-signed-in cookie is never a session. A GitHub or Google sign-in goes through the same code step. | deployment |
110
+ | A member acts beyond their job | Four roles: `readonly` reads, `reviewer` also publishes policy versions, `admin` also manages keys and members below owner, `owner` also manages billing and owners. A new write route needs `admin` unless it is listed. The last owner cannot be removed or demoted. | deployment |
111
+ | Claim an invited address to join a tenant | An invite is accepted only by an account with a verified address, and an account belongs to one tenant. | deployment |
112
+ | Sign in through an IdP the tenant does not own | The operator sets single sign-on, never the tenant. An IdP is trusted only for the email domains of its tenant, and a domain belongs to one tenant. The portal checks the OIDC `id_token` signature against the IdP's key set, or the signed SAML assertion through a maintained library, and ties the sign-in to the request that started it. | deployment |
113
+ | Lock a member out of their SSO tenant by registering their address first | The IdP proves the address, so it wins over an account that never verified it. The sign-in deletes that account with its password, sessions, memberships, and linked providers. A tenant that the account created stays, for the operator to deal with. Registering with a tenant, or linking a provider, does not change this. The one limit: an account in another tenant that has other members is refused, so that tenant keeps its members. | deployment |
114
+ | Keep access after leaving the company | With enforcement on, members sign in only through the IdP, so removal at the IdP ends access at the next sign-in. Sessions that began earlier end when enforcement is turned on. A member removed in the portal loses access at once, also in an SSO tenant: the IdP sign-in joins them again only after an admin invites the address again, also when they never verified their address. An API key that the member minted stays valid until an admin revokes it. | deployment |
115
+
103
116
  ## What is not defended
104
117
 
105
118
  Stated plainly, because a security review that finds these itself will not believe the rest.
package/docs/tutorials.md CHANGED
@@ -40,6 +40,8 @@ Suggested reading order is the numbering. Output lands in `examples-out/`, which
40
40
  | 28 | policy simulation | [28-policy-simulation.ts](../examples/28-policy-simulation.ts) | three refunds recorded in observe mode, then the gateway stopped and their receipts replayed against a lower limit: only one changes decision, grouped by tool and reason with its receipt id, the proposed policy digest saved with the run | `src/simulate.ts`, `src/cli.ts` |
41
41
  | 29 | financial operations | [29-financial-operations.ts](../examples/29-financial-operations.ts) | a refund accepted before its response is dropped, a restart and retry producing no second request, the unknown reservation blocking an over-budget refund, and a provider reconciliation receipt that verifies | `src/operations.ts`, `src/gateway.ts`, `src/verify.ts` |
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
+ | 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
+ | 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` |
43
45
 
44
46
  ## How policies are defined, in one paragraph
45
47
 
@@ -48,7 +50,9 @@ A policy is a Cedar file. The gateway turns each tool call into a Cedar request:
48
50
  ## Where each guide goes deeper
49
51
 
50
52
  - [usage.md](usage.md): gateway setup and wiring into hosts
53
+ - [codex-recovery.md](codex-recovery.md): the opt-in live Codex support incident, operator-reviewed recovery, and its offline state example
51
54
  - [approvals.md](approvals.md): exact-action signatures, two-person thresholds, consumption, and privacy limits
55
+ - [console.md](console.md): the admin console: run it, what each tab does, how it is protected, and its limits
52
56
  - [financial-operations.md](financial-operations.md): payment retries, budget reservations, provider contract, and operator reconciliation
53
57
  - [sdk.md](sdk.md): the interceptor and every adapter
54
58
  - [policies.md](policies.md): the Cedar mapping, evaluation rules, tested examples, gotchas
package/docs/usage.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  This page covers the gateway, the out-of-process producer. For the in-process interceptor that hooks Claude Code, the Claude Agent SDK, or any framework's tool functions, see [sdk.md](sdk.md).
4
4
 
5
+ For who may use which tools, where the tools live, a worked example with two agents on one shared gateway, how the config works in the Docker image, and how to check it before you start, see [configuration.md](configuration.md). This page is the setup in order.
6
+
5
7
  ## The parts
6
8
 
7
9
  | part | what it is | who controls it |
@@ -121,7 +123,7 @@ At startup the gateway fetches the agent's card from `<url>/.well-known/agent-ca
121
123
  "log": { "url": "https://log.example.com/", "tokenEnv": "AGENT_CUSTODY_LOG_TOKEN" }
122
124
  ```
123
125
 
124
- Exactly one of the two. The bearer token comes from the named environment variable, never from the file, and a missing variable fails at startup. Add `"hashOnly": true` for any log run by someone else: the gateway then sends only the leaf hash, sha256 of the receipt envelope with the RFC 6962 prefix, so the log commits to the receipt without ever holding it, and the receipts with their arguments and results stay in `receiptsDir`. The verifier does not change; it hashes the envelope itself. A log that serves several tenants is reached at `<url>/t/<tenant>/`, and each of its tree heads names its log, which a verifier checks with `--log-id`. With a remote log the tree head in each receipt is signed by the log's key, and a verifier must be given that key with `--log-key`. The gateway does not take the log's answer on trust either: the tree head in every append's answer must verify against the log's keys, name the expected log, match the proof's size, and the inclusion proof must place that very leaf under the signed root, all before a pre-committed call is forwarded and before any receipt is handed out; an answer that fails any of it is a refusal. `"keys": ["keys/log.pub"]` pins the log's public keys, `"logId"` the id its heads must carry; without `keys` the log's key document at `/.well-known/agent-custody-log.json` is fetched from the log itself once, on the first append, and pinned. That catches a log that turns dishonest later, not one that is dishonest from the start, so a gateway config with `precommit` and a remote log must list `keys`. When the log rotates its key, add the new public key to `keys`; a gateway that fetched the keys needs a restart. An append that gets no answer within `timeoutMs` (default 10000) counts as unreachable and is retried like a server error, so a log that accepts connections and never answers cannot hold a call forever. If the log refuses a leaf, the receipt is not issued and the call returns an error to the agent. For an ordinary call the upstream action has already happened by then, and the error says so; a receipt that was never logged must not be handed out. For a tool named in `precommit` the order is reversed, below, and the action never happens. A fact lookup is different: it runs before the policy decides, because the policy decides on it, and only once the intercepted tool is in the grant's scope, so a fact tool must be a read. Naming a fact tool in `precommit` is refused at startup; `"*"` covers the tools the agent calls, not the gateway's own lookups. Every lookup is on the receipt with its arguments. The reference log server is `node src/cli.ts log --file log.jsonl --key keys/log.key --port 8787 --token-env AGENT_CUSTODY_LOG_TOKEN [--log-id <id>] [--tenants tenants.json]`. It serves `POST /append` with `{leaf}` or `{leafHash}` (token required when one is configured), `GET /root?size=N`, `GET /consistency?old=M&new=N`, and `GET /head`; [verification.md](verification.md) says what each proves. `--log-id` writes that id into every tree head. `--tenants` names a JSON file, `{ "acme": { "file": "acme.jsonl", "tokenEnv": "ACME_TOKEN", "logId": "acme-eu" } }`, and each tenant is its own log at `/t/acme/…` with its own token and id; the default log stays at the root paths. With `--hash-only` the server refuses `{leaf}` at append and accepts only `{leafHash}`, so a log run for other people never receives a receipt regardless of the client's configuration; the hosted deployment sets it. With `--db-env DATABASE_URL` the server keeps its logs in Postgres instead of files, and needs the `pg` package beside it: leaves as hashes in one table keyed by tenant, one writer per tenant enforced with an advisory lock so a second instance is safe, tenants and their tokens in tables of their own with tokens stored only as hashes, and rate limits per token (50 appends a second, burst 100, a 64 KB body cap; a refused append answers 429 with `retry-after`, and the gateway's sink retries a few times). Tenants are managed with `log-admin --db-env DATABASE_URL`: `tenant add <id> [--log-id <id>]`, `token add <tenant> --label <text>` (the token is printed once), `token revoke <tenant> <hash-prefix>`, `tenant disable <id>`, `tenant plan <id> <free|team|enterprise>`, and `import --file log.jsonl [--tenant default]` to bring an existing file log in as hashes. Every tenant is on a plan, `free` unless moved: free allows ten thousand appends a calendar month, team a million, enterprise has no allowance. An append past the allowance is refused with 429, the numbers, and a `retry-after` that reaches the start of next month; the gateway behind it then withholds pre-committed calls, so a tenant out of quota never acts without evidence. The tenant's own `GET /t/<name>/usage` reports the plan and quota beside the month's appends. The tenant portal, `agent-custody portal --db-env DATABASE_URL --secret-env PORTAL_SECRET --public-url <log url> [--checkpoints-url <url>] [--portal-url <url>] [--stripe-key-env NAME --stripe-webhook-env NAME --stripe-price-team <price id>] [--trust-proxy]`, is the self-serve front of the same tables: a team registers with an email, a password (scrypt), and a tenant id and gets the tenant and its first key shown once with the welcome sheet; the dashboard shows appends against the plan, the tree size and root, the latest checkpoint, the log's URLs, keys, and the audit rows; keys are minted and revoked there, recorded as `portal:<email>`; the export command is on the page; and with the three Stripe variables the team plan is bought through Stripe Checkout, the signed webhook moving the plan (`stripe:<event>` in the audit trail) and the customer portal handling cancellation. Sessions are a signed cookie, `SameSite=Strict`, and every write needs a JSON body. The compose file runs it as the `portal` service at `PORTAL_HOST`. The root paths serve the tenant `default`, created on first start with `--log-id`, and `--token-env` still works for it. The key that signs tree heads can live in its own process: `agent-custody signer --key keys/log.key --port 8790 --token-env SIGNER_TOKEN` holds it and answers `POST /sign` with the shared secret and `GET /keys` to anyone; the log server then runs with `--signer-url http://signer:8790/ --signer-token-env SIGNER_TOKEN` instead of `--key`, and the process that faces the internet never holds the key. Either way the log serves its keys at `/.well-known/agent-custody-log.json`, current key first and retired keys (`--retired-key old.pub`) after it, so verifiers fetch and pin them with `verify --log-url` and `audit --log-url` rather than receiving a key file from the operator. With `--checkpoint-dir <dir>` the server publishes a signed checkpoint, every `--checkpoint-every` seconds (default 300), for each log whose tree has grown, and every `--checkpoint-heartbeat` seconds (default 21600, six hours) for a log that has not, so a quiet log's latest checkpoint is never more than six hours old and the monitor can tell quiet from stalled, as `<dir>/<tenant>/<treeSize>.json` and `latest.json`, and with a database also as rows; `GET /checkpoints?since=<size>` and `GET /t/<tenant>/checkpoints` list them. Serve the directory read-only from a second host, so the record of what the log signed does not depend on the log's API being up; a verifier who kept an earlier head audits against a later checkpoint with `audit --older <bundle> --newer <checkpoint> --log-url <url>`. With `--admin-token-env ADMIN_TOKEN` (Postgres only) the server also serves the operator's page at `/admin` and its API under `/admin/`: list and create tenants, mint a token that is shown once beside the tenant's welcome sheet, revoke tokens, disable tenants. Everything under `/admin`, the page included, needs the admin token: the browser asks for it (any user name, the token as the password) and an API client sends it as a bearer; a handful of wrong attempts from one address are throttled for a minute. Every change made there or with `log-admin` is recorded: who (the name entered at the browser prompt and the address, `bearer` for an API client, or the user and host for the command line), what (`tenant.add`, `tenant.disable`, `token.add`, `token.revoke`), which tenant, and the detail, never the token itself; the page shows it under Activity, `GET /admin/audit?tenant=&limit=` and `log-admin audit` list it, and a tenant reads their own rows at `GET /t/<name>/audit` with their token. Nothing else is stored by the page. Behind a reverse proxy, start the server with `--trust-proxy` so those per-address limits key on `X-Forwarded-For` instead of on the proxy's own address, and only there, since the header is otherwise the client's to forge. `--public-url` and `--checkpoints-url` fill the sheet in. The witness closes the last gap: `agent-custody witness --key witness.key --log-url <url> --checkpoints-url <url> --out <dir> [--tenant <name>]...` runs on a machine the log's operator does not control, fetches each watched log's latest checkpoint, verifies it against the log's published keys, proves with the log's consistency proof that it extends the last head the witness signed, and countersigns it into `<dir>/<tenant>/<size>.json` and `latest.json`; a checkpoint that does not extend, or a second history at the same size, gets `ALARM.json` instead. Its key document is `<dir>/.well-known/agent-custody-witness.json`. Serve `<dir>` from the witness's own host; verifiers add `--witness-url` (or `--witness-key`) to `audit`, and the newer head must then carry the witness's signature. Two more things an operator needs. `agent-custody log-check --log-url <url> --checkpoints-url <url> [--witness-url <url>] [--tenant <name>]... [--max-lag <seconds>]` is the outside monitor: it verifies the head against the published keys, that the latest checkpoint verifies and keeps up with the head, that the head extends the checkpoint, and, with a witness, that the witness has countersigned, keeps up, and has raised no alarm; it exits 1 on any failure, so cron or a scheduled workflow on a machine that is not the log's turns it into an alert. `GET /health` on the server is the liveness check for a load balancer. And `GET /admin/usage?month=YYYY-MM`, on the admin page and as `/admin/usage.csv`, is the metering: appends per tenant for the month, leaves in total, live tokens, the numbers any invoice rests on. A tenant needs none of that to leave with their evidence: `agent-custody log-export --log-url <url> --tenant <name> --token-env AGENT_CUSTODY_LOG_TOKEN --out <dir>` fetches, with their own token, every leaf hash (`GET /t/<name>/leaves?since=&limit=`, pages of up to ten thousand), the signed head, the published keys, the signed checkpoints, their own usage (`GET /t/<name>/usage?month=`), and the administrative actions on their tenant (`GET /t/<name>/audit`, into `audit.json`), checks that the head and every checkpoint verify against the keys and that the leaves fetched hash to their roots, and writes `log.jsonl` in the format `verify --log` and `audit --log` read, so the export verifies receipts with no server at all. It exits 1 and says what did not add up if anything does not. Both routes answer only to that tenant's token. [deploy/](../../deploy/README.md) runs the server, the signer, Postgres, and the checkpoints host as containers, and [deploy/witness/](../../deploy/witness/) the witness.
126
+ Exactly one of the two. The bearer token comes from the named environment variable, never from the file, and a missing variable fails at startup. Add `"hashOnly": true` for any log run by someone else: the gateway then sends only the leaf hash, sha256 of the receipt envelope with the RFC 6962 prefix, so the log commits to the receipt without ever holding it, and the receipts with their arguments and results stay in `receiptsDir`. The verifier does not change; it hashes the envelope itself. A log that serves several tenants is reached at `<url>/t/<tenant>/`, and each of its tree heads names its log, which a verifier checks with `--log-id`. With a remote log the tree head in each receipt is signed by the log's key, and a verifier must be given that key with `--log-key`. The gateway does not take the log's answer on trust either: the tree head in every append's answer must verify against the log's keys, name the expected log, match the proof's size, and the inclusion proof must place that very leaf under the signed root, all before a pre-committed call is forwarded and before any receipt is handed out; an answer that fails any of it is a refusal. `"keys": ["keys/log.pub"]` pins the log's public keys, `"logId"` the id its heads must carry; without `keys` the log's key document at `/.well-known/agent-custody-log.json` is fetched from the log itself once, on the first append, and pinned. That catches a log that turns dishonest later, not one that is dishonest from the start, so a gateway config with `precommit` and a remote log must list `keys`. When the log rotates its key, add the new public key to `keys`; a gateway that fetched the keys needs a restart. An append that gets no answer within `timeoutMs` (default 10000) counts as unreachable and is retried like a server error, so a log that accepts connections and never answers cannot hold a call forever. If the log refuses a leaf, the receipt is not issued and the call returns an error to the agent. For an ordinary call the upstream action has already happened by then, and the error says so; a receipt that was never logged must not be handed out. For a tool named in `precommit` the order is reversed, below, and the action never happens. A fact lookup is different: it runs before the policy decides, because the policy decides on it, and only once the intercepted tool is in the grant's scope, so a fact tool must be a read. Naming a fact tool in `precommit` is refused at startup; `"*"` covers the tools the agent calls, not the gateway's own lookups. Every lookup is on the receipt with its arguments. The reference log server is `node src/cli.ts log --file log.jsonl --key keys/log.key --port 8787 --token-env AGENT_CUSTODY_LOG_TOKEN [--log-id <id>] [--tenants tenants.json]`. It serves `POST /append` with `{leaf}` or `{leafHash}` (token required when one is configured), `GET /root?size=N`, `GET /consistency?old=M&new=N`, and `GET /head`; [verification.md](verification.md) says what each proves. `--log-id` writes that id into every tree head. `--tenants` names a JSON file, `{ "acme": { "file": "acme.jsonl", "tokenEnv": "ACME_TOKEN", "logId": "acme-eu" } }`, and each tenant is its own log at `/t/acme/…` with its own token and id; the default log stays at the root paths. With `--hash-only` the server refuses `{leaf}` at append and accepts only `{leafHash}`, so a log run for other people never receives a receipt regardless of the client's configuration; the hosted deployment sets it. With `--db-env DATABASE_URL` the server keeps its logs in Postgres instead of files, and needs the `pg` package beside it: leaves as hashes in one table keyed by tenant, one writer per tenant enforced with an advisory lock so a second instance is safe, tenants and their tokens in tables of their own with tokens stored only as hashes, and rate limits per token (50 appends a second, burst 100, a 64 KB body cap; a refused append answers 429 with `retry-after`, and the gateway's sink retries a few times). Tenants are managed with `log-admin --db-env DATABASE_URL`: `tenant add <id> [--log-id <id>]`, `token add <tenant> --label <text>` (the token is printed once), `token revoke <tenant> <hash-prefix>`, `tenant disable <id>`, `tenant plan <id> <free|team|enterprise>`, and `import --file log.jsonl [--tenant default]` to bring an existing file log in as hashes. Every tenant is on a plan, `free` unless moved: free allows ten thousand appends a calendar month, team a million, enterprise has no allowance. An append past the allowance is refused with 429, the numbers, and a `retry-after` that reaches the start of next month; the gateway behind it then withholds pre-committed calls, so a tenant out of quota never acts without evidence. The tenant's own `GET /t/<name>/usage` reports the plan and quota beside the month's appends. The tenant portal, `agent-custody portal --db-env DATABASE_URL --secret-env PORTAL_SECRET --public-url <log url> [--checkpoints-url <url>] [--portal-url <url>] [--stripe-key-env NAME --stripe-webhook-env NAME --stripe-price-team <price id>] [--trust-proxy]`, is the self-serve front of the same tables: a team registers with an email, a password (scrypt), and a tenant id and gets the tenant and its first key shown once with the welcome sheet; the dashboard shows appends against the plan, the tree size and root, the latest checkpoint, the log's URLs, keys, and the audit rows; keys are minted and revoked there, recorded as `portal:<email>`; the export command is on the page; and with the three Stripe variables the team plan is bought through Stripe Checkout, the signed webhook moving the plan (`stripe:<event>` in the audit trail) and the customer portal handling cancellation. Sessions are a signed cookie, `SameSite=Strict`, and every write needs a JSON body. Each member has a role (`owner`, `admin`, `reviewer`, `readonly`), an account can turn on TOTP MFA, and the operator can set up single sign-on through the tenant's own OIDC or SAML identity provider with `log-admin sso set`; the [hosted log reference](https://docs.agent-custody.dev/reference/hosted) lists the routes. SAML needs `@node-saml/node-saml` beside the CLI. The compose file runs it as the `portal` service at `PORTAL_HOST`. The root paths serve the tenant `default`, created on first start with `--log-id`, and `--token-env` still works for it. The key that signs tree heads can live in its own process: `agent-custody signer --key keys/log.key --port 8790 --token-env SIGNER_TOKEN` holds it and answers `POST /sign` with the shared secret and `GET /keys` to anyone; the log server then runs with `--signer-url http://signer:8790/ --signer-token-env SIGNER_TOKEN` instead of `--key`, and the process that faces the internet never holds the key. Either way the log serves its keys at `/.well-known/agent-custody-log.json`, current key first and retired keys (`--retired-key old.pub`) after it, so verifiers fetch and pin them with `verify --log-url` and `audit --log-url` rather than receiving a key file from the operator. With `--checkpoint-dir <dir>` the server publishes a signed checkpoint, every `--checkpoint-every` seconds (default 300), for each log whose tree has grown, and every `--checkpoint-heartbeat` seconds (default 21600, six hours) for a log that has not, so a quiet log's latest checkpoint is never more than six hours old and the monitor can tell quiet from stalled, as `<dir>/<tenant>/<treeSize>.json` and `latest.json`, and with a database also as rows; `GET /checkpoints?since=<size>` and `GET /t/<tenant>/checkpoints` list them. Serve the directory read-only from a second host, so the record of what the log signed does not depend on the log's API being up; a verifier who kept an earlier head audits against a later checkpoint with `audit --older <bundle> --newer <checkpoint> --log-url <url>`. With `--admin-token-env ADMIN_TOKEN` (Postgres only) the server also serves the operator's page at `/admin` and its API under `/admin/`: list and create tenants, mint a token that is shown once beside the tenant's welcome sheet, revoke tokens, disable tenants. Everything under `/admin`, the page included, needs the admin token: the browser asks for it (any user name, the token as the password) and an API client sends it as a bearer; a handful of wrong attempts from one address are throttled for a minute. Every change made there or with `log-admin` is recorded: who (the name entered at the browser prompt and the address, `bearer` for an API client, or the user and host for the command line), what (`tenant.add`, `tenant.disable`, `token.add`, `token.revoke`), which tenant, and the detail, never the token itself; the page shows it under Activity, `GET /admin/audit?tenant=&limit=` and `log-admin audit` list it, and a tenant reads their own rows at `GET /t/<name>/audit` with their token. Nothing else is stored by the page. Behind a reverse proxy, start the server with `--trust-proxy` so those per-address limits key on `X-Forwarded-For` instead of on the proxy's own address, and only there, since the header is otherwise the client's to forge. `--public-url` and `--checkpoints-url` fill the sheet in. The witness closes the last gap: `agent-custody witness --key witness.key --log-url <url> --checkpoints-url <url> --out <dir> [--tenant <name>]...` runs on a machine the log's operator does not control, fetches each watched log's latest checkpoint, verifies it against the log's published keys, proves with the log's consistency proof that it extends the last head the witness signed, and countersigns it into `<dir>/<tenant>/<size>.json` and `latest.json`; a checkpoint that does not extend, or a second history at the same size, gets `ALARM.json` instead. Its key document is `<dir>/.well-known/agent-custody-witness.json`. Serve `<dir>` from the witness's own host; verifiers add `--witness-url` (or `--witness-key`) to `audit`, and the newer head must then carry the witness's signature. Two more things an operator needs. `agent-custody log-check --log-url <url> --checkpoints-url <url> [--witness-url <url>] [--tenant <name>]... [--max-lag <seconds>]` is the outside monitor: it verifies the head against the published keys, that the latest checkpoint verifies and keeps up with the head, that the head extends the checkpoint, and, with a witness, that the witness has countersigned, keeps up, and has raised no alarm; it exits 1 on any failure, so cron or a scheduled workflow on a machine that is not the log's turns it into an alert. `GET /health` on the server is the liveness check for a load balancer. And `GET /admin/usage?month=YYYY-MM`, on the admin page and as `/admin/usage.csv`, is the metering: appends per tenant for the month, leaves in total, live tokens, the numbers any invoice rests on. A tenant needs none of that to leave with their evidence: `agent-custody log-export --log-url <url> --tenant <name> --token-env AGENT_CUSTODY_LOG_TOKEN --out <dir>` fetches, with their own token, every leaf hash (`GET /t/<name>/leaves?since=&limit=`, pages of up to ten thousand), the signed head, the published keys, the signed checkpoints, their own usage (`GET /t/<name>/usage?month=`), and the administrative actions on their tenant (`GET /t/<name>/audit`, into `audit.json`), checks that the head and every checkpoint verify against the keys and that the leaves fetched hash to their roots, and writes `log.jsonl` in the format `verify --log` and `audit --log` read, so the export verifies receipts with no server at all. It exits 1 and says what did not add up if anything does not. Both routes answer only to that tenant's token. [deploy/](../../deploy/README.md) runs the server, the signer, Postgres, and the checkpoints host as containers, and [deploy/witness/](../../deploy/witness/) the witness.
125
127
 
126
128
  `otel`, optional in both the gateway and SDK configs, sends every receipt to the collector you already run as one span over OTLP/HTTP, after the receipt is issued: `"otel": { "url": "http://localhost:4318", "headersEnv": { "x-api-key": "OTEL_KEY" }, "serviceName": "support-agents" }`. The span's trace id is the receipt id, its attributes carry the tool, agent, principal, execution status, policy decision, and log position, and its status is an error only when the upstream failed or errored, since a denial is the policy working. Export is best effort: a collector that is down or refuses costs a line on stderr, never a receipt. Tutorial 18 shows it against a stand-in collector.
127
129
 
@@ -163,6 +165,23 @@ The gateway checks again and consumes the approval id immediately before forward
163
165
 
164
166
  Under a private capture rule the receipt withholds the approval envelope as a commitment, because it carries the action fields and an unsalted digest of all arguments. The status, the times, and the signer key ids stay in clear. Full approval verification then requires the capture key or a disclosure. [The approval guide](approvals.md) covers signing, field mappings, failure recovery, and these privacy limits; [tutorial 30](../examples/30-payload-bound-approvals.ts) runs it end to end.
165
167
 
168
+ ## Review a transaction and export its case
169
+
170
+ The state package's `agent-custody-memory review` opens the receipts as a local review console, with one receipt's ten answers and verification report behind each index row:
171
+
172
+ ```bash
173
+ agent-custody-memory review --receipts receipts --issuer-key keys/gateway.pub --principal-key keys/principal.pub --transaction re_123 --customer cust_123 --agent support-agent --from 2026-10-01T00:00:00Z --to 2026-10-31T23:59:59Z
174
+ agent-custody-memory review --receipts receipts --issuer-key keys/gateway.pub --principal-key keys/principal.pub --out review-site/
175
+ agent-custody-memory review --receipts receipts --issuer-key keys/gateway.pub --principal-key keys/principal.pub --case <receiptId> --out refund.case.html
176
+ agent-custody-memory review --receipts receipts --issuer-key keys/gateway.pub --principal-key keys/principal.pub --case <receiptId> --out refund.case.json
177
+ agent-custody-memory review --verify-case refund.case.json --issuer-key keys/gateway.pub --principal-key keys/principal.pub --json
178
+ agent-custody-memory review --verify-case refund.case.html --issuer-key keys/gateway.pub --principal-key keys/principal.pub
179
+ ```
180
+
181
+ `--transaction`, `--customer`, and `--agent` match exact case-sensitive ids; all filters combine with AND. `--from` and `--to` are inclusive ISO date-times with `Z` or a UTC offset. Search covers public arguments, results, and gateway facts; a withheld identifier is unavailable. A record whose receipt id differs from its file name stays in the index as NOT VERIFIED, and the header counts the files that cannot be read. A receipt with a value that search skipped (deeper than 64 levels, or JSON text over 64 KiB) is marked "partially indexed" and stays in the list under an id filter. `--ledger <path>` adds belief dependencies, `--log-key <pub>` and `--log-id <id>` check the log, and `--upstream-key <pub>` checks signed upstream results. `--host` defaults to `127.0.0.1`, `--port` to `8791`; `--title <text>` labels the console. It has no authentication of its own. A directory export includes the index, receipt pages and bundles, and portable HTML/JSON cases; its browser search covers the exported set.
182
+
183
+ The standalone `.case.html` repeats cryptographic checks on the signed evidence with embedded WebCrypto code, offline and without external requests. That result is not independent, because the script is in the same file as the data, and the page does not compare the ten answers with the receipts. Check the `.case.html` or its JSON companion independently with `--verify-case`. The file name sets the format: `.json` is read as JSON, every other name is read as a page, and content that does not match fails. It rebuilds the ten answers from the signed receipt and prints them, it fails a `.case.html` that is not exactly what its data renders, and it exits 1 on failure. Trust the printed answers, not the page. The belief, dependency, and reversal lines come from the unsigned ledger snapshot and are not attested; public key flags may be repeated and replace the entire bundled trust set. Confirm bundled key fingerprints with a trusted source. Cases include signed receipts, authorizations, log heads and proofs, public keys, and the ten answers; explanation and ledger snapshots are unsigned exporter assertions. Verification proves the recorded gateway decision and detects receipt tampering, not an external payment side effect. Without a ledger the belief questions remain unknown. Private keys, capture keys, disclosures, and issuer salts files are not exported, and withheld values stay unavailable. [The state guide](../../state/README.md#explain-one-action) and [runnable example](../../state/examples/08-review-console.ts) cover the full flow.
184
+
166
185
  ## Financial operations
167
186
 
168
187
  For payments, configure `operations` to bind a caller-retained operation UUID to the full call, reserve its amount atomically, and pass an idempotency key to the provider. Existing operations are never forwarded again on retry, and an allowed retry gets a `withheld` receipt of its own. API execution and financial settlement have separate statuses; uncertain outcomes hold their reservations until an operator's provider read commits a reconciliation receipt. The [financial operations guide](financial-operations.md) has the config, provider contract, and `agent-custody reconcile` command. [Tutorial 29](../examples/29-financial-operations.ts) runs the lost-response/restart scenario offline.
@@ -209,7 +228,7 @@ The limits. A signed human approval carries its action fields and an unsalted fu
209
228
 
210
229
  ## One gateway for many agents, over HTTP
211
230
 
212
- `agent-custody gateway --config gateway.json --http --port 8790` serves the same gateway as an MCP server over Streamable HTTP at `/mcp`, and every connection presents its own grant: the delegation envelope, base64url-encoded, as `Authorization: Bearer <value>` or `X-Agent-Custody-Grant` on the initialize request. The gateway verifies it against `trustedPrincipalKeys` and its validity window, and opens a session for exactly that grant; a grant signed by a stranger, an expired one, or none at all gets 403 with the reason and no session (403 rather than 401, because MCP clients treat 401 as an OAuth challenge and hide the body). Sessions share the key, the policy, the upstreams, the log, and the fact lookups; each has its own tools (the scopes its grant names), its own receipts (its own principal and agent, attested), and its own consumed facts. `grantFile` in the config is then optional and ignored. A session ends when the client terminates it or after `--idle-minutes` (default 30) without a request; `GET /health` reports the live count and the gateway's key id. The transport is plain HTTP: bind to loopback, a private network, or put TLS in front. From JavaScript, `grantHeader(envelope)` builds the header value; from any language it is `base64url(JSON.stringify(envelope))`. Tutorial 20 runs two agents against one gateway.
231
+ `agent-custody gateway --config gateway.json --http --port 8790` serves the same gateway as an MCP server over Streamable HTTP at `/mcp`, and every connection presents its own grant: the delegation envelope, base64url-encoded, as `Authorization: Bearer <value>` or `X-Agent-Custody-Grant` on the initialize request. The gateway verifies it against `trustedPrincipalKeys` and its validity window, and opens a session for exactly that grant; a grant signed by a stranger, an expired one, or none at all gets 403 with the reason and no session (403 rather than 401, because MCP clients treat 401 as an OAuth challenge and hide the body). Sessions share the key, the policy, the upstreams, the log, and the fact lookups; each has its own tools (the scopes its grant names), its own receipts (its own principal and agent, attested), and its own consumed facts. `grantFile` in the config is then optional and ignored. A session ends when the client terminates it or after `--idle-minutes` (default 30) without a request; `GET /health` reports the live count and the gateway's key id. SIGINT or SIGTERM closes the gateway, so a container runtime or systemd stops it cleanly. The transport is plain HTTP: bind to loopback, a private network, or put TLS in front. From JavaScript, `grantHeader(envelope)` builds the header value; from any language it is `base64url(JSON.stringify(envelope))`. Tutorial 20 runs two agents against one gateway.
213
232
 
214
233
  ## The gateway as an A2A agent
215
234
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-custody/receipts",
3
- "version": "0.8.0",
3
+ "version": "0.9.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",
@@ -77,16 +77,19 @@
77
77
  "devDependencies": {
78
78
  "@electric-sql/pglite": "0.5.8",
79
79
  "@langchain/core": "^1.2.9",
80
+ "@node-saml/node-saml": "^5.1.0",
80
81
  "@openai/agents": "^0.18.0",
81
82
  "@types/node": "^26.4.1",
82
83
  "ai": "^7.0.92",
83
84
  "langchain": "1.5.15",
84
85
  "tsx": "^4.23.13",
85
86
  "typescript": "^7.0.2",
86
- "vitest": "^5.0.0"
87
+ "vitest": "^5.0.0",
88
+ "xml-crypto": "^6.1.2"
87
89
  },
88
90
  "peerDependencies": {
89
91
  "@langchain/core": ">=1.0.0",
92
+ "@node-saml/node-saml": ">=5.1.0",
90
93
  "@openai/agents": ">=0.1.0",
91
94
  "ai": ">=5.0.0",
92
95
  "pg": ">=8"
@@ -95,6 +98,9 @@
95
98
  "@langchain/core": {
96
99
  "optional": true
97
100
  },
101
+ "@node-saml/node-saml": {
102
+ "optional": true
103
+ },
98
104
  "@openai/agents": {
99
105
  "optional": true
100
106
  },
@@ -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": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMGI5NTIzZmNkZTBhZjVkOWY3YmEwNjBiN2FjNmJkZDhiMGQ5NWMyYThmNjQ2YWE3M2RkNjRkOWU1ZmY5YjA0NSIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuMzk1WiIsInRyZWVTaXplIjoxfQ==",
10
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNDFmNDQ1MTE3YmI4OWU4NzRhOWY1NjA1NzQxODM0N2ExYzU3NWIzNDI5YWZjOGJmMDlhNmI3YjY0ZmNlYWI5YyIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjEyWiIsInRyZWVTaXplIjoxfQ==",
11
11
  "signatures": [
12
12
  {
13
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
14
- "sig": "nnKYCsy34ZDyS7Cnt3phxIzBfmchs+Ref/0NdgCX4td6rDkuPilOxVNaDfverl20m0FPCKrBT4Q0lk4BF02jBg=="
13
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
14
+ "sig": "9fJ8slCUQ5On4gFkCUFGQY8Blc4ZvTZ0jvSKcemMV8zefuN5LCbv3nwRw8BDA+xjnJvTQH7JhqIya//djXQZDg=="
15
15
  }
16
16
  ]
17
17
  },
18
18
  "newer": {
19
19
  "payloadType": "application/vnd.agent-custody.treehead+json",
20
- "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMmRhOGE5MWUyZTVmZjNkYmQ4Y2U2YmQ4MWJmN2MzZDBkZmNlMjUwMzI1OGU1Y2M2YWRiNmNiZDVhOThlOGQ5YiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuNDAzWiIsInRyZWVTaXplIjoyfQ==",
20
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiYmY4MGQyNjdmMDI2M2VkNjQ1NjZiZjBlNzIxMmVjMmFmMjhiNjI1NzMwOTIxOWU3YjczMmNhMGUzYmEwZDY4NiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjIwWiIsInRyZWVTaXplIjoyfQ==",
21
21
  "signatures": [
22
22
  {
23
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
24
- "sig": "SgzzdIYTvzGe0YJwaar5BIoQsypXrqaqPMEUJ8dk+rHbxVMMoHhwEcpvw21irNpAuKOEwbEHJ+q6pVygJD4hDA=="
23
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
24
+ "sig": "xFcdpAHN42ACcRayJsaWGWy7IxCa0h3469G/mdY9byXkwOBi7+Rcx13M3YpwioPpyFgxF+uen4gu+za87pseBA=="
25
25
  }
26
26
  ]
27
27
  },
28
28
  "proof": [
29
- "2a06b62fb52f6ff6b0c0e80166cb7624270ea69b0482f503f69aacb08b03131a"
29
+ "98ea26e1dd78a60781a343423094bce56e9d2c0aa4288d29ec15bee26c647da5"
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": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMmRhOGE5MWUyZTVmZjNkYmQ4Y2U2YmQ4MWJmN2MzZDBkZmNlMjUwMzI1OGU1Y2M2YWRiNmNiZDVhOThlOGQ5YiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuNDAzWiIsInRyZWVTaXplIjoyfQ==",
44
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiYmY4MGQyNjdmMDI2M2VkNjQ1NjZiZjBlNzIxMmVjMmFmMjhiNjI1NzMwOTIxOWU3YjczMmNhMGUzYmEwZDY4NiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjIwWiIsInRyZWVTaXplIjoyfQ==",
45
45
  "signatures": [
46
46
  {
47
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
48
- "sig": "SgzzdIYTvzGe0YJwaar5BIoQsypXrqaqPMEUJ8dk+rHbxVMMoHhwEcpvw21irNpAuKOEwbEHJ+q6pVygJD4hDA=="
47
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
48
+ "sig": "xFcdpAHN42ACcRayJsaWGWy7IxCa0h3469G/mdY9byXkwOBi7+Rcx13M3YpwioPpyFgxF+uen4gu+za87pseBA=="
49
49
  }
50
50
  ]
51
51
  },
52
52
  "newer": {
53
53
  "payloadType": "application/vnd.agent-custody.treehead+json",
54
- "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMGI5NTIzZmNkZTBhZjVkOWY3YmEwNjBiN2FjNmJkZDhiMGQ5NWMyYThmNjQ2YWE3M2RkNjRkOWU1ZmY5YjA0NSIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuMzk1WiIsInRyZWVTaXplIjoxfQ==",
54
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNDFmNDQ1MTE3YmI4OWU4NzRhOWY1NjA1NzQxODM0N2ExYzU3NWIzNDI5YWZjOGJmMDlhNmI3YjY0ZmNlYWI5YyIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjEyWiIsInRyZWVTaXplIjoxfQ==",
55
55
  "signatures": [
56
56
  {
57
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
58
- "sig": "nnKYCsy34ZDyS7Cnt3phxIzBfmchs+Ref/0NdgCX4td6rDkuPilOxVNaDfverl20m0FPCKrBT4Q0lk4BF02jBg=="
57
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
58
+ "sig": "9fJ8slCUQ5On4gFkCUFGQY8Blc4ZvTZ0jvSKcemMV8zefuN5LCbv3nwRw8BDA+xjnJvTQH7JhqIya//djXQZDg=="
59
59
  }
60
60
  ]
61
61
  },
62
62
  "proof": [
63
- "2a06b62fb52f6ff6b0c0e80166cb7624270ea69b0482f503f69aacb08b03131a"
63
+ "98ea26e1dd78a60781a343423094bce56e9d2c0aa4288d29ec15bee26c647da5"
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": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMGI5NTIzZmNkZTBhZjVkOWY3YmEwNjBiN2FjNmJkZDhiMGQ5NWMyYThmNjQ2YWE3M2RkNjRkOWU1ZmY5YjA0NSIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuMzk1WiIsInRyZWVTaXplIjoxfQ==",
80
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNDFmNDQ1MTE3YmI4OWU4NzRhOWY1NjA1NzQxODM0N2ExYzU3NWIzNDI5YWZjOGJmMDlhNmI3YjY0ZmNlYWI5YyIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjEyWiIsInRyZWVTaXplIjoxfQ==",
81
81
  "signatures": [
82
82
  {
83
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
84
- "sig": "nnKYCsy34ZDyS7Cnt3phxIzBfmchs+Ref/0NdgCX4td6rDkuPilOxVNaDfverl20m0FPCKrBT4Q0lk4BF02jBg=="
83
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
84
+ "sig": "9fJ8slCUQ5On4gFkCUFGQY8Blc4ZvTZ0jvSKcemMV8zefuN5LCbv3nwRw8BDA+xjnJvTQH7JhqIya//djXQZDg=="
85
85
  }
86
86
  ]
87
87
  },
88
88
  "newer": {
89
89
  "payloadType": "application/vnd.agent-custody.treehead+json",
90
- "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMmRhOGE5MWUyZTVmZjNkYmQ4Y2U2YmQ4MWJmN2MzZDBkZmNlMjUwMzI1OGU1Y2M2YWRiNmNiZDVhOThlOGQ5YiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuNDAzWiIsInRyZWVTaXplIjoyfQ==",
90
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiYmY4MGQyNjdmMDI2M2VkNjQ1NjZiZjBlNzIxMmVjMmFmMjhiNjI1NzMwOTIxOWU3YjczMmNhMGUzYmEwZDY4NiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjIwWiIsInRyZWVTaXplIjoyfQ==",
91
91
  "signatures": [
92
92
  {
93
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
94
- "sig": "SgzzdIYTvzGe0YJwaar5BIoQsypXrqaqPMEUJ8dk+rHbxVMMoHhwEcpvw21irNpAuKOEwbEHJ+q6pVygJD4hDA=="
93
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
94
+ "sig": "xFcdpAHN42ACcRayJsaWGWy7IxCa0h3469G/mdY9byXkwOBi7+Rcx13M3YpwioPpyFgxF+uen4gu+za87pseBA=="
95
95
  }
96
96
  ]
97
97
  },
98
98
  "proof": [
99
- "2a06b62fb52f6ff6b0c0e80166cb7624270ea69b0482f503f69aacb08b03131a"
99
+ "98ea26e1dd78a60781a343423094bce56e9d2c0aa4288d29ec15bee26c647da5"
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": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMGI5NTIzZmNkZTBhZjVkOWY3YmEwNjBiN2FjNmJkZDhiMGQ5NWMyYThmNjQ2YWE3M2RkNjRkOWU1ZmY5YjA0NSIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuMzk1WiIsInRyZWVTaXplIjoxfQ==",
117
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiNDFmNDQ1MTE3YmI4OWU4NzRhOWY1NjA1NzQxODM0N2ExYzU3NWIzNDI5YWZjOGJmMDlhNmI3YjY0ZmNlYWI5YyIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjEyWiIsInRyZWVTaXplIjoxfQ==",
118
118
  "signatures": [
119
119
  {
120
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
121
- "sig": "nnKYCsy34ZDyS7Cnt3phxIzBfmchs+Ref/0NdgCX4td6rDkuPilOxVNaDfverl20m0FPCKrBT4Q0lk4BF02jBg=="
120
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
121
+ "sig": "9fJ8slCUQ5On4gFkCUFGQY8Blc4ZvTZ0jvSKcemMV8zefuN5LCbv3nwRw8BDA+xjnJvTQH7JhqIya//djXQZDg=="
122
122
  }
123
123
  ]
124
124
  },
125
125
  "newer": {
126
126
  "payloadType": "application/vnd.agent-custody.treehead+json",
127
- "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiMmRhOGE5MWUyZTVmZjNkYmQ4Y2U2YmQ4MWJmN2MzZDBkZmNlMjUwMzI1OGU1Y2M2YWRiNmNiZDVhOThlOGQ5YiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMThUMTg6MTU6MTkuNDAzWiIsInRyZWVTaXplIjoyfQ==",
127
+ "payload": "eyJsb2ciOiJ2ZWN0b3JzLWxvZyIsInJvb3RIYXNoIjoiYmY4MGQyNjdmMDI2M2VkNjQ1NjZiZjBlNzIxMmVjMmFmMjhiNjI1NzMwOTIxOWU3YjczMmNhMGUzYmEwZDY4NiIsInRpbWVzdGFtcCI6IjIwMjYtMTAtMTlUMTA6MzE6MzAuMjIwWiIsInRyZWVTaXplIjoyfQ==",
128
128
  "signatures": [
129
129
  {
130
- "keyid": "158f241c3f03fef38c33231e2b8047f7b47dbb2486c1ac5a3e438168ecb4a258",
131
- "sig": "SgzzdIYTvzGe0YJwaar5BIoQsypXrqaqPMEUJ8dk+rHbxVMMoHhwEcpvw21irNpAuKOEwbEHJ+q6pVygJD4hDA=="
130
+ "keyid": "40961c5d659b9e97ee70ae416c6996584c715ad04e41e0b178b09d94272fada6",
131
+ "sig": "xFcdpAHN42ACcRayJsaWGWy7IxCa0h3469G/mdY9byXkwOBi7+Rcx13M3YpwioPpyFgxF+uen4gu+za87pseBA=="
132
132
  }
133
133
  ]
134
134
  },