Skip to content

For An Auditor: Reading Under A Grant, And Checking It Offline ​

This guide is for an outside auditor: someone a developer or an organization (or a registry's own administrator) lets read a closed list of its records, for a stated purpose and a limited time. What an audit grant is, its scopes and every rule it follows, is in chapter 42; this page says what you do with one, and every step below was run on the network's sandbox before it was written.

Switched off on the production frames for now. Audit grants (AUDIT_GRANTS_MODE) default to off, and turning them on is a separate decision on each frame. Where they are off, every route below answers 404 and the console shows no Audit access tab.

Who opens a grant ​

You never open a grant yourself; the side being audited does:

  • a developer, for their own account;
  • an organization's owner, for the organization;
  • for a registry's own records (its money, or its compliance records), one administrator with the platform flag, who must also prove presence with a two-factor code.

The grant names you, a purpose (required) and a reference if there is one (an engagement or a warrant number), and runs for 1 to 30 days. You may hold it on this registry, or on another one: an auditor on another registry reads through their own home (chapter 42, "An auditor on another registry").

1. See what you hold ​

In the console: Settings, Audit access. It lists the grants about you and the grants you hold, each with its scope, purpose, dates and its read log. By API, GET /api/v1/audit-grants answers both lists (held is yours), and GET /api/v1/audit/{grant_id} lists the reads the grant serves, each with what it reads. For a developer grant those are account (the account's own export: profile, agents and cards, key and webhook metadata, memberships, purchases, legal acceptances), transactions (the ledger events of the account's own agents) and openings.

2. Read ​

Each read is one call: GET /api/v1/audit/{grant_id}/{read}. The answer names the grant, the read and when it was served, and carries the data. Every time, not once at the start, the registry checks that the grant is live, that you are its auditor, that the read is in the scope's closed list (anything else is refused, out_of_scope, with the list it allows), that you are under the grant's hourly cap, and that whoever opened it still holds the authority they granted.

Every read leaves a mark before it is answered. One row goes into the grant's read log first (the read, when, who read it, how many rows, and the sha256 of the exact answer served); a read that cannot be logged is not served. The side being audited sees that log as it grows. Whatever the read returns, e-mail addresses, passwords, keys, client secrets, two-factor material, credentials of every kind, recovery codes and direct messages are removed first and read [withheld].

Keep the answers. You will need them to check the evidence later.

3. Ask for an opening ​

An attestation proves a rule held for figures its agent committed to, without showing them. Under a grant over an account or an organization you can ask for the opening of one attestation: the committed figures and their salt, delivered sealed to a key only you hold.

  • Name your key first. In Settings, Audit access, on a live grant you hold, the Openings area takes your X25519 public key (32 bytes, base64). By API: PUT /api/v1/audit-grants/{grant_id}/opening-key with {"opening_key": "<base64>"}. A key that is not one answers 422 with what it must be. Asking before naming one is refused (409, no_opening_key).
  • Ask by the attestation's id. POST /api/v1/audit-grants/{grant_id}/openings with {"attestation_id": "<id>"}. The attestation must be a verified one of the grant's subject (the developer's own agents, or the organization's); any other id answers 404, no_attestation.
  • The agent delivers it. The attestation's own agent sees the request and seals the figures to your key (HPKE, RFC 9180); the registry carries the sealed opening and never holds the key to read it. You open it and check it offline: the SDK re-runs the policy's circuit with the opened figures and refuses an opening whose commitment is not the attestation's.

Delivered openings are served as the openings read, logged like any other.

4. Check the evidence offline ​

When you are done (or at any time), take the grant's signed evidence manifest: GET /api/v1/audit-grants/{grant_id}/evidence. It lists every read in the order served, each with the sha256 of its answer, a Merkle root over them, and a signature with the key the registry publishes at GET /api/v1/attestations/signing-pubkey (pubkey_b64, pubkey_id). The registry signs the log, never the answers: you hold those.

The SDK joins the manifest and your answers into one archive (make_bundle(manifest, answers) in theprotocol.registry.audit_evidence) and checks it with nothing but the registry's public key, no network:

python -m theprotocol.registry.audit_evidence bundle.json <pubkey_b64>

It prints VALID: grant ..., N read(s), every answer the one the frame served, signed by the key given, or NOT VALID and why: a changed answer, a dropped or added read, or an edited manifest each fails. On the sandbox a bundle of two reads read VALID, and the same bundle with one answer changed read NOT VALID: answer: the answer to read 0 (account) is not the one served. This checker is in theprotocol-sdk 0.12.0 and later: install the checkers with pip install "theprotocol-sdk[verify]" (the verify extra brings the signature library the checks need); the release line's checker below is in the same install.

5. Check a release line's signed report offline ​

An organization's grant can read its release lines (release_lines). Each line publishes a signed report of what was built and what it contained (GET /api/v1/code-distributions/{slug}/report, for the organization's members and its grant), and you can check it offline against the registry's published keys (/.well-known/registry-jwks.json) with the published SDK:

python -m theprotocol.registry.distribution_report report.json jwks.json

It prints VALID: distribution.release.report <line> (N change(s)), signed by the registry's published key, and NOT VALID with the field when a single value inside the report was changed.

6. When it ends ​

A grant ends on its date, when the side being audited revokes it, or when you return it yourself (POST /api/v1/audit-grants/{grant_id}/revoke, from either side, with an optional reason). A read after that is refused (403, revoked). A grant never renews on its own; the longest is 30 days.

What you can never do ​

  • Write anything. Every read is a read; nothing under a grant changes the audited side.
  • Read beyond the list. The scope's closed list is the registry's, never yours to name.
  • Read unseen. The audited side sees every read as it happens, and every read is logged before it is answered.

For an AI assistant ​

The auditor-readonly tool preset gives your assistant exactly four read tools over your own credential: listAuditGrants, getAuditGrant, listAuditGrantReads and getAuditGrantRead. Issuing and revoking are the audited side's acts and are no tool.

Server components AGPL-3.0-or-later · SDKs and the auditor Apache-2.0 · this documentation CC BY 4.0. If a doc and the running stack disagree, trust the stack. Legal notice (Impressum) · Privacy · Terms