TIE-AGT-025DocumentedAgent identity/Audit 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.
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.

Action record
| Field | Source | Example |
|---|---|---|
| correlation_id, trace_id | Generated at request start; propagated | c-91f2; W3C traceparent |
| time (UTC, synchronised) | Every emitter | 2026-11-24T10:41:07.311Z |
| subject (person or autonomous agent) | Token sub | user-4821 |
| agent and blueprint or version | Token client or actor; registry | agt-refunds-prod v3 |
| actor chain | Token act (nested) | agt-refunds-prod via agt-orchestrator |
| token ID and audience | Token jti, aud | 7c1e..., refunds API |
| action, target, key arguments | Gateway or tool layer | refund.issue, order 99213, 340 GBP |
| decision, reason, policy version | PDP | permit with approval, over limit, v12 |
| approval reference and approver | Approval service | ap-5531, sponsor user-1177 |
| outcome | Resource | executed, refund ID R-88120 |
| model and tool names | Agent trace | model name and version; tool name |
How it works
- Agree the record. Use the action record above as the common schema; map product logs to it.
- Propagate context. Generate the correlation ID at the edge; pass trace context in headers on every hop, including MCP and agent-to-agent calls.
- 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.
- Log decisions with reasons. PDP and approval records include reason codes and policy versions.
- Instrument agents. Emit OpenTelemetry spans for agent runs and tool executions using the generative AI conventions, with content capture off by default.
- Protect and retain. Send to an append-only store under separate administrative control; set retention per regulation and contract.
- 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#
- One record shape, many emitters.
- One correlation ID end to end.
- Identity from validated tokens, not agent claims.
- Every decision has a reason and a policy version.
- Logs are append-only and outside the operators' control.
- Clocks are synchronised; times are UTC.
- Minimise content; never log secrets or tokens.
- Rehearse reconstruction regularly.
Anti-patterns#
| Anti-pattern | What goes wrong |
|---|---|
| Each component logs with its own IDs | Records cannot be joined; investigations take days |
| Logging the agent's description of what it did | A manipulated agent writes a false story |
| Full prompts and responses kept indefinitely | A sensitive data store with no purpose limitation |
| Agent team can delete or edit logs | Evidence is not trustworthy |
| Logging access tokens | Logs become a credential store |
| Only the identity provider's sign-in logs | You 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
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)
- Export Advanced Identity Cloud or PingOne audit logs for agent token issuance and exchange to your SIEM.
- 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.
- Enable decision logging in PingOne Authorize or PingAuthorize with reason codes and policy versions.
Okta recipe
Okta
Okta System Log and log streaming
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)
- Use Okta's System Log for AI agent events, token exchanges and resource connection use, filtered by the agent's client ID.
- Stream System Log events to your SIEM with Okta's log streaming.
- 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
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)
- 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.
- In audit logs, identify agent activity by the
agentTypeproperty oninitiatedBy,performedByandtargetResources, and correlate agent identities to their blueprint withblueprintId. - 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
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
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#
| Test | Expected result |
|---|---|
| Pick a recent agent action | Full story reconstructed from logs by correlation ID |
| Agent claims it acted for a different user in its own output | Logs show the token's subject, not the claim |
| Operator attempts to delete a log entry | Not permitted; attempt logged |
| Search logs for access tokens or secrets | None found |
| Clock skew between components | Within tolerance; alert if exceeded |
| Retention period | Records 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.