Skip to main content

AI agent audit log: what to record in production

When an agent sends a wrong email or burns through your LLM budget, the first question is always the same: what exactly happened? Without an audit log you guess. With one you read it.

What to record for every agent run

  1. Who or what started the run (user, schedule, webhook, another agent).
  2. The input and the agent version or prompt that was used.
  3. Every tool call: name, arguments, result, duration.
  4. The model used and the token count and cost of each call.
  5. Every human approval: who approved or rejected, when, and what they saw.
  6. Every config change: who changed a prompt, a budget or a permission, and the old value.
  7. The final output and its status (done, failed, stopped by budget).

What to keep out of the log

Secrets, API keys and raw personal data. Store references or masked values and set a retention period.

Common mistakes

  • Logging only the final answer. You cannot debug a chain of tool calls from it.
  • Logs that live in five tools. Put the run, its cost and its approval in one timeline.
  • No link between an approval and the action it allowed.

How to do it with FleetQ

FleetQ keeps agents, teams, workflows, human approvals and budgets in one place, so a run, its cost and the person who approved it sit in one record. You can run it on your own server (AGPL) or in the Cloud with your own LLM keys. See the MCP docs at https://fleetq.net/docs/mcp-server to read this data from your own tools.

Checklist (copy it)

  • [ ] run start and trigger
  • [ ] inputs
  • [ ] tool calls
  • [ ] cost per call
  • [ ] approvals
  • [ ] config changes
  • [ ] output and status
  • [ ] retention rule

Free on your server or in the Cloud. Start at https://fleetq.net.