What Is an AI Agent Audit Trail?
Build an audit trail for AI agent payments
Clone Formance Ledger, run it locally, and post a transaction with agent, mandate, and policy metadata attached.
Build an audit trail for AI agent payments
Clone Formance Ledger, run it locally, and post a transaction with agent, mandate, and policy metadata attached.
AI agents now initiate payments inside banks and fintechs, and the compliance, finance, and engineering teams who own those payments must be able to show who authorized each one. A regulator will ask for that evidence, and the ledger is where it has to live.
Among 250 banking executives surveyed, 70% report using agentic AI to some degree, with 16% in live deployments and 52% in pilots. So, when a regulator asks who authorized each agent payment last quarter, most stacks cannot produce a clean answer. Application logs live in one system, postings live in another, and the ledger transaction containing the posting usually carries no agent, mandate, or policy reference.
Without an AI agent audit trail, you can prove the money movement, but not the decision authority.
An AI agent audit trail is an immutable, attributed record that links every money movement an agent initiates to four properties. These include the principal who delegated authority, the mandate that authorized the payment, the agent and model version that made the decision, and the policy version in force.
The audit trail belongs on the ledger transaction that recorded the AI agentic payment: the record that holds the debit and credit, and the one a regulator requests.
Attribution written anywhere else must be joined back to the transaction later, and regulatory checks can fail the join.
A regulator reconstructing an agent payment needs to see who authorized it, under which mandate, by which model and policy version, and when. The schema below co-records twelve metadata fields with the ledger transaction at creation, in four categories: Attribution, Mandates, Immutability, and Approval records.
Attaching the fields to the transaction means a model upgrade or policy rollback mid-flight cannot orphan the audit record, because the transaction that recorded the transfer still names the version that decided the payment.
One query filtered on policy_version or mandate_id in Formance Ledger (an open-source, programmable core ledger that unifies fiat and digital assets with regulatory-grade traceability) returns every payout a regulator asks about, along with amounts and accounts.
The four attribution fields show who delegated the authority, who acted on it, which model made the decision, and which rule set was in force at decision time.
Each field names a different accountable party.
The four fields answer the four accountability questions a regulator will ask about any agent payment, giving the same traceability of funds that account lineage gives for who owns a balance.
mandate_id proves which standing authorization permitted a specific payment, and points to a mandate record that carries the expiry, amount ceiling, and permitted counterparties.
The transaction carries 12 audit fields in total, and the mandate record it points to confirms whether the payout fell within scope and the validity window.
When the mandate requires human confirmation before release, the approval record records who confirmed and when.
The three immutability fields (decision_ts, idempotency_key, and retry_seq) prove when the agent decided, whether the attempt expresses the same intent as an earlier one, and how many attempts came before this one. A first-try payment records a retry_seq of 0.
The fields build on a hash-chained transaction history that the ledger stamps with its own recorded time. Each transaction cryptographically links to the previous one, so any attempt to alter a record breaks the chain and becomes visible on the next verification.
The agent decides at T1 based on the context it saw; the transaction lands at T2, and the rail settlement or bank value date lands at T3.
The three fields also distinguish cases that look identical on a bank statement. A payment that succeeds on the fourth attempt, after three retries, produces one transaction with a retry_seq of 3.
In contrast, a key-generation bug may produce two transactions with different keys against one invoice, and the mismatched keys signal a duplicate-payment defect.
A legitimately separate second payment produces two keys and two invoice references. Idempotency at the ledger-write or workflow boundary can collapse a retry storm into one transaction.
The four approval fields (hitl_confirmed, hitl_approver_id, hitl_confirmed_ts and override_log_ref) prove whether a required confirmation happened, who gave it and when, and which safeguard an agent bypassed, if any.
Where a mandate requires human confirmation, the transaction carries the approver's identity and the confirmation timestamp.
When an agent proceeded past a control, override_log_ref points to the log entry that captures which safeguard was active and which the agent overrode.
Override discipline should name which roles may override a control and require a written rationale captured at the point of override. Retain the rationale for the same period as the underlying transaction so a regulator can reconstruct why the safeguard was bypassed.
Say an agent decides to pay a supplier $1,850,000 from a treasury account, and the ledger records the transfer.
The send line handles the ledger transfer between two accounts: @platform:treasury:omnibus (where the money starts) and @sellers:4471:payable (where it ends up).
The amount is written in cents (USD/2), and all the metadata is attached at the same time, so the audit trail lives on the transaction itself.
The send only records the ledger entry. The actual money transfer happens separately, through a connected payment provider. The payout needs human sign-off, so the transaction carries a hitl_confirmed flag with the approver's name and the approval time. It also includes a link to the override log showing any safeguards skipped and why.
The example uses Numscript, Formance's purpose-built language for describing financial transactions, to attach all 12 fields to the ledger transaction that records the payout.
// SUPPLIER_PAYOUT
// Event: allocate $1,850,000 from platform treasury to supplier 4471
send [USD/2 185000000] (
source = @platform:treasury:omnibus
destination = @sellers:4471:payable
)
// Attribution
set_tx_meta("principal_id", "treasury-ops:j.alvarez")
set_tx_meta("agent_id", "payout-agent-07"
set_tx_meta("model_version", "2026-06-14-r3")
set_tx_meta("policy_version", "supplier-payout-policy-v12")
// Mandate
set_tx_meta("mandate_id", "mandate-8841")
// Immutability
set_tx_meta("decision_ts", "2026-09-14T09:41:07Z")
set_tx_meta("idempotency_key", "mandate-8841:inv-2026-0917")
set_tx_meta("retry_seq", "0")
// Approval records
set_tx_meta("hitl_confirmed", "true")
set_tx_meta("hitl_approver_id", "treasury-ops:m.chen")
set_tx_meta("hitl_confirmed_ts", "2026-09-14T09:39:22Z")
set_tx_meta("override_log_ref", "override-log:none")An AI agent audit trail records who authorized the payment and which policy permitted it, on the same transaction whose postings set the resulting balance. An observability trace records how the model behaved for a single request.
An audit trail and an observability trace differ in three ways:
OpenTelemetry's GenAI semantic conventions currently capture the model, token usage, and the sequence of LLM and tool calls, but define no field for a mandate reference or a principal.
Grafana Cloud Traces, for example, retains tracing data for 30 days by default, well below the six-month minimum the EU AI Act sets for logs of high-risk AI systems.
Write the audit record outside the application that made the decision.
On August 1, 2012, Knight Capital installed new trading software and sent numerous erroneous orders into the market. Knight traded out of its entire erroneous position, resulting in a realized pre-tax loss of about $460 million.
Tracing which code version produced each order was the hard part. A model_version and policy_version on every transaction answers that question per order, not per server.
When application logs come from the same code path that chose the payout, committing the transaction through a separate service and linking it to the hash-chained history prevents the deciding code from quietly rewriting the record.
Corrections land as compensating postings, the same discipline that keeps ledger integrity intact.
An accountable owner must review the audit record. Logs and alerts are insufficient when no accountable review process acts on them, and logs that exist but aren't reviewable or attributable aren't an audit trail.
If an agent system is classed as high-risk under the European Union’s Artificial Intelligence Act (EU AI Act), it must keep logs for at least six months. Those obligations now apply from 2 December 2027 for Annex III systems, after the Digital Omnibus on AI moved them from August 2026.
The EU AI Act's Article 12 logging requirements require high-risk AI systems to record events over the system's lifetime automatically. Under Article 99(4), non-compliance with provider and deployer obligations carries administrative fines of up to EUR 15,000,000 or, for an undertaking, 3% of total worldwide annual turnover, whichever is higher.
Under the Digital Operational Resilience Act (DORA), the regulatory technical standards (RTS) on information and communication technology (ICT) risk management (Commission Delegated Regulation (EU) 2024/1774, Article 12) require financial entities to synchronize their ICT systems’ clocks to a documented, reliable reference time source and detect logging-system failures.
In the US, the Federal Reserve’s Supervision and Regulation letter SR 26-2 replaced SR 11-7 with principles-based model risk guidance for banks. It treats documentation as part of sound model governance across the model lifecycle, but it states that generative and agentic AI models “are not within the scope of this guidance.”
An immutable, append-only ledger gives teams a single source of financial truth for what moved, when, and why. Each transaction carries metadata linking it back to the agent and the decision that triggered it.
Test your AI agent audit trail by running the three-part reconstruction test. The trail passes only if the 12 fields sit on the ledger transaction and the ledger's retention exceeds every other system the reconstruction depends on.
When a regulator asks who authorized each agent payment last quarter, a single query filtered on principal_id, mandate_id, or policy_version returns every in-scope payout. It includes the amounts, accounts, approver, and decision timestamp attached to the ledger transaction with no cross-system joins required.
With Formance Ledger, native metadata storage removes the need for a separate attribution log and the joins that connect the log to the postings.