Skip to content

Audit

Partial

The audit log answers “who changed this, and to what?”: every mutation is recorded once, at the source. To read it, see the admin Audit page.

audit_log is ground truth, not derived: one row per mutation, carrying actor, verb, resource, resource_id and the old and new images.

  • Written in the same transaction. Every API write emits its row in the transaction that makes the change, in the storage layer, so it cannot be forgotten or bypassed.
  • resource_id is the primary key, never the name. A named entity is addressable by uuid or by a renameable handle, so recording whichever the caller used would give one entity two audit keys. The name at the time is in the images, a point-in-time snapshot rather than a key. A guard fails on a writeAuditRes argument that is not primary-key shaped.
  • A row outlives its subject. resource_id is text and never a foreign key. An update carries the moved fields in both images and enough of the subject to name it; a delete carries the whole subject in old. Images are read under the row’s lock, so they are the state the write replaced. Where there is no row to lock, an advisory lock stands in: an append-only series (property values) has no single row, and a create-or-update path (settings) may not have its row yet. A secret’s image is its metadata and a digest of the sealed value, never the plaintext, and the password verbs carry no field images (ADR-1442).
  • The actor is a person, machine user or outpost, resolved by the Storage Gateway, the one layer every database read and write passes through, to its identifier and snapshotted on the row (actor_username), so the trail stays attributable after the actor is purged (ADR-0016, ADR-0110). An impersonated action records both actors.
  • How it arrived rides beside the actor. A row carries channel and client: an MCP call reads channel = 'mcp' with the client the caller declared, and an omnibot run reads omnibot, stamped from the credential and never claimed by the caller (ADR-1162).
  • An agent token names its agent. A row written with an agent token carries agent beside the person, on every channel (ADR-1179).
  • A token is audited. Minting and revoking write rows carrying the prefix, purpose and expiry, never the token or its hash.

Login and logout run on read paths with no transaction, so they emit through a standalone seam under resource = 'auth', with the verbs login, logout, login_failed, login_denied, login_locked and revoke_session, and agent_refused when the install’s agent policy refuses an agent’s call.

Every read of secret material writes a row, with distinct reveal and copy verbs, and that subset cannot be filtered away. Other reads are not audited.

GET /audit-log is gated by audit:read:admin, out of a wildcard’s reach, so only admin and owner see it. Rows return newest first, filterable by resource, verb, agent, channel and client, paged backward with before and limit (default 100, at most 500). Redaction is the write side’s: the read passes images through verbatim.

Audit is append-only by construction and meant to have the longest retention of any log.