Decision Record & Audit Ledger
For every material agent decision, emit an immutable, structured record sufficient to reconstruct the reasoning after the fact.
This page is the complete instruction page for one pattern called "Decision Record & Audit Ledger." It explains the problem this pattern solves, the idea behind the solution, when you should (and should not) use it, and what happens afterward — both the good effects and the costs.
This matters because building AI agents is not just about making them clever. It is also about making them safe and predictable. Following a well-tested pattern like this one helps avoid common mistakes, and shows you exactly which safety rules and regulations it connects to, listed under "Standards Mesh" on this page.
Context
Regulators, incident responders, and internal audit all need to answer the same questions about an agent action: what did it do, why, on whose authority, with what inputs, and what was the outcome? If the evidence is not there, the answer defaults to "we do not know."
Problem
Ad-hoc logging produces fragments that cannot be stitched into a coherent audit narrative.
Forces
- Log volume vs signal density
- Retention cost vs evidentiary completeness
Solution
Define a decision-record schema: agent identity, user/principal, goal, plan, tool invocations with inputs and outputs, guardrail decisions, final action, outcome, timestamps. Write to an append-only store. Retention per regulation (e.g. EU AI Act Art. 12 logging, typically 6 months minimum for high-risk).
Applicability
- High-risk agents under EU AI Act
- BFSI regulatory reporting contexts
- Any agent whose actions may require subject-rights response (GDPR/PDPA)
Anti-Patterns
- Logs scattered across prompt/tool/gateway sinks
- Mutable or overwritable traces
Consequences
- +Auditable reconstruction of any episode
- +Evidence for incident response
- −Storage cost
- −PII handling discipline required