Back to blog

AI

AI Agent Audit Trail: How to Audit Every Prompt, Response and Agent Decision

6 min read

An AI agent audit trail is the record of what an agent did and why it was allowed to do it: who asked, what the agent read, which tools it used, who approved each action, and what it answered. With a good trail you can open any run, months later, and explain it to a customer, an auditor or your own manager without asking anyone what they remember.

Teams usually ask for it in one sentence: can we audit every prompt, model response and agent decision? The answer should be yes. This guide shows what “yes” has to include, the nine things to log, and a short test you can run on any platform before you buy it.

Why a chat history is not enough

A chatbot produces text, so its history is the whole story. An agent does more. It searches your documents, reads a customer record, updates a ticket, drafts an e-mail, or sends one. Between the question and the answer there are steps, and the steps are where the risk is.

Three questions show the difference:

  1. A customer says the agent gave them the wrong refund amount. You need the documents the agent read for that answer, not only the answer.
  2. An invoice was paid twice. You need to know which run made the payment, with what details, and who approved it.
  3. An answer changed between Monday and Friday. You need to know that someone edited the agent’s instructions on Wednesday, and who.

A chat history answers none of these. An audit trail answers all three.

The nine things to log for every run

# What to record The question it answers
1 Who asked, or what started the run (a person, a schedule, another system) Who is responsible for this run?
2 When and through which channel (web, Slack, WhatsApp, API) Where did the request come from?
3 Which version of the agent ran Were these the instructions we approved?
4 The question or task as the agent received it What was it asked to do?
5 The sources it read: documents, pages, records What did it base the answer on?
6 Each tool call, with the details sent and the result What did it do in our systems?
7 Each approval: who approved or rejected, and when Who allowed the action?
8 The answer the person received What did we tell them?
9 The cost of the run What did this work cost us?

Two more records belong in the same trail, because they explain the nine above:

  • Changes to the agent: instructions, knowledge, tools and published versions, each with the person who made the change.
  • Changes to access and settings: who was invited or removed, which roles changed, which approval rules and masking rules changed.

The agent must not write its own log

This is the most common mistake. Some systems ask the model to describe what it did and save that description. A description is not a record. A model can leave a step out, and it can describe a step that did not happen.

The platform should write the trail as each step happens: the search it ran, the tool it called, the approval it waited for. Then the record is the same whatever the model says about it.

Two more properties matter:

  • Nobody edits it. People with the right role can read the trail. Nobody changes a past entry.
  • It names people, not shared accounts. “Admin approved” is weak evidence. “Sam Lee approved at 14:02” is strong evidence. This is one reason to use single sign-on: each entry then names a real person from your own directory.

A 10-minute test for any platform

Ask the vendor for a trial workspace and do this yourself. Do not accept a slide.

  1. Build a small agent with one document and one tool that changes something, such as creating a calendar event.
  2. Set the tool to ask for approval.
  3. Ask the agent a question that needs both the document and the tool. Approve the action.
  4. Change the agent’s instructions and publish the new version.
  5. Ask the same question again, as a different person.

Now open the record and check that you can answer these from the record alone:

Check Pass if
Who asked each time? Both people are named
Which version answered each time? The two runs show different versions
What did the agent read? The document is listed for each run
What did the tool receive? The exact details of the event are shown
Who approved? A name and a time, not a role
Who changed the instructions? A name and a time
Can you export it? You get a file or an API, not a screenshot

If any row fails, you have found the gap an auditor would find later.

What the rules ask for

You do not need a regulation to want this record. But several rules now expect it.

  • The EU AI Act asks that high-risk AI systems record events automatically over their lifetime, and that the companies using them keep those logs for at least six months unless another law sets a different period. Our guide to Article 12 logging covers what that means for AI that answers from documents.
  • Financial regulators treat an agent that acts in your systems as part of your control environment. They expect the same evidence as for any other change: who, what, when, and who approved.
  • SOC 2 and ISO 27001 audits ask how you know what your systems did. “The agent decided” is not an accepted answer.

This is a summary and not legal advice. Check the rules that apply to your company.

Keep the log private too

A complete record holds what people asked and what the agent read. Some of that is personal or confidential. Four habits keep the trail from becoming a new risk:

  • Limit who can read it. Workspace admins, not every member.
  • Mask what does not need to be seen. If card numbers and e-mail addresses are masked before the model reads them, they are masked in the record too.
  • Set a retention period. Keep records as long as the process needs, then remove them.
  • Keep it where your data is. If your documents must stay in one region, the log should stay there as well. See sovereign AI agents.

Where promptev fits

promptev is a platform for AI agents that work on your company’s data and ask before they act. The audit trail is part of every workspace.

  • Every run is recorded. The Activity log lists every agent run and every workflow run: who or what started it, which version ran, where the request came from and what it used.
  • Every decision has a name. Approval decisions, settings changes and every change to a workflow are recorded with the person who made them. For requests that arrive from an AI client over MCP, the app is recorded too.
  • Approvals are set per tool. Run alone, ask once, always ask, or ask only when a condition holds, such as an amount over a limit.
  • Sensitive values are masked before the model reads them, in documents and in what tools return.
  • Single sign-on is included, with SAML 2.0, OpenID Connect and SCIM, so entries name people from your own directory.

You can start free with 1,000 credits and no card, and run the 10-minute test above on your own workspace.

Frequently asked questions

Can we audit every prompt, model response and agent decision?

Yes, if the platform records each run as it happens: the person who asked, the question, the documents the agent read, each tool it called with the details, each approval and the final answer. Ask the vendor to show you one complete run from the record alone, and to tell you how long records are kept and who may read them.

What is an AI agent audit trail?

It is a record, kept by the system and not by the agent, of everything an AI agent did: who or what started each run, which version of the agent ran, what it read, which tools it used, which actions a person approved or rejected, and what it answered. It also records changes to the agent itself and to its settings.

What should an AI agent audit log contain?

Nine things: who asked, when and through which channel, the agent version, the question, the sources read, each tool call with its details and result, each approval decision with the approver's name, the answer, and the cost. Changes to agents, tools, permissions and settings belong in the same trail.

Is a chat history the same as an audit trail?

No. A chat history shows the question and the answer. An audit trail also shows what happened between them: what the agent read, what it tried to do, who allowed it, and which version of the agent and its instructions were live at that moment.

How long should AI agent logs be kept?

Long enough to answer the questions you will be asked. Many companies keep them for the same period as other business records for that process. Under the EU AI Act, deployers of high-risk systems keep automatically generated logs for at least six months unless another law says otherwise. Check the rules for your industry and country.

Do audit logs create a privacy problem?

They can, because prompts and answers often contain personal data. Limit who may read the log, mask sensitive values where the full value is not needed, set a retention period, and keep the log where the rest of your data is kept.