)Part 1 ended with the uncomfortable truth: audit identity is not the same thing as agency. When agents enter the room, the user becomes the principal, the agent becomes the actor, and some connector/service account becomes the execution substrate.
Part 2 is the fix. A practical pattern that keeps those identities distinct and lets you stitch the story back together later, without inventing your own “audit log product”. The end goal is what NIST politely calls “logs stored in sufficient detail for an appropriate period of time”… and what your incident response team calls “please let this be over by lunch.”
This pattern has two artifacts:
And yes, we’re going to validate it with real logs, not hand-made fantasy fields.
We’ll use a deliberately simple “agent sends email” scenario, because it touches three different identity layers in one shot.
Identities (all different):
KaiC@.....microsoft.comAttributionDemoAgent
dbeab772-95c0-****-****-2e4a4846a64f AttributionDemoServiceAccount@.....microsoft.com
f6d4559a-deac-****-****-946afcca6b9ff2455496-bc0b-****-****-450302986a0fadmin@.....microsoft.comThe sequence:



Before tooling, decide what you’re optimizing for:
1- Convenience-first (don’t do this outside demos):
2- Accountability-first (the pattern):
If you want investigations to be survivable, you want accountability-first.
In agent systems, the agent isn’t “a feature”. It’s a software actor. Treat it that way:
Microsoft gives you visibility into Copilot/agent interactions via audit logs; for Copilot Interaction events, the audit data can include identifiers like AppHost, ThreadID, Contexts, MessageIDs, and AccessedResources depending on the interaction.
In our run, the host shows as Office because the interaction happened via the M365/Office web host.


The envelope is not “extra logging”. It’s the minimum set of fields you need so that six weeks later you can answer:
Important:
The envelope is not necessarily one log entry. It can be a stitched record sourced from platform logs + orchestration metadata. That’s literally what investigations are
.
Part 1 promised a CorrelationID that survives the whole workflow. Here’s the blunt reality:
The clean pattern is to use W3C Trace Context conventions where you control the hops (your orchestrator / your APIs), and use a “correlation token” you can reliably recover from business objects when you don’t.
In this demo, we used the simplest correlation token: a timestamp embedded in the email subject, which then shows up in the Exchange audit “Send” event.
In Purview Audit, this shows up as a Power Platform ApiEndpointCallEvent hitting the bot conversation endpoint (principal → platform hop).
For the agent-to-platform hop, the event that matters is:

Now we confirm the third identity: the tool identity that executed.
The below demonstrates that tool identity ≠ user identity, and it gives you an audited join point (the subject) to link back to the interaction timeframe.


Not:
But:
Part 1 told you why attribution breaks. Part 2 gave you the pattern that fixes it, and proved it with real audit artifacts:
If your attribution story can’t survive those three pivots, you don’t have attribution, you have a guessing hobby
.
0 comments