Secure AI Automation | | 22 min read
AI Audit Trails and Activity Logging: What to Capture
An AI audit trail is how you go back and find out what happened when an employee used an assistant to do a job. That sounds simple until the answer has been copied into another system and nobody can find the prompt, source, or approval. I think the useful test is whether someone who wasn't there can follow the records. Below is a fictional invoice review and a checklist for trying that test.
Key Takeaways
Ask a reviewer to follow one complete run
Who requested the work?
Connect the initiating identity to the sources, model output, approval, and system change. I'd ask the reviewer to follow that path rather than rely on the final answer.
Which source did the reviewer see?
A source may change after a decision. Keep its version with the output and show what the human decided separately from the model's recommendation.
Where did the run fail?
Try a permission denial or a rejected action as well as a successful job. The record needs the errors and rollbacks an investigator will have to follow.
Who can retrieve the evidence?
Decide access, retention, and export from the workflow's risk and data sensitivity. The reviewer needs the right evidence without giving everyone access to its contents.
Suppose a reviewer wants to know why an assistant changed a record. I'd want them to be able to find who started the work, the sources it used, the model's output, and the human review. Keep the model and workflow versions with those records, then follow what happened in the connected systems.
Try that review on one workflow, including a successful run and its exceptions. The worked agent audit trail follows an invoice exception. You can use the downloadable evidence checklist to record which parts of your own workflow a reviewer can establish and which evidence is missing.
Start an AI audit trail review in five steps
- Choose a run. Identify the workflow, review period, initiating user, agent, and stable run identifier.
- Retrieve the sources. Resolve the exact source and output versions the reviewer saw, using approved evidence access.
- Match authority to action. Connect the human approval to the exact proposed change and the identity that executed it.
- Verify the outcome. Inspect the target response and resulting state, including denials, timeouts, retries, and recovery.
- Record the gaps. Note missing evidence, collection failures, retention issues, and the owner responsible for each correction.
The invoice exception example shows how these records connect. It is a fictional implementation pattern, not a client result or an official audit requirement.
Discuss your workflow
GS Consulting can help with the audit trail for a workflow you're planning. We can work through its prompts, source traceability, decision history, human approvals, and compliance evidence. Use the evidence checklist to start. There is more in the Agentic AI insights hub and Secure AI Automation Consulting, including governance, architecture, data controls, security, and measurable outcomes.
What do AI audit logs need to show?
A sign in or a changed ticket is a useful place to start an investigation. Your application may already record those events, along with downloads and administrator changes. But how would the reviewer find the request that led to the assistant's answer?
I'd connect the application events to the information the model interpreted and the sources it retrieved. Keep its generated output and recommended action with the record, then follow any work triggered in another system.
Now the reviewer can ask what the user requested and what the assistant actually retrieved. Which sources went into the answer? Who approved the proposed action, and what happened afterward? A record of a submitted request on its own won't answer those questions.
NIST SP 800 53 includes audit and accountability controls in its broader security and privacy catalog. I'd fit the AI evidence into the organization's existing security and compliance program, so the people reviewing the workflow can use it.
Original Research: The AI Audit Trail Evidence Burden Index
Original GS Consulting research shows that AI audit readiness is a reconstruction problem, not a logging volume problem.
GS Consulting analyzed public AI governance, security, accountability, regulatory, and enterprise adoption sources against 17 AI logging and evidence controls. The source set included NIST SP 800 53, NIST AI RMF, NIST Generative AI Profile, the EU AI Act, OWASP LLM Top 10, CISA and NSA AI guidance, CSA AI Controls Matrix, GAO's AI Accountability Framework, ISO 42001 public information, McKinsey's 2025 State of AI, IBM's 2026 AI control gap study, and Microsoft's 2025 Digital Defense Report.
The analysis produced GS Consulting derived planning metrics: AI Audit Trail Evidence Burden Score, Workflow Traceability Score, and a logging depth model by AI risk tier. These are planning tools, not official legal, audit, regulatory, security, NIST, CISA, EU, OWASP, CSA, GAO, ISO, IBM, McKinsey, Microsoft, or compliance determinations.
The practical takeaway is clear: regulated organizations should not only log the final AI output. They should capture enough evidence to answer what happened later.
Which records will the reviewer ask for?
You may need more than the answer sent to a customer. The prompt, model output, source references, and human approval explain how that answer got there. So can a generated summary, escalation, rejected recommendation, or model error. Decide which records to retain while the workflow is being built.
That applies to work in HR, finance, contracts, customer support, compliance, security, GovCon, healthcare, and operations. The person asking may be an auditor following a conclusion, a customer questioning a response, a contracting officer checking controlled information handling, or an investigator looking for a disclosure. If the records are gone, what will you give them besides somebody's recollection?
What an AI Audit Trail Should Capture
A useful AI audit trail should capture the full path of the workflow, not just the final answer.
- IdentityWho used the workflow?
Capture user ID, role, team, session, authentication method, and permissions at the time of request.
- RequestWhat did they ask AI to do?
Capture the prompt or request when AI touches sensitive data, regulated workflows, or decision support.
- SourcesWhat did AI access?
Track documents, tickets, records, APIs, policies, contracts, logs, invoices, evidence, and source references.
- OutputWhat did AI produce?
Record summaries, classifications, recommendations, drafts, extracted fields, and action plans where appropriate.
- ReviewWho reviewed it?
Log approvals, edits, rejections, escalations, reviewer notes, and decisions.
- ActionWhat happened next?
Track tickets routed, messages sent, records updated, tasks assigned, reports generated, and downstream actions.
If AI writes back to a system, the audit trail needs to be stronger. Capture the system updated, field changed, old value, new value, approval, automation status, reversibility, and downstream triggers.
Do not only log success. Log retrieval failures, permission denials, missing sources, conflicting sources, rejected outputs, escalations, policy violations, model failures, connector failures, and unusual access events.
Why Source Traceability Matters
Source traceability is what separates a useful AI answer from an unsupported claim.
A regulated organization should not rely on AI outputs that cannot point back to approved sources.
If AI says, "The policy requires manager approval," the user should be able to see which policy and which section. If AI says, "This contract includes a reporting obligation," the reviewer should be able to see the clause. If AI says, "This ticket looks like a security incident," the analyst should see the signals that led to that recommendation.
NIST's AI RMF Core emphasizes governance, mapping, measurement, and management of AI risk. Logs help organizations map what happened, measure performance, and manage issues over time.
Prompt Records Need Rules
Some organizations avoid logging prompts because prompts may contain sensitive data. That concern is valid.
But the answer is not to ignore prompts completely. The answer is to define prompt logging rules.
The key is that prompt records should be protected based on the data inside them. A prompt can contain sensitive information. Treat it that way.
Logs Can Become Sensitive Too
Before giving people access to the log store, look at what the workflow has copied into it.
There may be user names and customer identifiers, employee data and contract details, security findings and system names. Prompts, model outputs, source references, decision history, and API responses can carry sensitive content too.
I'd work out who may read those records and for how long. Set access controls and retention rules, encryption and monitoring, export controls, review procedures, and deletion rules where appropriate. Bring in legal or compliance owners when the workflow requires their input.
The AI Governance Data Retention and Deletion guide separates content that may need disposition from the evidence that a logging, hold, backup, provider, or deletion decision was carried out.
A general access workspace is a poor place to collect all that material. Give the evidence the protection its contents need.
What to Log by Risk Level
I'd decide how much to keep after looking at the workflow's risk. Keeping everything indefinitely creates cost, privacy, and operating problems; keeping too little leaves the reviewer unable to establish what happened. Retrieval and agent actions introduce additional places where that evidence can be lost.
For public or low sensitivity work, start with the user, tool, time, and basic usage. Keep the output when the review needs it.
For operational support and preparation for decisions, I'd want the prompt and data sources with the model output and source references. Include the human review and workflow action, errors, and overrides.
Sensitive data, regulated work, and decisions with serious consequences need a fuller record. Include prompt records and sources, the model and workflow version, approvals and decision notes. Keep system changes, escalations, exceptions, monitoring, and retention information with the evidence.
AI Logging for RAG Systems and Agents
Retrieval based AI needs special logging. A RAG system can reduce unsupported answers by grounding responses in approved sources, but only if the organization can see what was retrieved.
For RAG, log user identity, question asked, search query, documents retrieved, documents excluded because of permissions, source references used, answer generated, whether the user opened the source, whether the answer was copied or exported, user feedback, and required human review.
AI agents need even stronger logging. A chatbot answers. An agent can act. That changes the evidence requirement.
If an AI agent can call tools, retrieve records, update fields, trigger workflows, send messages, or assign tasks, the audit trail needs to show every step: user request, agent plan, tools called, data accessed, API requests, API responses, intermediate steps, approval gates, actions taken, records updated, messages generated, errors, rollbacks, and final outcome.
OWASP's LLM Top 10 highlights risks such as prompt injection, sensitive information disclosure, insecure plugin design, and excessive agency. These risks matter more when AI has tools and action rights.
What is an example of an audit trail?
An AI agent audit trail should show how an authorized request became a controlled action. The following fictional example uses an invoice exception workflow. It is an implementation pattern, not a client result or a required industry schema.
A finance analyst asks an agent to review invoice INV-1042. The agent can read the invoice and purchase order and propose an exception status. It cannot release payment. A finance reviewer must approve the exact proposed update before the workflow changes the record.
Every event below belongs to run RUN-1042. Each has its own event ID, occurrence time in UTC, and relationship to the preceding event. In a workflow with parallel tasks, retain parent and child relationships as well. Timestamps alone do not establish causality.
| Event | What happened | Evidence retained |
|---|---|---|
| E01 — Request | Analyst USR-17 requests an invoice review. |
Authenticated subject, agent identity AGENT-AP-01, purpose, permissions, and controlled request reference. |
| E02 — Source access | The connector reads invoice version 7 and purchase order version 3. | Source IDs, versions, authorization outcome, and retrievable snapshots or records sufficient to review the evidence used. |
| E03 — Proposal | The agent proposes setting the exception status to Needs review. |
Output reference OUT-1042-v1, relevant source references, and model, prompt, workflow, and policy versions. |
| E04 — Approval | Reviewer USR-42 approves that exact status change. |
Approval APR-81, reviewer authority, timestamp, target record, approved output version, and permitted change. |
| E05 — Action | The connector updates the exception status. | Tool invocation, request identifier, authorization result, before/after values, approval reference, and target system acknowledgement. |
| E06 — Verification | The workflow reads back the record and confirms version 8 contains the approved status. | Read back reference, actual outcome, discrepancies if any, and completion status. |
The distinction between E05 and E06 matters. An agent saying “updated” is not evidence that the target system accepted the change. Preserve the target response and verify the resulting state where the workflow requires it.
A sample action event
This shortened JSON illustrates E05. The values are fictional, and the evidence paths are example identifiers rather than public URLs. Production implementations should define required fields, trusted event producers, and validation rules for their environment.
{
"schema_version": "1.0",
"event_id": "E05",
"run_id": "RUN-1042",
"parent_event_id": "E04",
"occurred_at": "2026-09-01T14:02:11Z",
"recorded_at": "2026-09-01T14:02:12Z",
"event_type": "tool.action.completed",
"initiating_subject_id": "USR-17",
"agent_id": "AGENT-AP-01",
"executing_identity": "SVC-AP-CONNECTOR",
"workflow_version": "invoice-review-2.3",
"model_deployment_version": "approved-model-2026-08",
"prompt_template_version": "invoice-exception-1.4",
"policy_version": "ap-exception-3",
"source_refs": ["INV-1042@7", "PO-882@3"],
"output_ref": "OUT-1042-v1",
"approval_id": "APR-81",
"authorization_result": "allowed",
"tool": "erp.update_invoice_exception",
"request_id": "REQ-55",
"idempotency_key": "RUN-1042-status-v1",
"target_record": "INV-1042",
"target_version_before": 7,
"change": {
"field": "exception_status",
"before": "Open",
"after": "Needs review"
},
"outcome": "accepted_by_target",
"target_response_ref": "evidence/RUN-1042/erp-response-55",
"target_version_after": 8,
"retention_policy_id": "FIN-AI-LOGS",
"classification": "Internal"
}
Keep sensitive prompt text and response bodies in an approved evidence store when appropriate. The event can point to those records without copying their contents into every monitoring system. A reference is useful only if an authorized reviewer can retrieve the right version for the required retention period.
Capture observable requests, outputs, tool events, and human decisions. Do not require or claim to capture a model’s hidden chain of thought. A generated explanation is an output to evaluate, not independent proof of the model’s internal reasoning.
How a reviewer reconstructs the run
- Retrieve all events for
RUN-1042and resolve their parent relationships. Identify missing events or collection delays. - Verify who initiated the work and which service identity performed the update. Check their authority at the time of the action.
- Retrieve the source versions and output the reviewer saw. Confirm approval
APR-81applies toOUT-1042-v1and the exact change in E05. - Compare the approved change with the connector response and E06 read back. Confirm that no payment release or other unapproved action occurred.
- Export the linked evidence and document any unresolved gaps. Preserve access restrictions on the export.
A readable sequence is only part of the design. Restrict who can write, change, delete, and export evidence. Monitor collection failures. If the organization requires protection against alteration, test the storage controls and verification process. A hash stored beside an editable record does not by itself make that record tamper resistant.
Test the exceptions before relying on the logs
Use separate test runs for each scenario:
- Denied source access: the system records a denial without exposing the restricted document or its contents to an unauthorized viewer.
- Changed proposal: approval for one output version cannot authorize a different proposed action. The workflow requests a new approval.
- Connector timeout: the run records an unknown result, checks target state, and follows the retry policy before repeating a write. Preserve each attempt under the same run and logical operation.
- Evidence collection failure: the workflow follows its defined pause or escalation policy. It does not silently record the run as fully evidenced.
- Reversal: where reversal is supported, a compensating action creates a new linked event. It does not erase the original action.
For the surrounding control design, see AI access controls and permission design and human in the loop AI automation.
Keep the decision beside the recommendation
Record what AI recommended and what the person decided. Was the recommendation right, ignored, or overridden? Did the workflow escalate, or cause an issue later? Keep that history for customer commitments, employee decisions, compliance conclusions, financial exceptions, security response, contract obligations, operational escalations, and legal review.
For records crossing systems, see integration observability and reconciliation and security case management integration. The documented private AI cyber analysis case study describes GS Consulting implementation work; it does not validate the fictional invoice example.
The Audit Trail Architecture
A practical AI audit trail architecture has several parts. It does not need to be overly complex, but it does need to be deliberate.
- IdentityConnect AI activity to users, roles, groups, and service accounts.
- AccessRecord systems, documents, records, and APIs touched by the workflow.
- ReviewCapture approvals, edits, rejections, escalations, and reviewer notes.
- EvidenceStore controlled records with retention, search, export, and monitoring.
How to evaluate AI audit trail software
Ask the vendor to walk through a request in a test environment. I'd want to see the source retrieval and proposed action, the approval, the actual system update, and the export a reviewer receives. The table gives you specific records to inspect during that demonstration.
| Ask the vendor to demonstrate | Evidence to inspect |
|---|---|
| Connect events across systems | Stable run and event identifiers, parent relationships, and timing information in the export. |
| Retain prompts and responses under your rules | Configurable capture, redaction, restricted retrieval, and references that resolve to the retained versions. |
| Bind approval to an action | The exact output or proposed change approved, reviewer identity, and handling of changes after approval. |
| Prove an action occurred | Tool requests, target responses, errors, retries, and resulting system state. |
| Preserve access and retention controls | Evidence of who can read, change, delete, and export records, with retention and hold behavior demonstrated for your scope. |
| Export usable evidence | A sample export an independent reviewer can follow without relying on the vendor’s dashboard. |
Look for the handoffs the product doesn't cover. The application, model provider, orchestration layer, and target system may each hold a different part of the record. One product might capture model interactions while another holds approvals or business changes. Somebody has to connect them and own the missing evidence.
The AI vendor evaluation guide covers the broader procurement review.
What Not to Do
- I'd check vendor chat history before calling it an audit trail. It may omit source references, approvals, retention needs, and the actions taken in the business workflow.
- A general workspace may give too many people access to sensitive logs. Put the evidence where its contents can be protected.
- Classify the material before collecting it indiscriminately. Otherwise the log store creates avoidable privacy and security exposure.
- Agree on a logging method across teams so an enterprise reviewer doesn't have to decode a different record for each workflow.
- An output used in a business decision may need to be retained as a record. Calling it a temporary note doesn't resolve that question.
- Follow the service accounts and agents too. The reviewer needs to connect non human identities to the work they performed.
AI audit trail evidence checklist
Start with one workflow and one review scope. Assign an owner to each evidence requirement, record where the evidence is retained, and test whether an authorized reviewer can use it. A configured logging feature is not the same as a verified record.
Use the accompanying AI Audit Trail Evidence Checklist to record:
- The identity, request, source, output, approval, and action evidence for a run.
- The versions, errors, retries, and recovery records needed to investigate exceptions.
- The storage, access, retention, monitoring, and export controls that protect the evidence.
- The test result, reviewer, review date, and action required for each gap.
Mark an item “Pass” only after performing its verification test and linking the evidence. Use “Not applicable” only with a documented reason and reviewer acceptance. Neither a completed checklist nor a successful sample establishes compliance for all workflows.
Put the evidence review into practice
The Excel workbook includes 22 verification checks, editable review fields, instructions, and a fictional worked example.
Download the AI Audit Trail Evidence ChecklistExcel workbook (.xlsx). GS Consulting planning template, not an official legal, audit, compliance, or regulatory determination.
The First 30 Days
Start with one workflow. Pick a workflow where AI touches something important but manageable: IT ticket triage, compliance evidence summaries, contract obligation summaries, customer support drafts, invoice exception review, security alert summaries, or operations exception reports.
- Week 1Map the workflow.
Define the users, systems, data, AI task, source repositories, approval points, outputs, and downstream actions.
- Week 2Define the evidence model.
Decide what prompts, sources, outputs, approvals, exceptions, versions, and actions need records.
- Week 3Protect the logs.
Set access controls, retention rules, classification, encryption, monitoring, export paths, and review ownership.
- Week 4Test reconstruction.
Run sample cases and prove the team can explain who used AI, what it accessed, what it produced, who reviewed it, and what changed.
How GS Consulting applies auditability in a real system
In a private AI cyber analysis implementation, GS Consulting used a controlled Python pipeline, locally hosted model, defined structured JSON, workflow orchestration, processing status, exception visibility, and human review. Those surrounding layers made it possible to validate outputs, route results to an approved SIEM or database, and preserve operational accountability beyond a model response.
Read the Private AI Case Study Review Implementation ServicesReady to make your AI automation audit ready?
Contact GS Consulting for an AI Audit Trail and Logging Assessment.
Contact GS ConsultingResearch Sources and Caveats
The AI Audit Trail Evidence Burden Score, Workflow Traceability Score, and logging depth model are GS Consulting derived planning tools. They are not official legal, regulatory, audit, NIST, CISA, EU AI Act, OWASP, CSA, GAO, ISO, IBM, McKinsey, Microsoft, or compliance determinations.
Actual logging requirements depend on the organization's contracts, systems, data sensitivity, AI vendor terms, retention obligations, privacy requirements, incident response process, regulated workflow exposure, and legal review.
The worked example and checklist are GS Consulting proposed implementation guidance, not client results or official compliance determinations. The example uses a custom event schema. The OpenTelemetry Logs Data Model provides background on event and observation timestamps and record correlation; the example does not claim schema conformance.
- NIST SP 800 53 Rev. 5: Security and Privacy Controls for Information Systems and Organizations
- NIST AI RMF Core
- NIST AI 600 1: Generative Artificial Intelligence Profile
- OWASP Top 10 for Large Language Model Applications
- CISA: Careful Adoption of Agentic AI Services
- GAO Artificial Intelligence Accountability Framework
- EU AI Act Article 12: Record Keeping
- McKinsey: The State of AI
- IBM: AI Control Gap Study
Frequently Asked Questions About AI Audit Trails
How do I implement an audit trail for AI agents acting on behalf of users?
Pick one workflow and give its records a stable run identifier. Can a reviewer follow the initiating user and agent identity into source access, model output, approval, and the system action? Keep the versions and permissions in effect, then try reconstructing a success, a denied request, and a failed action.
Can software capture AI prompts and responses for audit review?
I'd ask for a demonstration on a complete run. Prompt and response capture may be available while source versions, approvals, tool actions, exceptions, or target outcomes live elsewhere. Find them in the export. Decide which content may be retained and who may access it before relying on the product.