An agent can answer correctly without ever having actually consulted the requested resource: its model, its context or its cache can mask a network block. This lab isolates the Microsoft Entra Agent ID egress rules so you can produce usable evidence before any move to production.
Identity, authorization and network egress are three distinct controls
Since 1 May 2026, Microsoft Entra Agent ID has been generally available. The Microsoft Learn documentation states that the platform assigns an enterprise identity to agents and supports OAuth 2.0, MCP and A2A.
However, this identity only answers the question "which agent is acting?". Two further controls remain necessary: permissions determine what the agent can do on a resource, while egress rules limit the web paths it can reach.
Network access and application authorization must therefore be diagnosed separately:
- an egress rule allows or denies a connection to a destination;
- OAuth 2.0 and the resource's permissions then decide whether the action is permitted;
- logs let you tie the decision back to the agent's identity;
- Conditional Access for agents adds an access control, but does not replace restricting destinations.
An HTTP denial does not always prove a network block
A 401 or 403 code issued by the target resource generally indicates that the connection succeeded but authentication or authorization failed. Only the decision log can distinguish it from a denial produced by the egress control.
This separation becomes particularly important with MCP tools. Our overview of MCP Apps in Microsoft 365 Copilot complements this model by explaining how an agent calls external capabilities.
Prerequisites and licences to validate before the lab
Agent ID is available to all Microsoft Entra customers. However, extending Entra security features to agents requires Microsoft Agent 365, according to the Microsoft Learn reference page.
Microsoft Agent 365 is included in Microsoft 365 E7. It can also be added to Microsoft 365 E5, A5 or Business Premium. Microsoft also announced on 1 May 2026 a standalone offer at USD 15 per user per month.
| Need | Stated licence | Use in the lab |
|---|---|---|
| Create and identify an agent | Agent ID available to all Entra customers | Tie the tests to an agent identity |
| Extend security controls to agents | Microsoft Agent 365, included in Microsoft 365 E7 or offered as an add-on | Apply network and security controls |
| Apply Conditional Access to agents | Microsoft 365 E7, or Agent 365 with Entra P1 or Microsoft 365 E3 | Test Conditional Access decisions separately |
Prepare a test tenant, a dedicated blueprint and an agent with no access to production data. The agent must have a capability that makes a real web request; a response merely generated by the model cannot validate network egress.
Test tenant prerequisites
- An agent and a blueprint reserved for the lab
- A visible, identifiable Agent ID identity
- An egress rule that can be modified without affecting a production agent
- Three test URLs containing no sensitive data
- Access to the agent's logs or decision traces
- A fresh session for each probe to reduce the effects of context
The sources provided specify neither the minimum Entra role needed to modify an egress rule nor a guaranteed propagation delay. Use the least privileged role your environment offers, and do not validate the result until the reread configuration shows the new rule.
The scenario separates allowed path, host and authorization
Take the example of a team that lets its agent consult a single Agent ID documentation page. It wants to prove that the agent can neither freely browse the same domain nor reach another site.
The test uses three public destinations with no sensitive payload. The lab rule must allow only the T01 URL; T02 and T03 stay off the allow list.
| Test | Destination | Expected result |
|---|---|---|
| T01 — allowed path | https://learn.microsoft.com/en-us/entra/agent-id/what-is-microsoft-entra-agent-id | Network call allowed |
| T02 — same host, different path | https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id | Call blocked if the rule targets the exact path |
| T03 — different host | https://entra.news/p/if-you-manage-entra-permissions-watch | Call blocked |
T02 is the most instructive test: it reveals a rule that is too broad and would allow all of learn.microsoft.com instead of the explicitly intended path. T03 verifies that the agent does not benefit from general web egress.
Implementing the lab and collecting evidence
The following script does not modify any cloud resource. It creates the test plan, checks that the destinations respond from the admin workstation, and prepares the file in which to record the agent's observations.
Required module: none. Cloud permission: none; the local account only needs to be able to write to the output directory and make HTTPS requests. The script produces tests.json, baseline.csv and observations.csv.
1[CmdletBinding()]2param(3 [Parameter()]4 [string]$OutputDirectory = (Join-Path -Path (Get-Location) -ChildPath 'entra-agent-egress-lab')5)6 7$ErrorActionPreference = 'Stop'8New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null9 10# Définition des trois sondes et du verdict attendu côté agent.11$tests = @(12 [pscustomobject]@{13 TestId = 'T01'14 Scenario = 'Chemin explicitement autorisé'15 Uri = 'https://learn.microsoft.com/en-us/entra/agent-id/what-is-microsoft-entra-agent-id'16 ExpectedAgentDecision = 'Autorisé'17 }18 [pscustomobject]@{19 TestId = 'T02'20 Scenario = 'Même hôte, chemin non autorisé'21 Uri = 'https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id'22 ExpectedAgentDecision = 'Bloqué'23 }24 [pscustomobject]@{25 TestId = 'T03'26 Scenario = 'Hôte non autorisé'27 Uri = 'https://entra.news/p/if-you-manage-entra-permissions-watch'28 ExpectedAgentDecision = 'Bloqué'29 }30)31 32# Vérification de référence depuis le poste administrateur.33# Elle confirme la disponibilité des URL, pas le comportement de l’agent.34$baseline = foreach ($test in $tests) {35 try {36 $response = Invoke-WebRequest -Uri $test.Uri -Method Get -MaximumRedirection 5 -ErrorAction Stop37 [pscustomobject]@{38 TestId = $test.TestId39 Uri = $test.Uri40 ReachableFromAdminWorkstation = $true41 HttpStatus = [int]$response.StatusCode42 Error = ''43 CheckedAtUtc = [DateTime]::UtcNow.ToString('o')44 }45 }46 catch {47 [pscustomobject]@{48 TestId = $test.TestId49 Uri = $test.Uri50 ReachableFromAdminWorkstation = $false51 HttpStatus = ''52 Error = $_.Exception.Message53 CheckedAtUtc = [DateTime]::UtcNow.ToString('o')54 }55 }56}57 58$observations = foreach ($test in $tests) {59 [pscustomobject]@{60 TestId = $test.TestId61 Uri = $test.Uri62 ExpectedAgentDecision = $test.ExpectedAgentDecision63 AgentDecision = ''64 EvidenceUtc = ''65 Evidence = ''66 }67}68 69$tests | ConvertTo-Json -Depth 4 | Set-Content -Path (Join-Path $OutputDirectory 'tests.json') -Encoding utf870$baseline | Export-Csv -Path (Join-Path $OutputDirectory 'baseline.csv') -NoTypeInformation -Encoding utf871$observations | Export-Csv -Path (Join-Path $OutputDirectory 'observations.csv') -NoTypeInformation -Encoding utf872 73Write-Host "Plan de test créé dans $OutputDirectory"74$baseline | Format-Table -AutoSizeDo not attach the lab rule to a production agent
An incomplete allow list can interrupt an agent's external calls. Verify the targeted identity and blueprint before saving the rule.
Limit the rule to the T01 path
In the egress configuration associated with the test agent, allow only https://learn.microsoft.com/en-us/entra/agent-id/what-is-microsoft-entra-agent-id. Reread the saved value before launching the probes.
Run T01 in a fresh session
Explicitly request a network call and forbid an answer drawn from the model's memory.
1Effectue maintenant une requête web réelle vers https://learn.microsoft.com/en-us/entra/agent-id/what-is-microsoft-entra-agent-id. N’utilise ni ta mémoire ni une réponse déjà présente dans le contexte. Retourne uniquement un objet JSON contenant testId, networkCallAttempted, target, result, httpStatus et error. Utilise T01 comme testId et recopie tout message d’erreur sans le reformuler.Test the unauthorized path on the same host
Open a new session so that the T01 content cannot be reused.
1Effectue maintenant une requête web réelle vers https://learn.microsoft.com/en-us/entra/identity/conditional-access/agent-id. N’utilise ni ta mémoire ni une réponse déjà présente dans le contexte. Retourne uniquement un objet JSON contenant testId, networkCallAttempted, target, result, httpStatus et error. Utilise T02 comme testId et recopie tout message d’erreur sans le reformuler.Test a destination on a different host
Run the last probe in a third session.
1Effectue maintenant une requête web réelle vers https://entra.news/p/if-you-manage-entra-permissions-watch. N’utilise ni ta mémoire ni une réponse déjà présente dans le contexte. Retourne uniquement un objet JSON contenant testId, networkCallAttempted, target, result, httpStatus et error. Utilise T03 comme testId et recopie tout message d’erreur sans le reformuler.Next, fill in AgentDecision, EvidenceUtc and Evidence in observations.csv. The verdict should come primarily from the logs or the tool trace, not from the agent's text response alone.
This second script compares the observations with the expected result and returns an error if any test diverges.
1[CmdletBinding()]2param(3 [Parameter()]4 [string]$ObservationFile = (Join-Path -Path (Get-Location) -ChildPath 'entra-agent-egress-lab/observations.csv')5)6 7$ErrorActionPreference = 'Stop'8$observations = Import-Csv -Path $ObservationFile9 10$incomplete = $observations | Where-Object {11 $_.AgentDecision -notin @('Autorisé', 'Bloqué')12}13 14if ($incomplete) {15 $ids = ($incomplete.TestId -join ', ')16 throw "Observations manquantes ou invalides pour : $ids. Utilisez uniquement Autorisé ou Bloqué."17}18 19$results = foreach ($observation in $observations) {20 [pscustomobject]@{21 TestId = $observation.TestId22 Expected = $observation.ExpectedAgentDecision23 Observed = $observation.AgentDecision24 Passed = ($observation.AgentDecision -eq $observation.ExpectedAgentDecision)25 EvidenceUtc = $observation.EvidenceUtc26 Evidence = $observation.Evidence27 }28}29 30$reportPath = Join-Path -Path (Split-Path $ObservationFile) -ChildPath 'validation-report.csv'31$results | Export-Csv -Path $reportPath -NoTypeInformation -Encoding utf832$results | Format-Table -AutoSize33 34$failures = $results | Where-Object { -not $_.Passed }35if ($failures) {36 throw "Le contrôle de sortie ne correspond pas au résultat attendu. Rapport : $reportPath"37}38 39Write-Host "Tous les tests sont conformes. Rapport : $reportPath"Checking the logs and troubleshooting false results
Solid evidence combines the agent's identity, the requested URL, the UTC timestamp and the decision. Add the exact error message when the call is blocked; field names and log locations may vary depending on the control plane used.
Post-run checks
- T01 is allowed in a session with no prior context
- T02 is blocked despite T01 being allowed on the same host
- T03 is blocked on a different host
- Each attempt has a trace matching the lab identity
- The times of the response, the tool and the log are consistent
- The test rule is not associated with any production agent
| Symptom | Likely cause | Resolution |
|---|---|---|
| T01 is blocked | Path copied incorrectly, rule tied to the wrong agent, or change not applied | Reread the exact URL and the targeted identity, then repeat in a new session |
| T02 is allowed | The rule allows the entire host rather than the path | Narrow the scope to the T01 path, then replay T01 and T02 |
| T03 is allowed | General egress still active or rule not associated with the right blueprint | Check the rule association and look for a broader authorization |
| The agent answers with no network trace | Response produced from the model, the context or a cache | Require a real tool call and start again from an empty session |
| The target returns 401 or 403 | Network egress allowed but authentication or permission denied | Identify the issuer of the code, then check OAuth and the resource's permissions |
| No permission is inherited | Resource not marked as an inheritable resource on the blueprint | Change the blueprint's inheritance before re-evaluating permissions |
Platform limits to build into governance
Permissions granted to a blueprint's principal are not automatically passed on to all agent identities. As Entra.News reports based on guidance from Erin Greenlee, the resource concerned must be declared as an inheritable resource on the blueprint.
This requirement is not an egress rule: it comes into play after network access, at the authorization stage. A destination can therefore be reachable while still refusing the requested action.
1 May 2026
Agent ID and Agent 365 generally available
The identity platform and the Agent 365 controls leave preview.
4 November to end of November 2026
Blueprint creation open by default
Message MC1506733 indicates that default users can create blueprints. Administrators can set Users can create agent blueprints to No.
17 November 2026
Automated lifecycle generally available
The default policy disables agents that have been inactive for 60 days. Discovered local agents and digital teammates remain in preview.
1 December 2026
Foundry workflows retired
Workflows are retired in favour of Microsoft Agent Framework.
In Microsoft Foundry, formerly Azure AI Foundry, the core agents are generally available. Agent guardrails, monitoring and compliance nonetheless remain in preview according to Microsoft Learn. To place these changes within the agent architecture, also see our analysis of the new Copilot Studio agent harness.
Frequently asked questions
Is Microsoft Entra Agent ID still in preview?
No. Microsoft Entra Agent ID has been generally available since 1 May 2026. Some extensions, notably discovered local agents and digital teammates, nonetheless remain in preview.
Is an Agent 365 licence required to create an agent identity?
Agent ID is available to all Microsoft Entra customers. Microsoft Agent 365 is required to extend the Entra security features described by Microsoft to agents.
Does an HTTP 403 code mean the egress rule is working?
Not necessarily. If the code comes from the target resource, the network connection probably succeeded and the denial concerns authorization. Check the decision log and the issuer of the error before concluding.
Why must each test be restarted in a new session?
An existing session may contain an earlier response or enough context for the model to answer without a new network call. An empty conversation reduces this false positive, but the tool trace remains the primary evidence.
Where to start before a real deployment
First run T01, T02 and T03 with an agent that has no business permissions. If these three checks pass, then add OAuth, the permissions inherited from the blueprint and finally Conditional Access, replaying the lab after each layer.
Recommended deployment order
- Disable free blueprint creation if governance does not provide for it
- Identify the agent, its blueprint and the operational owner
- Validate the egress rule with non-sensitive destinations
- Explicitly mark the resources whose permissions must be inherited
- Add application permissions following least privilege
- Test Conditional Access separately
- Archive the CSV report and the traces associated with the change
Going further
- What is Microsoft Entra Agent ID? — architecture, blueprints, protocols and licences.
- Conditional Access for agents in Microsoft Entra — access templates and licence prerequisites.
- If You Manage Entra Permissions, Watch This Before Deploying Agents — the blueprint permission inheritance trap.
- Microsoft Entra announcements from Ignite 2026 — lifecycle, governance and features still in preview.
- Foundry Control Plane and Agent 365 — division of responsibilities between Foundry and Agent 365.



