Back to all posts

cat posts/entra-agent-id-gives-claude-code-its-own-audit-trail.md --category "Security & Compliance" --views 26

Entra Agent ID gives Claude Code its own audit trail

Microsoft announced at Ignite 2026 that Entra Agent ID will automatically assign an identity to discovered local agents, starting with Claude Code and GitHub Copilot CLI, so agent activity stops being recorded as employee activity. Most of it is preview, Agent 365 keeps observability data for only 30 days, and Defender local agent discovery does not run in sovereign clouds, so here is what an EU enterprise can rely on today.

  • --author By Falak Mahmood
  • --date November 19, 2026
  • --read 15 min read
  • --views 26 views

Microsoft Entra Agent ID is being extended to assign an identity automatically to local AI agents that Microsoft Defender and Entra Global Secure Access discover on managed devices, starting with GitHub Copilot CLI and Claude Code. Microsoft announced it at Ignite 2026, which ran 17 to 20 November. It is in preview. For anyone who has sat in an access review trying to explain which lines in a sign-in log were a person and which were that person's coding agent, this is the capability that matters, and it arrives on developer laptops rather than in a governed cloud runtime.

Shipped and announced are different things here, and the difference is not pedantry. A preview feature carries no service-level agreement, and Microsoft's own wording says it is not recommended for production workloads, so it cannot answer an audit finding either.

The failure this addresses

We have made the same argument repeatedly since the autumn: an agent acting on an employee's credential is indistinguishable from that employee in an audit log. We set it out in detail when OpenAI shipped always-on agents, in whose action was that. The mailbox records that the owner sent the mail. The repository records that the developer pushed the commit. The access review sees a person who looks busy at 03:10.

Three problems hide inside that one symptom. Attribution fails, so an incident timeline cannot separate an instruction from an inference. Lifecycle fails, because a credential belonging to a human has no expiry, sponsor or review cycle of its own. Policy fails, because Conditional Access on the human either blocks the human too or blocks nothing.

Microsoft's answer makes the agent a first-class directory object. Entra Agent ID introduces four object types: an agent identity blueprint, a blueprint principal, an agent identity, and an agent user. The blueprint is the template, analogous to an app registration. The agent identity is a running instance, analogous to a service principal. The agent user lets an agent act with user-delegated permissions. Each can hold distinct access rights.

What the audit log actually records

This is the part worth reading closely, because the separation is not a new log. Microsoft Learn is explicit: "Agent activity is logged under the base identity type from where the activity originates." Blueprint activity appears as application events. Agent identity activity appears as service principal events. An agent's user account appears as user events, including plain "Add user" entries.

What you get instead is a property. An agentType field now appears on initiatedBy, performedBy and targetResources, and anything other than notAgentic indicates agent involvement. The documented values are agenticApp for a blueprint, agenticAppInstance for an agent identity, agentIdentityBlueprintPrincipal for the blueprint's own principal, and agentIDuser for an agent's user account. A blueprintId property lets you correlate an instance back to its template.

Sign-ins add a new event type, agentSignIn, exposed in the Entra admin center under Sign-in logs with filters for Agent type and a yes/no Is Agent filter. Microsoft notes that because agents can sign in with either user-delegated or app-only permissions, "their sign-ins might appear across each of the four sign-in log types."

Read that as an engineering task, not a feature. Every KQL query, Sentinel analytic rule, workbook and access-review export your team has written assumes an actor is a user or a service principal. None of them know about agentType yet. Two further gotchas are documented. Agent log data is served by Microsoft Graph on the /beta endpoint. And two of the enum values are part of an evolvable enumeration, so you need a request header to receive them at all.

# Agent ID logs are served on Graph /beta. Service-principal category only;
# repeat with the other sign-in event types to cover delegated flows.
GET https://graph.microsoft.com/beta/auditLogs/signIns
  ?$filter=signInEventTypes/any(t: t eq 'servicePrincipal')
    and agent/agentType eq 'AgentIdentity'

# Without this header, agentIdentityBlueprintPrincipal and agentIDuser
# are not returned in audit log responses.
Prefer: include-unknown-enum-members

Status, capability by capability

Statuses below are as stated on the pages cited at the end. Where the Ignite blog and Microsoft Learn disagree, both readings appear.

Capability Status What it does
Entra Agent ID platform Available to all Entra customers Blueprints, agent identities and agent users as directory objects
Agent ID for discovered local agents Preview Identity assigned to local agents found by Defender and Global Secure Access, starting with Copilot CLI and Claude Code
Single-instance agent identities Preview, tenant enablement required One identity shared by an agent's installations or replicas, including device-installed agents
Local AI agent discovery in Defender for Endpoint Available on Windows and macOS; macOS VS Code extension entries in preview Inventory of agents and their configured MCP servers, plus hunting tables
Runtime protection for local agents Generally available on Windows Inspects points in the agent loop for Claude Code and Copilot CLI
Local Agents page in the Microsoft 365 admin center Public preview, Frontier program Detection, usage metadata and selective blocking of local developer agents
Agent ID for Microsoft Autopilot Preview Extends agent identity to Autopilot agents
Automated lifecycle management of agent identities Announced GA; Learn marks lifecycle policies as preview Checks for a sponsor, continued need and recent activity, then disables
Default agent inactivity policy Preview, no licence required Notify at 60 days inactive, disable at 90, delete at 455
Conditional Access for assistive agents Preview Blocks a risky agent while the employee it acts for keeps working
Export agent activity Generally available Syncs Agent 365 agent traces into Azure Monitor and Application Insights
Customer-managed keys for agent data Preview, listed under Azure SRE Agent Customer control of the keys over agent data

What it does not give you

Six limits are documented, and each one changes a plan somebody is already drawing up.

Retention is 30 days. "Agent 365 stores observability data for 30 days. After this period, the data is automatically deleted." No Swedish supervisory authority, and no external auditor, works on a 30-day window. The fix exists and is generally available: Export agent activity syncs traces into Azure Monitor and Application Insights, where you set the retention. Treat that export as mandatory rather than optional, because without it your agent evidence has a one-month horizon.

Discovery is not proof of use. Defender's documentation is unusually careful here: "observing the agent's process running can be enough for an inventory entry. The user doesn't need to submit a prompt or have permission to use the agent's service. Discovery doesn't prove active use or successful access to an AI service." An inventory of 400 Claude Code installations counts installations, not activity. Presenting it as usage will not survive the first follow-up question.

Detection and blocking are not the same list. In the Local Agents preview, Claude Code, GitHub Copilot CLI, Codex CLI, Cursor, Windsurf and Warp are listed as detectable but not blockable. Blocking is available for Gemini CLI and for the VS Code extension agents. Node.js-based agents share a single run type, so blocking one blocks OpenClaw, QClaw, Claw/Nanobot and Gemini CLI together, and lifting the block lifts it for all of them.

Local agents have no authentication edge. In the Defender exposure graph, cloud agents carry a "can authenticate as" edge to a service principal or Entra OAuth app. Local agents do not, so the identity behind a local agent resolves only through the "used by" edge to the human account it runs under. That is the old attribution problem one layer down, and it is why minting an Agent ID for discovered local agents is the interesting part of the announcement rather than the discovery itself.

Agent 365 is not yet a Core Online Service. Microsoft states it plainly: Agent 365 "isn't yet classified as a Core Online Service under the Microsoft Product Terms," though it runs on services that are, and Microsoft says it is working to change that. Agent 365 also "doesn't currently support Advanced Data Residency." If your contract leans on ADR, that lever is unavailable.

It does nothing for the AI Act's disclosure duty. Agent ID is an identity and audit control. Article 50(1) of the EU AI Act requires that providers of AI systems intended to interact directly with natural persons design them so people are informed they are interacting with an AI system. An Agent ID in your tenant is invisible to the person on the other end of the conversation. These are separate obligations met by separate means.

Preview is not a control you can present

Microsoft's preview language is identical on every relevant page: no service-level agreement, not recommended for production workloads, some features possibly unsupported or constrained. An assessor who reads that will not accept the feature as a control, and should not.

Single-instance agent identities, which is the shape a device-installed agent needs, go further. Learn instructs you to "Confirm preview availability and tenant enablement with your Microsoft representative before you begin," and notes that provisioning and authentication are enabled separately. A tenant can be enabled to create these identities and still not be enabled to issue tokens for them. Plan for a conversation with your account team, not a portal toggle.

There is one status conflict worth flagging. The Entra Ignite announcement lists automated lifecycle management of agent identities as generally available. The Learn page for the default inactivity policy, last updated 30 October 2026, carries the banner "Agent ID lifecycle policies are in preview." Until Learn catches up, cite the narrower claim in anything that goes to a regulator. The underlying behaviour is useful either way, and it needs no licence: notification to sponsors and owners at 60 days of inactivity, disable at 90, delete at 455, with the timings fixed for default-policy users and an exclusion list for seasonal agents.

Developer machines first, which is a different conversation

Governing a cloud agent is a platform conversation. You own the runtime, the identity and the network path. Governing Claude Code on a senior engineer's laptop is a workplace conversation, and the prerequisites say so.

Discovery needs devices onboarded to Defender for Endpoint with Plan 2 as the minimum licence, Defender Antivirus in active mode with real-time protection, and a recent platform build: Windows needs Defender Antivirus platform version 4.18.26090.9 (2609) or later, macOS needs Defender for Endpoint 101.26072.0017 or later. Risk levels, risk indicators and recommendations for discovered agents need Microsoft 365 E7, or Agent 365 together with Defender for Endpoint Plan 2. The Local Agents page in the Microsoft 365 admin center needs a Microsoft 365 E3 licence to view, Intune enrolment for managed Windows devices, and Frontier preview opt-in. Several of its most useful fields, including the user count, the unique endpoints an agent reached and the volume of data it sent, populate only when Global Secure Access is enabled, which needs an Entra Internet Access, Entra Suite or Microsoft 365 E7 licence.

Two signals in the inventory are worth a standing query from day one. Defender reports autoApprove, whether the agent acts without prompting the user, and trustedProcess, whether the host process is trusted. Both are reported as the strings "true" and "false" rather than booleans, so comparisons with tobool() silently fail. An agent that auto-approves its own actions runs tools and reaches resources without a person confirming each step, which makes the account and device it runs under the real boundary.

// Local agents that act without approval or run in an untrusted process.
// Note the string comparison: autoApprove is not a boolean.
AgentsInfo
| where Platform == "LocalAgents"
| summarize arg_max(Timestamp, Name, Version, LifecycleStatus, RawAgentInfo)
    by AgentId
| where LifecycleStatus !in~ ("Deleted", "Uninstalled")
| extend M = RawAgentInfo.localAgentMetadata
| extend AutoApprove = tostring(M.autoApprove),
         TrustedProcess = tostring(M.trustedProcess),
         Vendor = tostring(M.vendor),
         Device = tostring(M.deviceName),
         Account = tostring(M.accountName)
| where AutoApprove =~ "true" or TrustedProcess =~ "false"
| project Agent = Name, Vendor, Version, Device, Account,
          AutoApprove, TrustedProcess

The inventory also lists the MCP servers each agent is configured with, remote and local, and for a local MCP server it records the command that starts it. For most organisations that will be the first complete list of what their developers' agents can actually reach. Expect it to be longer than anyone predicted.

Residency, sovereignty and the Swedish angle

Three documented facts matter for an EU tenant. Agent 365 observability "stores customer content in the default geography of the tenant," which is the country or region chosen when the Entra tenant was created. In limited scenarios, service-generated data such as metrics and analytics "might be replicated and stored in the European Union (EU) for EU-based tenants, and in the United States for tenants in all other regions," and Microsoft states that "Agent 365 honors EU Data Boundary (EUDB) commitments." Agent 365 does not support Advanced Data Residency.

The sharpest constraint is in the Defender prerequisites: "Your environment is in the commercial cloud. Sovereign and national clouds aren't supported." If your tenant sits in a sovereign cloud, local AI agent discovery is not available to you, and neither is anything built on top of it. There is also a note that for tenants in a named set of regions including Spain, Austria and Denmark, Agent 365 only stores data once the customer starts a trial or buys a licence and accepts the Agent 365 terms of use. Sweden is not in that list, which means Swedish tenants are on the standard path.

Sweden's cybersäkerhetslagen, SFS 2025:1506, brought NIS2 into Swedish law on 15 January 2026. Its demands are organisational before they are technical: systematic cybersecurity work, greater management participation, and reporting of incidents that cause or may cause significant disruption. Agent identity feeds the third of those directly. An incident report that cannot say whether an action was taken by a named employee or by an agent running under that employee's credential is an incomplete report, and the gap is visible to anyone reading it. That is the accountability argument for doing this work, and it is stronger than the compliance-checkbox argument.

Article 50 of the EU AI Act has applied since 2 August 2026, with systems already on the market before that date having until 2 December 2026 to meet the machine-readable marking requirements of Article 50(2). Article 50(1) binds providers, and a company that builds an internal agent for its own staff is the provider of that system. None of the Ignite announcements touch this duty. Keep the two workstreams separate so neither gets credited with the other's evidence.

Do now, wait for later

Action Now or wait Why
Inventory local agents and their MCP servers in Defender Now Needs only Defender for Endpoint Plan 2 and a current platform build
Enable Export agent activity into Azure Monitor Now GA, and the only way past the 30-day Agent 365 retention
Teach your detections and workbooks about agentType Now The schema change is live; your queries are the thing that is behind
Enable the default agent inactivity policy Now, with an exclusion list No licence required; set fallback recipients first, or ownerless agents notify nobody
Assign sponsors to every agent identity you already have Now Sponsorship is the accountability link the lifecycle features act on, and it transfers to a manager when a sponsor leaves
Write the agent policy your developers will be measured against Now Blocking is unavailable for most CLI agents, so the control is a written rule plus visibility
Pilot Agent ID for discovered local agents Pilot, do not commit Preview, no SLA, and single-instance identities need tenant enablement
Name Agent ID as a control in a NIS2 or ISO submission Wait Preview features and a Graph beta endpoint are not defensible audit evidence
Rely on customer-managed keys for agent data Wait Preview, and announced for Azure SRE Agent rather than the whole agent estate
Plan around Agent 365 as a contractual data-processing boundary Wait Not yet a Core Online Service, and no Advanced Data Residency support

The judgement call

Microsoft has shipped the right abstraction. An agent with its own directory object, access assignments, sponsor and line in the sign-in log is the correct model, and a year of industry argument has produced no alternative. For any organisation already standardised on Entra, which includes most Swedish enterprises, this is now the default answer.

The gap is between the model and the evidence. Audit data sits behind a beta Graph endpoint for 30 days unless you export it. The capability that matters most for developer machines is in preview and needs tenant enablement by hand. Blocking misses the agents your engineers actually run. Sovereign clouds are excluded from discovery.

So build the inventory, wire the export, assign the sponsors, and write the policy. Those four are available today and none of them depend on a preview. Then pilot the local-agent Agent ID with one team and a short list of things you expect it to prove. When we design agent platforms as part of Azure OpenAI integration work, the identity model goes in before the first agent reaches a production dataset, because retrofitting attribution onto an agent estate that already has one is work nobody budgets for twice.

subscribe # the AI news that matters, minus the noise

Book a Call

Sources

Tags

Related posts