---
library: "bootstrap"
slug: "AuditTrail"
name: "AuditTrail"
ref: "AuditTrail#163b"
hash: "sema:AuditTrail#mh:SHA-256:163b784f86e448340b94d0459483f0f476e052b5b7c589113f5c7df5dd1115a8"
type: "Verification"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/AuditTrail"
---

# AuditTrail

Immutable append-only log of agent actions for compliance and debugging

Infrastructure · Verification

## Mechanism

Every consequential [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) action (state mutation, external call, delegation, decision) appends a [Sign](https://semahash.org/vocabularies/bootstrap/patterns/Sign.md)ed entry to an immutable [Ledger](https://semahash.org/vocabularies/bootstrap/patterns/Ledger.md) whose sequence number advances via [MonotonicCounter](https://semahash.org/vocabularies/bootstrap/patterns/MonotonicCounter.md), so no entry can be wedged between two existing ones. Each entry contains: timestamp, [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) [Identity](https://semahash.org/vocabularies/bootstrap/patterns/Identity.md), action type, input hash, output hash, and the sema pattern invoked. Extends [Trace](https://semahash.org/vocabularies/bootstrap/patterns/Trace.md) from single-entity lineage to cross-agent compliance logging. The trail is append-only — entries cannot be modified or deleted. For cross-agent auditing, individual trails are aggregated via Merkle roots into a shared [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md), enabling any party to verify the complete history without accessing raw entries.

## Invariants

- Append-Only: No entry in the [Ledger](https://semahash.org/vocabularies/bootstrap/patterns/Ledger.md) may be modified after creation
- Every entry must be [Sign](https://semahash.org/vocabularies/bootstrap/patterns/Sign.md)ed by the acting [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md)
- [Trace](https://semahash.org/vocabularies/bootstrap/patterns/Trace.md) provenance must link each entry to the sema pattern that triggered it

## Signature

- Trace(Ledger)

## Preconditions

- [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) has established [Identity](https://semahash.org/vocabularies/bootstrap/patterns/Identity.md)
- [Ledger](https://semahash.org/vocabularies/bootstrap/patterns/Ledger.md) is accessible and writable

## Postconditions

- Action recorded with full provenance in [Ledger](https://semahash.org/vocabularies/bootstrap/patterns/Ledger.md)
- [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md) of trail Merkle root available for external verification

## Failure modes

- Storage exhaustion (unbounded trail growth in long-running systems).
- Clock skew (distributed agents disagree on timestamps — use logical clocks).
- Selective logging (agent omits inconvenient entries — requires external [Audit](https://semahash.org/vocabularies/bootstrap/patterns/Audit.md)).

## Where this came from

—

## Builds on

- [Identity](https://semahash.org/vocabularies/bootstrap/patterns/Identity.md) (references)
- [Agent](https://semahash.org/vocabularies/bootstrap/patterns/Agent.md) (references)
- [Audit](https://semahash.org/vocabularies/bootstrap/patterns/Audit.md) (references)
- [Sign](https://semahash.org/vocabularies/bootstrap/patterns/Sign.md) (references)
- [Ledger](https://semahash.org/vocabularies/bootstrap/patterns/Ledger.md) (references)
- [Trace](https://semahash.org/vocabularies/bootstrap/patterns/Trace.md) (references)
- [MonotonicCounter](https://semahash.org/vocabularies/bootstrap/patterns/MonotonicCounter.md) (references)
- [Snapshot](https://semahash.org/vocabularies/bootstrap/patterns/Snapshot.md) (composes_with)

## Related

- [SpotAudit](https://semahash.org/vocabularies/bootstrap/patterns/SpotAudit.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: AuditTrail#163b
- Hash: sema:AuditTrail#mh:SHA-256:163b784f86e448340b94d0459483f0f476e052b5b7c589113f5c7df5dd1115a8

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/AuditTrail
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/AuditTrail.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
