Append a tamper-evident audit-chain entry
append_audit_entryAppend a tamper-evident entry to a hash-chained audit log, returning the updated chain so a third party can verify event integrity independently.
Instructions
Appends one entry to an append-only, hash-chained audit log and returns the new (longer) chain. Each entry's hash binds its payload, index, createdAt, a fixed format tag (formatVersion, currently "audit-chain-kit/v1"), and the previous entry's hash together, so any later tampering with an earlier entry -- or an entry produced by an incompatible version of audit-chain-kit -- breaks the chain in a way verify_audit_chain will detect. Use this wherever you need a tamper-evident record of events (agent actions, approvals, state transitions) that a skeptical third party can later verify independently. This function does not persist anything itself -- store the returned chain (or just the new entry) in whatever your app already uses.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | The existing chain, in order, exactly as previously returned/stored. Pass [] to start a new chain. | |
| payload | Yes | Caller data for the new entry -- any JSON-serializable value. |