Skip to content

Audit Grants: Letting An Outside Auditor Read What You Own ​

Switched off on the production frames for now. Audit grants are built (V0671, with the evidence manifest in V0672 and member notices in V0674), and AUDIT_GRANTS_MODE defaults to off: turning it on is a separate decision on each frame. The sandbox frames run it. How an auditor works with a grant, step by step: chapter 45.

An audit grant lets a party that owns something give an outside auditor the right to read it: a scoped, expiring, fully logged read. The auditor needs no account on the thing being audited and no administrator's help; the audited side opens the grant, can see every read served under it, and can end it at any moment.

The rail is off by default. Where AUDIT_GRANTS_MODE is off, every route answers a plain 404, nothing is written, the console shows no Audit access tab and the auditor's tools are not listed. Turn it on and the rules below hold.

The short version ​

  1. The audited side issues a grant: a scope, an auditor, a purpose, and an expiry of at most 30 days.
  2. The auditor reads what that scope serves. Every read is written to a log before the answer leaves.
  3. The audited side watches the log and may revoke at any time.
  4. The auditor can take a signed evidence manifest of the log and check it offline, with the answers they kept.
  5. Under a developer or organization grant the auditor can also ask for an opening of an attestation, sealed to a key only they hold.

Four scopes ​

ScopeWho issuesWhat the auditor may read
developera developer, for their own accountaccount (the account's own export: profile, agents and cards, key and webhook metadata, memberships, purchases, legal acceptances), transactions (the ledger events of their own agents), openings
organizationthe organization's owner, for the organizationmembers (names and roles), agents, teams, trail (its audit trail), treasury (its account and live balance), work_orders (its Guild orders), release_lines, content_changes (its compliance packs among them), openings
frame_moneyone administrator with the platform flag, with a presence proofsupply (the frame's supply verdict from its own ledger), balances (by DID only), emission_policy
frame_compliancethe samethe three money reads, plus jurisdiction, regulatory_authorizations (revoked ones included) and code_changes (with their checker records and ballots)

The list of reads is closed: a read that is not in the scope's list is refused, and each scope's list is what the service holds, never something the auditor names. A read reuses the route the registry already has for that data; there is no second assembler of the same facts.

The presence proof for a frame-wide grant is the two-factor step-up the platform already uses for liability mandates. The administrator must have two-factor sign-in turned on (without it the grant is refused with a 412). A code is accepted across three 30-second steps, a used code cannot be used again, and five wrong codes in 15 minutes lock issuing for that administrator.

What a grant says ​

A grant carries the scope, the auditor, a purpose (required, up to 500 characters), an optional reference (an engagement or a warrant number), and an expiry from 1 to 30 days. The auditor is one of:

  • a developer of this registry, named by id or by handle; or
  • a developer of another registry, named by that registry and their id there (see "An auditor on another registry").

Every read is checked, and logged first ​

At every read, not once at issue, the registry checks that:

  • the grant is live (not revoked, not expired);
  • the caller is its auditor;
  • the read is in the scope's closed list;
  • the grant is under its hourly cap (60 reads an hour unless the registry sets AUDIT_GRANT_RATE_PER_HOUR);
  • the party that issued it still holds the authority it granted. This is re-derived on every read and never snapshotted: an organization owner who is no longer an owner has granted nothing, and the grant stops serving.

The same question is also asked of the policy engine (policy agentvault.audit). It can only refuse more, never serve what the registry refused.

One row is written to the read log before the answer leaves. A read that cannot be logged is not served: the caller gets a 503. So the log cannot be shorter than what was served.

What never leaves ​

Whatever the reused read returned, these are removed before anything leaves, by key name and by value shape: e-mail addresses, passwords, API keys, client secrets, two-factor material, credentials of every kind, recovery codes, and direct messages. A removed value reads [withheld].

Who sees it, who ends it ​

  • A developer's grant is seen and ended by that developer.
  • An organization's grant is seen and ended by the organization's owners and administrators (only an owner can issue one).
  • A frame-wide grant is seen and ended by the frame's platform administrators.
  • The auditor sees the grants they hold and can return one, which ends it.

The audited party is told when a grant is issued for it and on the first read of each day; the auditor is told when they receive one. For an organization, every active member is told when a grant over it opens and when it is withdrawn or closed early (a member who has left is not told): the notice says who may read, what, for which purpose and until when, and where to see it (Settings, Audit access). It arrives in the app unless the member's own notification preferences say otherwise, and no member's approval is asked: the notice informs. Reads are visible live: there is no delayed-log kind of grant.

In the console, the Audit access tab of Settings lists the grants about you and the grants you hold, with each grant's read log. It is shown only where the registry serves audit grants.

An auditor on another registry ​

An auditor whose account is on another registry reads through their own home, on the same federation lane the developer passport uses, with a second purpose, audit_read.

  • Their home signs a fresh developer card for each read, naming the grant and the read, and writes its own disclosure row first: no row, no card.
  • The card discloses only what the audited registry records: the auditor's id at home and public name, the home, their standing, and the agent that carries the card.
  • The audited registry checks the card's shape, purpose and age, that the presenter is the card's home (an active peer whose licence verdict passes), and the signature against the home's published keys. A home in bad standing for its developer reads nothing.
  • Then the grant's own checks run, with the read logged naming the remote reader.

The evidence manifest ​

GET /api/v1/audit-grants/{grant_id}/evidence returns a signed manifest of the grant's reads, for the audited side and the auditor. The registry signs the read log, never the answers: each read records the digest of the exact answer it served. The manifest lists every read in order, a Merkle root over them, the grant it was served under and who issued it, and is signed in the attestation bundle's own format with the key the registry publishes at /api/v1/attestations/signing-pubkey.

The auditor keeps the answers. The Python SDK (theprotocol.registry.audit_evidence, in theprotocol-sdk 0.12.0 and later, installed with pip install "theprotocol-sdk[verify]") joins the two into one archive and checks it offline: the signature, the root, and every answer against its signed digest. A changed answer, a dropped or added read, or an edited manifest fails the check. The manifest also carries, where they can be read, the registry's signed card and the event store's settled sequence; none is needed for the offline check.

Openings ​

An attestation proves a rule held for figures its agent committed to; it does not show the figures. Under a developer or organization grant the auditor can ask for the opening of one attestation's commitment.

  1. The auditor names an X25519 public key on the grant (PUT .../opening-key).
  2. The auditor asks for one attestation's opening (POST .../openings). The attestation must be verified and belong to the grant's subject (the developer's own agents, or the organization's agents).
  3. The attestation's own agent sees the request (GET /api/v1/agent/audit-openings) and delivers the figures and the salt sealed to the auditor's key (HPKE, RFC 9180).
  4. The registry carries the sealed opening and never holds the key to read it. The auditor opens it and checks 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.

The delivered openings are served as the openings read, logged like any other, so the evidence manifest records each one's digest. An opening never reaches the ledger or a public surface.

In the console. The auditor's side is in Settings, Audit access: on a grant you hold that is live and over an account or an organization, an Openings area names the key (a 32-byte base64 key; a key the server refuses is shown with its words) and asks an opening by the attestation's id; each answer is listed with its state and the agent it was asked of. The registry keeps no list of the openings a grantee asked, so the list is what you asked in that visit. The audited agent's side is a panel on its page in My Agents, Audit openings: what was asked of the selected agent, by which grant, and the key and suite to seal each to. Delivering is still the agent's own act through the API (the SDK seals it); neither page delivers one.

For an AI assistant: the auditor preset ​

The auditor-readonly tool preset lists exactly four read tools, for the auditor's developer credential: listAuditGrants, getAuditGrant, listAuditGrantReads and getAuditGrantRead. Issuing and revoking are the audited side's writes and are no tool. Where the rail is off the tools are not listed.

What it does not do ​

  • It never writes to the audited thing; every read is a read.
  • It gives no one else's data: a developer grant reads that developer's own scope; an organization grant reads that organization's.
  • It does not make a private assessor a regulator. A private assessor works through audit grants; a regulator is a different thing (chapter 43).
  • It ends by itself: the longest grant is 30 days, and a grant never renews on its own.

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