Skip to content
Operations / Observability

Keep an audit trail of agent actions

  • BP-0040
  • v1.0.1
  • draft
  • guideline
  • role: orchestrator
  • role: implementer
  • role: reviewer
  • stage: build
  • stage: operate
  • updated 2026-11-25
  • reviewed 2026-11-25
  • next review 2027-05-25
  1. MUST write an audit record for every side-effecting action an agent takes or attempts: writes, deletes, sends, deploys, permission changes, payments, and blocked or denied attempts.
  2. MUST include in each record: time, agent identity and version, the user or principal it acted for, the action and target, the input that matters (redacted), the approval (who, when) where one was required, the outcome, and the run ID (BP-0039).
  3. MUST make the audit log append-only and tamper-evident (write-once storage, hash-chained records, or a separate system the agent cannot write to except by appending).
  4. MUST NOT let the agent being audited read, alter or delete its own audit records.
  5. MUST keep audit records separate from debug logs and traces, with their own access control and a retention period that matches the records or systems the actions changed.
  6. SHOULD emit audit records from the enforcement point (the harness, hook, MCP server or downstream system), not from the agent’s own narration of what it did.
  7. SHOULD review audit records regularly for unexpected actions, denied attempts and approvals granted without review.
  8. MAY represent records with a provenance vocabulary (PROV-O: agent, activity, entity, wasAssociatedWith, used) for interchange.

Any agent that changes systems or data, especially on behalf of users, in regulated or OT environments, or with elevated permissions.

{
"time": "2026-11-24T22:14:03+08:00",
"run": "wf-ci-triage-20261124",
"agent": "[email protected]",
"on_behalf_of": "seaton",
"action": "issues.close",
"target": "github:madeinoz67/agentpractices#43",
"approval": { "required": true, "by": "seaton", "at": "2026-11-24T22:13:50+08:00" },
"outcome": "success",
"prev_hash": "9f1c…", "hash": "b27e…"
}
  • Relying on the agent’s chat transcript as the audit trail.
  • Audit records in the same writable log file as debug output.
  • Recording successes but not denied or blocked attempts.
  • Every side-effecting action and attempt recorded
  • Agent, principal, action, target, approval, outcome, run ID
  • Append-only and tamper-evident; agent cannot alter its own records
  • Separate from debug logs; retention matches the records changed
  • Emitted at the enforcement point; reviewed regularly