audit only.Expand description
Tamper-evident audit records (ADR 0015).
An AuditRecord says who did what to which task, when, and in which
trace, with the content it concerned recorded by SHA-256 digest. Records
form one hash chain per tenant: each carries the hash of the one before,
so an edit, insertion, deletion or reordering anywhere is found by
verify_chain. Checkpoints, signed with ES256 or Ed25519, vouch for
how far the chain had reached, so cutting records off the end is found
too, back to the last checkpoint.
This module is pure data and verification: it writes nothing anywhere.
The server crate’s audit module records calls and task events into it,
and the a2a command line verifies an exported chain with it.
What it does not do: the time in a record is the writer’s clock, not a trusted timestamp, and a writer holding the signing key can rewrite the whole chain and re-sign it. Tamper evidence here is against anyone who can edit the store but does not hold the key — keep the key elsewhere, and export checkpoints off the machine.
Modules§
- kind
- The record kinds this crate writes.
Structs§
- Actor
- Who a call was made by, as authentication established it.
- Audit
Record - One entry in an audit chain.
- Chain
Failure - Where and why a chain failed to verify.
- Chain
Report - What
verify_chainfound. - Checkpoint
- A signed statement of how far a chain had reached.
- Checkpoint
Signer - A private key that signs checkpoints.
- Outcome
- How a call ended.
- Trace
Ref - The W3C trace a record belongs to, for joining it to the spans of the same call across agents.
- Trusted
Key - A public key a verifier trusts to have signed checkpoints.
Enums§
- Signing
Alg - The signature algorithms a checkpoint can be signed with.
Constants§
- CHECKPOINT_
SCHEMA - The schema identifier every checkpoint of this version carries.
- MAX_SEQ
- The largest sequence number a record can carry.
- SCHEMA
- The schema identifier every record of this version carries.
Functions§
- digest_
bytes "sha256:<hex>"over raw bytes.- digest_
of "sha256:<hex>"over the canonical JSON of any serializable value.- digest_
value "sha256:<hex>"over the RFC 8785 canonical form ofvalue.- verify_
chain - Verifies
records, which must be one chain inseqorder, against thecheckpointswritten for it, trusting signatures bykeys. - verify_
checkpoint - Checks a checkpoint’s signature against the keys a verifier trusts.