Agent approvals & safety
Audit logs for AI agents: what to record, and why
What an AI agent audit log should capture (agent, tool, redacted inputs, result, approval and approver), where to keep it, and how long, without leaking secrets.
Updated 8 October 2026 3 min read
The short answer
Log every tool call an agent makes: which agent, which tool, when, the inputs with secrets and personal data redacted, the result, and for changes, the proposal, the decision and who made it. Keep the log on your own machine or systems, append-only, and long enough to answer “what happened last month?”.
The fields that matter
- Agent identity (which tool, which session).
- Tool and action name.
- Timestamp.
- Inputs, with keys, tokens and personal data redacted or tokenised.
- Outcome: success, error, or proposal created.
- For changes: the proposal, the decision, who decided, and when.
Where and how long
Keep it where you control it, append-only, and separate from anything the agent can edit. A few months covers most “what did it do?” questions; regulated work may need longer. Never log raw credentials or full request headers.
The safe way to do this
MoltenRock
The encrypted vault for your API keys and AI agents
Your keys sealed by your Mac’s Secure Enclave, handed only to the local agents you approve, never written to a .env file. Free for Mac.
Get MoltenRock, freeQuestions developers ask
What should an AI agent audit log contain?
Who (agent), what (tool and redacted inputs), when, the result, and for changes the approval decision and who made it.
Should audit logs include customer data?
Only as tokens or redacted values; the log should prove what happened without becoming a second copy of personal data.
Can the agent edit its own audit log?
It shouldn’t be able to. Keep the log append-only and outside the agent’s reach.