Identi PatternsAn initiative of The Identi Exchange

TIE-AGT-025DocumentedAgent identityAudit and evidence

Attributable audit trail for agent actions

Record every consequential agent action so that anyone investigating can answer who asked, which agent acted, through which chain, under which policy and approval, with which credential, on what, and with what result, from logs that cannot be quietly altered.

  • EffortMedium
  • Version1.0
  • Reviewed
  • Updated
  • AuthorsTrevonix Innovation

In short#

  • Every consequential action produces records that answer who, which agent, through which chain, why, with what, on what, and what happened.
  • One correlation ID travels from the user's request through the agent, gateway, policy decision, approval and resource, so the records can be joined.
  • Logs go to a store the agents and their operators cannot alter, are kept as long as rules require, and minimise personal and prompt content.

Problem#

When an agent does something unexpected, the first questions are simple: who asked for it, which agent did it, was it allowed, did anyone approve it, and what exactly changed? In most estates the answers sit in different places with nothing to join them: the identity provider knows the agent signed in, the API knows a service account called it, the agent framework has a trace with a different ID, and the approval lives in a chat message.

Teams then over-correct by logging every prompt and response in full, creating a sensitive data store that is itself a risk and still lacks the decision context investigators need.

When to use it#

Use it when

  • Agents take actions with business, financial or security impact.
  • You need to investigate incidents involving agents, or answer customer disputes.
  • Regulators, auditors or customers ask what your agents did and on whose authority.

Avoid it, or add more, when

  • Purely conversational assistants with no tools and no access to personal data may need only standard application logs.

Forces#

  • Completeness against privacy. Full prompts and outputs help investigations and create a store of personal and confidential data.
  • Consistency against heterogeneity. Each product logs in its own format and with its own IDs.
  • Retention against cost. Rules may require months or years of logs.
  • Integrity against operations. Operators need access to logs but must not be able to change them.

Solution#

Define one canonical action record and make every enforcement point emit it, or emit something that maps to it. Generate a correlation ID at the start of each user request or task and propagate it (as W3C trace context) through the agent, every tool call, the gateway, the PDP, the approval service and the resource. Include identity facts from the token (subject, agent, actor chain, client, token ID) rather than what the agent claims. Send records to a central store with write-once retention, outside the administrative control of the agent's operators, and join them with identity provider sign-in and audit logs on agent ID and time.

Diagram. A request starts with correlation ID c-91f2. Records flow from five sources into a central, write-once log store: identity provider sign-in and audit logs (agent ID, blueprint, user, token ID), the agent's OpenTelemetry trace (invoke_agent and execute_tool spans, model and tool names), the
One correlation ID joins identity, gateway, decision, approval, resource and trace records into a single story.

Action record

FieldSourceExample
correlation_id, trace_idGenerated at request start; propagatedc-91f2; W3C traceparent
time (UTC, synchronised)Every emitter2026-11-24T10:41:07.311Z
subject (person or autonomous agent)Token subuser-4821
agent and blueprint or versionToken client or actor; registryagt-refunds-prod v3
actor chainToken act (nested)agt-refunds-prod via agt-orchestrator
token ID and audienceToken jti, aud7c1e..., refunds API
action, target, key argumentsGateway or tool layerrefund.issue, order 99213, 340 GBP
decision, reason, policy versionPDPpermit with approval, over limit, v12
approval reference and approverApproval serviceap-5531, sponsor user-1177
outcomeResourceexecuted, refund ID R-88120
model and tool namesAgent tracemodel name and version; tool name

How it works

  1. Agree the record. Use the action record above as the common schema; map product logs to it.
  2. Propagate context. Generate the correlation ID at the edge; pass trace context in headers on every hop, including MCP and agent-to-agent calls.
  3. Take identity from tokens. Gateways and resources log subject, agent, actor chain and token ID from the validated token, never from text the agent sends.
  4. Log decisions with reasons. PDP and approval records include reason codes and policy versions.
  5. Instrument agents. Emit OpenTelemetry spans for agent runs and tool executions using the generative AI conventions, with content capture off by default.
  6. Protect and retain. Send to an append-only store under separate administrative control; set retention per regulation and contract.
  7. Minimise. Record arguments needed to understand the action; hash or redact personal data and secrets; keep full prompts only where a documented purpose needs them, with restricted access.

Design rules#

  1. One record shape, many emitters.
  2. One correlation ID end to end.
  3. Identity from validated tokens, not agent claims.
  4. Every decision has a reason and a policy version.
  5. Logs are append-only and outside the operators' control.
  6. Clocks are synchronised; times are UTC.
  7. Minimise content; never log secrets or tokens.
  8. Rehearse reconstruction regularly.

Anti-patterns#

Anti-patternWhat goes wrong
Each component logs with its own IDsRecords cannot be joined; investigations take days
Logging the agent's description of what it didA manipulated agent writes a false story
Full prompts and responses kept indefinitelyA sensitive data store with no purpose limitation
Agent team can delete or edit logsEvidence is not trustworthy
Logging access tokensLogs become a credential store
Only the identity provider's sign-in logsYou know the agent signed in, not what it did

Trade-offs#

Benefits

  • Fast, defensible investigations of agent incidents.
  • Evidence of authorisation, approval and outcome for auditors and disputes.
  • A foundation for monitoring and detection of agent misuse.
  • Privacy-conscious logging that limits sensitive data.

Costs and risks

  • Instrumentation of gateways, PDP, approval service and agents.
  • Central log storage with long retention.
  • Schema mapping and maintenance as products change.
  • Access control and review of who can read agent logs.

Recipes#

How to build this pattern on specific products. Each recipe shows its own maturity and when it was last verified.

Ping Identity recipe

Ping Identity

Ping audit logs, PingGateway audit and authorisation decision logs

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Identity, gateway and decision records with correlation IDs. Written from Ping documentation and Trevonix lab practice.

Configure (Ping)

  1. Export Advanced Identity Cloud or PingOne audit logs for agent token issuance and exchange to your SIEM.
  2. Add PingGateway's MCP audit filter (or route audit) on agent-facing routes, and log the validated token's subject, client and act chain with the correlation ID.
  3. Enable decision logging in PingOne Authorize or PingAuthorize with reason codes and policy versions.

Okta recipe

Okta

Okta System Log and log streaming

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Agent and token exchange events streamed to the SIEM and joined with gateway records. Written from Okta documentation.

Configure (Okta)

  1. Use Okta's System Log for AI agent events, token exchanges and resource connection use, filtered by the agent's client ID.
  2. Stream System Log events to your SIEM with Okta's log streaming.
  3. Where agents call resources through Okta's Agent Gateway, include its audit of tool calls in the joined trail.

Microsoft Entra recipe

Microsoft Entra

Microsoft Entra sign-in and audit logs with Microsoft Sentinel

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Agent sign-ins filterable by agent type; agentType and blueprintId in audit logs; joined with gateway records in Sentinel. Written from Microsoft documentation.

Configure (Entra)

  1. In Entra ID > Monitoring & health > Sign-in logs, filter Is Agent = Yes and by Agent type (agent identity, blueprint or agent user) to see agent sign-ins; the Reports Reader role is enough to view them.
  2. In audit logs, identify agent activity by the agentType property on initiatedBy, performedBy and targetResources, and correlate agent identities to their blueprint with blueprintId.
  3. Stream sign-in, audit and Microsoft Graph activity logs to Log Analytics or Microsoft Sentinel and join them with gateway and decision records on agent object ID, time and correlation ID.

Saviynt recipe

Saviynt

Saviynt agent change timeline and runtime audit events

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Agent changes and blocked actions as audit events. Written from Saviynt's published material.

Saviynt records a timeline of each agent's changes and generates audit events when Agent Access Gateway blocks actions at runtime. Forward both to the central store and join them with gateway and identity provider records.

OpenTelemetry generative AI conventions recipe

OpenTelemetry generative AI conventions

DocumentedLast verified Nov 2026

Written from vendor documentation and design experience; not yet lab-tested by Trevonix. Validate each step in a non-production tenant first.

Vendor-neutral tracing of agent runs and tool calls.

Instrument agent frameworks with OpenTelemetry using the generative AI semantic conventions (invoke_agent and execute_tool spans, gen_ai.* attributes), keep message content capture off by default, and export to the same backend as gateway traces so spans share trace IDs.

Verification tests#

TestExpected result
Pick a recent agent actionFull story reconstructed from logs by correlation ID
Agent claims it acted for a different user in its own outputLogs show the token's subject, not the claim
Operator attempts to delete a log entryNot permitted; attempt logged
Search logs for access tokens or secretsNone found
Clock skew between componentsWithin tolerance; alert if exceeded
Retention periodRecords older than the minimum are present

Maturity and verification#

Documented. Trevonix's lab builds log decisions, approvals and outcomes under shared correlation IDs (2026); this pattern generalises that approach from standards and vendor documentation and has not yet been tested end to end across products.

Frequently asked questions#

Should we log full prompts and responses?

Not by default. Keep the action, decision and identity facts. Capture prompt and response content only for a documented purpose (for example quality review or a specific investigation), with restricted access and shorter retention.

How long should agent logs be kept?

At least as long as your regulators and contracts require. For high-risk AI systems under the EU AI Act, deployers must keep automatically generated logs for at least six months, unless other law requires longer; financial services rules often require several years.

Are identity provider sign-in logs enough?

They tell you an agent authenticated and when; they do not tell you what it did with the access. You need gateway, decision and resource records joined by correlation ID.

Related patterns and references#

Cite this pattern

Trevonix (2026). Attributable audit trail for agent actions (TIE-AGT-025, version 1.0). Identi Patterns. https://exchange.trevonix.com/patterns/tie-agt-025-attributable-audit-trail-for-agent-actions

Licensed under CC BY 4.0. Credit Trevonix and link to this page when you reuse it.

Patterns are guidance, provided as is and without warranty. Test in a non-production environment and check current vendor documentation before you rely on them. Read the full disclaimer.