---
slug: "AuditTrail"
name: "AuditTrail"
type: "Verification"
layer: "Infrastructure"
ref: "AuditTrail#163b"
sema_id: "sema:AuditTrail#mh:SHA-256:163b784f86e448340b94d0459483f0f476e052b5b7c589113f5c7df5dd1115a8"
tags: ["Infrastructure","Verification"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/AuditTrail/
related: ["Snapshot","Agent","Audit","Identity","Ledger","MonotonicCounter","Sign","Trace","SpotAudit"]
---

# AuditTrail

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

Layer: Infrastructure · Category: Verification

## Mechanism

Every consequential [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) action (state mutation, external call, delegation, decision) appends a [Sign](https://mindscape.pages.dev/bootstrap/Sign.md)ed entry to an immutable [Ledger](https://mindscape.pages.dev/bootstrap/Ledger.md) whose sequence number advances via [MonotonicCounter](https://mindscape.pages.dev/bootstrap/MonotonicCounter.md), so no entry can be wedged between two existing ones. Each entry contains: timestamp, [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) [Identity](https://mindscape.pages.dev/bootstrap/Identity.md), action type, input hash, output hash, and the sema pattern invoked. Extends [Trace](https://mindscape.pages.dev/bootstrap/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://mindscape.pages.dev/bootstrap/Snapshot.md), enabling any party to verify the complete history without accessing raw entries.

## Invariants

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

## Preconditions

- [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) has established [Identity](https://mindscape.pages.dev/bootstrap/Identity.md)
- [Ledger](https://mindscape.pages.dev/bootstrap/Ledger.md) is accessible and writable

## Postconditions

- Action recorded with full provenance in [Ledger](https://mindscape.pages.dev/bootstrap/Ledger.md)
- [Snapshot](https://mindscape.pages.dev/bootstrap/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://mindscape.pages.dev/bootstrap/Audit.md)).

## Signature

- `Trace(Ledger)`

## Builds on

- [Snapshot](https://mindscape.pages.dev/bootstrap/Snapshot.md) (Infrastructure; Composes with)
- [Agent](https://mindscape.pages.dev/bootstrap/Agent.md) (Mind; References)
- [Audit](https://mindscape.pages.dev/bootstrap/Audit.md) (Infrastructure; References)
- [Identity](https://mindscape.pages.dev/bootstrap/Identity.md) (Infrastructure; References)
- [Ledger](https://mindscape.pages.dev/bootstrap/Ledger.md) (Infrastructure; References)
- [MonotonicCounter](https://mindscape.pages.dev/bootstrap/MonotonicCounter.md) (Society; References)
- [Sign](https://mindscape.pages.dev/bootstrap/Sign.md) (Infrastructure; References)
- [Trace](https://mindscape.pages.dev/bootstrap/Trace.md) (Infrastructure; References)

## Used by

—

## Identity

- Sema ID: `sema:AuditTrail#mh:SHA-256:163b784f86e448340b94d0459483f0f476e052b5b7c589113f5c7df5dd1115a8`
- Ref: `AuditTrail#163b`
- Supersedes:
  - `sema:AuditTrail#mh:SHA-256:ff66d6d56fc4208d20e8bb1835ea9a04dc23269ced480e27c2cebb2f2fa6890c`
  - `sema:AuditTrail#mh:SHA-256:b4419b5e90a6a7c5433fe5bcb459ca9fbff9cbd7d48ccf9b44b0b64166959551`
  - `sema:AuditTrail#mh:SHA-256:bf18738b25414c907d542cc6971b13ecf1fb7b415d10529f1c398a1e08109f92`
  - `sema:AuditTrail#mh:SHA-256:46f73da14d15073869646008bafb50651a875287b559885fda3ae578c8ebbaa9`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/AuditTrail/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#AuditTrail)
- [JSON](https://mindscape.pages.dev/bootstrap/AuditTrail.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
