Join our Newsletter — 33% off our NHI Course
Home› Guides› AI Agent Audit Log Schema Template: Fields for…
Template Agent Controls & Monitoring

AI Agent Audit Log Schema Template: Fields for Identity, Delegation, Tool Calls and Outcomes

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 11 November 2026 10 min read
On this page

When an AI agent does something it should not have done, the first question is who it was acting for and on whose authority, and most agent logs cannot answer it. Framework traces record prompts and latencies, and target systems record that a service account made a change, but nothing ties the two together with the human principal, the delegation chain and the approval. This template gives [Organisation] a ready-to-use audit record schema for AI agents: the fields, their types, whether they are required, and an example record. It is for platform engineers, detection engineers and audit teams. The AI Agent Audit Trails for Regulators Guide explains why each element matters; this page is the schema to implement.

How to use this template

  • Replace text in square brackets, such as [Organisation], [SIEM] and [N days], with your own values. Bracketed values are illustrative.
  • "Required" fields must be present on every record of that event type; "Conditional" fields are required when the condition applies; "Optional" fields are recommended.
  • Field names use an agent_audit.* namespace that NHI Mgmt Group defined for this template. Where an OpenTelemetry GenAI attribute exists, section 11 maps it, so you can emit traces and audit records from the same instrumentation.
  • Emit one record per event, not one per run. A run produces several records sharing a run_id.
  • Adopt sections 3 to 9 as your logging standard and section 10 as the rule for sensitive content.

1. Purpose

This schema defines the minimum audit record that every AI agent operated by or for [Organisation] must emit, so that any agent action can be attributed to a registered agent, a human or system principal, and an authorisation decision, and so that investigators can reconstruct a run without relying on the agent's own account of it.

2. Scope

The schema applies to internally built agents, agents built on low-code platforms, AI coding agents, and third-party agents that hold credentials in [Organisation] systems, where [Organisation] controls the runtime or gateway. For third-party agents where it does not, the schema is the contractual logging requirement. Chat assistants without tools emit only the session and model call events.

3. Record envelope (all events)

FieldTypeLevelContent
agent_audit.schema_versionstringRequiredVersion of this schema, for example [1.0]
event_idstring (UUID)RequiredUnique per record
event_typeenumRequiredsession.start, model.call, tool.call, policy.decision, approval, credential.use, session.end, kill_switch
timestampstring (RFC 3339, UTC)RequiredTime the event occurred, from a synchronised clock
observed_timestampstring (RFC 3339, UTC)OptionalTime the record was written, if different
run_idstringRequiredCorrelates all events in one agent run
conversation_idstringConditionalWhen the run belongs to a longer conversation or thread
trace_id, span_idstringConditionalWhen distributed tracing is enabled, to join audit records with traces
environmentenumRequired[production, staging, development]
source.host, source.servicestringRequiredWhere the record was produced (runtime, gateway, MCP server)
security_relevantbooleanRequiredTrue for events that should reach the [SIEM]

4. Agent identity

FieldTypeLevelContent
agent.idstringRequiredStable ID from the [agent registry], never a display name
agent.name, agent.versionstringRequiredHuman-readable name and deployed version
agent.ownerstringRequiredAccountable person or team ID
agent.workload_identitystringRequiredThe non-human identity the agent authenticates as (service principal, workload identity, OAuth client ID)
agent.config_hashstringRequiredHash of the system instructions, tool list and policy bundle in force, so changes are provable
agent.platformstringOptionalFramework or hosted agent service

5. Principal and delegation

FieldTypeLevelContent
principal.typeenumRequireduser, service, schedule, agent, external
principal.idstringRequiredUser subject, job ID, ticket ID or upstream agent ID on whose authority the agent acts
principal.tenantstringConditionalFor multi-tenant or customer-facing agents
delegation.chainarray of objectsConditionalOrdered from originating principal to current actor; each entry has id, type and via (how authority passed: token exchange, A2A task, MCP call). Required when more than one hop exists
delegation.token_claimsobjectConditionalDecoded, non-secret claims (sub, act, scope, aud, exp, token ID) when OAuth token exchange is used. Never the token itself
authorisation.modeenumRequiredown_identity, on_behalf_of, impersonation

RFC 8693 represents delegation with nested act claims: the outermost names the current actor and nested claims name prior actors. Logging the decoded claims lets an investigator read the full user to agent to service chain.

6. Model call event

FieldTypeLevelContent
model.provider, model.requested, model.returnedstringRequiredProvider and model identifiers as requested and as reported
model.input_sourcesarray of objectsRequiredEach content segment in context with source (user, retrieval, tool output, file, web), trust (trusted or untrusted) and a reference or hash
model.tokens_in, model.tokens_outintegerOptionalUsage, for cost and abuse detection
model.finish_reasonstringOptionalStop, length, tool call, content filter
model.content_refstringOptionalPointer to prompt and output content held in a restricted store (see section 10)

7. Tool call event

FieldTypeLevelContent
tool.name, tool.typestringRequiredTool as registered, and its type (function, MCP, API, agent)
tool.call_idstringConditionalWhen the model or provider supplies one
tool.serverstringConditionalMCP server or API endpoint, with version or definition hash
tool.operationenumRequiredread, write, delete, execute, send, pay
tool.target_resourcestringRequiredThe object acted on (record ID, file path, mailbox, repository)
tool.arguments_redactedobjectRequiredArguments after redaction under section 10
tool.credential_refstringRequiredWhich credential was used (key ID, token ID, secret path), never the secret
tool.untrusted_in_contextbooleanRequiredTrue if untrusted content was in the model context when the call was decided

8. Policy decision and approval events

FieldTypeLevelContent
policy.engine, policy.versionstringRequiredWhich policy point decided and the policy bundle version
policy.decisionenumRequiredallow, deny, require_approval
policy.rule_id, policy.reasonstringRequiredThe rule that matched and a short reason
approval.approver_idstringConditionalRequired when a human approved or rejected
approval.shown_summary_hashstringConditionalHash of exactly what the approver was shown
approval.result, approval.latency_msenum, integerConditionalApproved, rejected or expired, and time taken

9. Outcome

FieldTypeLevelContent
outcome.statusenumRequiredsuccess, failure, blocked, partial
outcome.error_typestringConditionalWhen the operation failed
outcome.side_effectsarray of stringsConditionalChanges made in the target system, with the target's own event or change ID for correlation
outcome.data_volumeintegerOptionalRecords or bytes read, written or sent

10. Sensitive content rules

  1. Records must never contain passwords, access or refresh tokens, API keys, session identifiers, connection strings or encryption keys. Log a reference (key ID, token ID, hash) instead.
  2. Prompts, model outputs, tool arguments and tool results may contain personal or confidential data. Store them, if at all, in a restricted content store referenced by model.content_ref, with access limited to [named roles] and retention of [N days].
  3. Redaction must run before the record leaves the runtime, not in the [SIEM].
  4. Where content capture is disabled, hashes of inputs and outputs must still be recorded so that content held elsewhere can be matched later.

11. Integrity, retention and example

  1. Records must be sent to an append-only or write-once store outside the agent's control within [N minutes]. The agent's own identity must not be able to delete or alter them.
  2. Tamper detection, such as hash chaining or signed batches, must be enabled, and access to logs must itself be logged and reviewed.
  3. Retention: [N months] for security-relevant records, longer where a regulation requires it.

Example tool.call record (illustrative values):

{
  "agent_audit.schema_version": "1.0",
  "event_id": "[uuid]",
  "event_type": "tool.call",
  "timestamp": "2026-11-09T10:42:17.215Z",
  "run_id": "[run-id]",
  "trace_id": "[trace-id]",
  "environment": "production",
  "agent": {"id": "agt-0142", "name": "invoice-triage", "version": "3.2.0",
            "owner": "team-ap-automation", "workload_identity": "[service principal ID]",
            "config_hash": "sha256:[hash]"},
  "principal": {"type": "user", "id": "[user subject]"},
  "delegation": {"chain": [{"id": "[user subject]", "type": "user", "via": "sign-in"},
                           {"id": "agt-0142", "type": "agent", "via": "token_exchange"}],
                 "token_claims": {"sub": "[user subject]", "act": {"sub": "agt-0142"},
                                  "scope": "invoices.read", "jti": "[token id]"}},
  "authorisation": {"mode": "on_behalf_of"},
  "tool": {"name": "erp.get_invoice", "type": "api", "operation": "read",
           "target_resource": "invoice/[id]", "arguments_redacted": {"invoice_id": "[id]"},
           "credential_ref": "token:[token id]", "untrusted_in_context": true},
  "policy": {"engine": "[policy engine]", "version": "[bundle version]",
             "decision": "allow", "rule_id": "ap-read-01", "reason": "read within scope"},
  "outcome": {"status": "success", "data_volume": 1},
  "security_relevant": true
}

Implementation guidance

Mapping to OpenTelemetry GenAI conventions

The OpenTelemetry GenAI semantic conventions define agent and tool spans. They are at Development status, so pin the version you emit. Mark arguments, results and messages as opt-in content, as the conventions do.

Schema fieldOpenTelemetry attributeNote
agent.id, agent.name, agent.versiongen_ai.agent.id, gen_ai.agent.name, gen_ai.agent.versionConditionally required on agent spans (name on invoke_agent; ID and version on create_agent)
conversation_idgen_ai.conversation.idConditionally required
model.provider, model.requestedgen_ai.provider.name, gen_ai.request.modelProvider name is required on several GenAI span types; check the span you emit
tool.name, tool.call_id, tool.typegen_ai.tool.name, gen_ai.tool.call.id, gen_ai.tool.typeTool name is required on execute_tool spans
tool.arguments_redactedgen_ai.tool.call.argumentsOpt-in in OpenTelemetry; this schema requires a redacted form
outcome.error_typeerror.typeStable attribute
Principal, delegation, policy, approval, credential referenceNo GenAI attribute as of November 2026Add as custom attributes or emit as separate audit records

See the OpenTelemetry GenAI Semantic Conventions for Security Teams for instrumentation choices.

Rolling it out

  1. Start at the chokepoint: emit records from the tool or MCP gateway first, where every call passes, then add runtime fields.
  2. Pilot with one high-risk agent and test that an investigator can answer five questions from records alone: which agent, for whom, under which rule, with which credential, and what changed.
  3. Run redaction tests with seeded fake secrets before enabling production forwarding.
  4. Write detections: tool calls with untrusted_in_context true and a write or send operation; credential references used outside their expected agent; approval latency under one second.
  5. Version the schema and reject records with unknown versions at ingestion.

Framework mapping

SectionNIST SP 800-53 Rev. 5
3 to 9 (record content)AU-2 Event Logging; AU-3 Content of Audit Records; AU-12 Audit Record Generation
5 (attribution)AU-10 Non-repudiation
11 (integrity and retention)AU-9 Protection of Audit Information; AU-11 Audit Record Retention

The mapping is NHI Mgmt Group's editorial judgement.

Standards and references

Related NHI Mgmt Group resources: Audit Readiness for AI Agents and NHIs, AI Agent Observability and Incident Response Guide, Identity Telemetry Requirements, AI Agent Risk Assessment Template.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 11 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org