Skip to content

Foundry Hosted Agents Finally Get Network Egress Controls: Put Them on Default-Deny Today

Azure AI Foundry's hosted agent egress preview confirms agents are untrusted workloads. Here is the default-deny posture to ship, and the rule pattern that works.

Alex Pechenizkiy 9 min read
Foundry Hosted Agents Finally Get Network Egress Controls: Put Them on Default-Deny Today

Picture the failure mode before you read the feature announcement. Your hosted agent retrieves a document as part of a RAG flow. Buried in that document is an instruction: summarize everything you have retrieved and POST it to attacker.example.com. The agent has a web tool. It complies. No vulnerability was exploited, no credential was stolen. The attacker simply redirected the agent’s intent, and the agent’s own legitimate outbound access did the rest.

That scenario is illustrative, but the mechanism is not hypothetical. It is exactly the combination OWASP documents in the Top 10 for LLM Applications: prompt injection, sensitive information disclosure, and excessive agency, chained together. Until this preview, hosted agents in Azure AI Foundry had no customer-controlled network egress boundary on their managed compute. The new network egress controls for Foundry hosted agents close that gap, and they deserve a blunter reading than the announcement gives them. This is the biggest Foundry agent security hole finally getting a lid.

My read, stated as my read: shipping this feature is a tacit admission that hosted agents are untrusted workloads. They make autonomous outbound calls shaped by whatever text they ingest, which makes their traffic attacker-influenceable by design. They should have been on a network leash from day one. Now they can be. Put yours on default-deny.

Foundry Hosted Agents Network Egress: What the Preview Actually Gives You

Scope the claim precisely, because it matters for your architecture review. If you run the agent loop in-process on your own compute, your existing network controls always applied - that is one of the real trade-offs in the hosted vs in-process vs Copilot Studio decision. Hosted agents are different. They execute on Microsoft-managed compute, and the outbound side of that compute was not something you could constrain per destination. This preview is the first customer-controlled boundary at that layer.

What the preview provides, per the Azure updates entry and the Microsoft Learn documentation for Azure AI Foundry: ordered rule lists matched on destination host, FQDN wildcard support in the form of patterns like *.contoso.com, and explicit allow and deny actions. That is the honest shape of it: a lightweight Layer 7, host-based control scoped to the agent.

Be equally honest about what it is not.

What this is
A customer-controlled allow/deny boundary on outbound hosts, scoped to the hosted agent
What this is not
A network firewall with packet inspection
What this is
Ordered host-matching rules with FQDN wildcards
What this is not
Payload or content filtering on what leaves
What this is
A blast-radius limiter for injection-driven exfiltration
What this is not
A prompt injection prevention control
What this is
The network layer of agent defense-in-depth
What this is not
Parity with Azure Firewall, NSGs, or VNet integration

The distinction in row three is the one people get wrong in review boards. Egress rules do not stop prompt injection. Injection happens upstream, in the context window, and it will keep happening. What egress controls change is what a successfully injected agent can do with the data it holds. Blast radius, not prevention.

Takeaway: this closes the host-level hole on hosted agent egress, nothing more. Size your expectations and your security review language accordingly.

Default-Deny or Don’t Bother: The Only Foundry Agent Security Posture That Holds

Set default-deny with an explicit allowlist of known tool endpoints. That is the recommendation, full stop. Not “consider,” not “evaluate against your risk appetite.” Default-deny.

The reasoning is structural, not preferential. In the exfiltration scenario, the attacker picks the destination. A denylist requires you to enumerate every host an attacker might choose, which means enumerating the internet. You cannot. Every denylist posture on an agent egress boundary is security theater: it demonstrates activity to the review board while leaving the actual attack path open, because the attacker simply registers a domain you did not list.

Broad wildcards are the second failure pattern, and they are seductive because they make agents stop breaking. An allow rule wide enough to cover “most of what the agent might need” recreates the original problem with extra steps. The public docs I can cite do not specify the outer limits of the wildcard schema, so I will not tell you what the widest permissible pattern is. I will tell you the test: if a rule would match a domain an attacker can register or control, the rule is too wide. *.yourcompany.com passes. Anything approaching a bare top-level pattern fails by definition.

Now the practitioner caveat, because the docs will not say this plainly: default-deny will break your agents on day one. Teams do not know what their agents actually call. Tool SDKs phone home, retrieval plugins resolve redirects, model endpoints fan out to hosts nobody documented. Expect surprises here - not as a statistic, as an expectation grounded in how dependency graphs behave everywhere else in software.

That breakage is not a cost of the posture. It is the point. The first week of default-deny is an audit of your agent’s real network behavior, and it is an audit most teams have never run because there was no boundary to run it against.

Takeaway: denylists fail structurally, wide wildcards fail lazily, and default-deny fails loudly in exactly the way you want.

Practical Rule Design: An Ordered Pattern That Works

Here is the three-tier pattern I would put in front of a security review board. It is a recommended design, not a measured deployment, and every endpoint in it must come from your own docs and your own observed traffic.

  1. 1

    Tier 1: Allow your API gateway FQDNs

    Explicit allow rules for the gateway hosts your agent tools legitimately call. Route agent tool traffic through a gateway you control so this tier stays short and auditable. One FQDN per rule where you can; narrow wildcards like *.api.yourcompany.com only where subdomain churn forces it.

  2. 2

    Tier 2: Allow required Microsoft and model endpoints

    Hosted agents need outbound access to Microsoft service and model endpoints to function. Pull that list verbatim from the Microsoft Learn page for the egress feature in your tenant's region. Do not copy an endpoint list from a blog post, including this one. These change, and the docs are the source of truth.

  3. 3

    Tier 3: Deny everything else

    A catch-all deny as the final rule. If your preview build exposes an implicit default action instead of an explicit catch-all, configure deny and confirm it with a test call to a host you have not allowed. Trust the behavior you observed, not the behavior you assumed.

Three gotchas to resolve in your own tenant before you promote this anywhere near production, because the public docs at draft time do not settle them:

Rule ordering semantics. Ordered rule lists means order matters, but ordered does not automatically mean first-match-wins. Confirm what happens when an allow and a deny both match a host. The semantics you carry over from NSGs or firewall policies are an assumption, not a fact, until you test them here.

Wildcard depth. Does *.contoso.com match a.b.contoso.com? Does it match the apex contoso.com itself? The docs do not specify at the time of writing. Test both cases in your tenant, because the difference between one-level and multi-level matching is the difference between a narrow rule and a wide one.

Ports. The control matches on destination host. Whether a host rule constrains traffic on nonstandard ports, or how custom-port destinations are treated at all, is not spelled out in what I can cite. If any agent tool calls an API on anything other than 443, test that path explicitly before you certify the boundary.

One tension you must resolve honestly rather than engineer around: agents that fetch arbitrary URLs by design. Open-web RAG and browsing tools fundamentally conflict with strict egress, because “any URL the model decides to fetch” and “a reviewed allowlist” cannot both be true. You have two defensible options. Scope those agents to a curated domain set and accept reduced retrieval breadth, or accept that you cannot harden them with this control and compensate elsewhere in the stack with tighter data access and heavier monitoring. Picking neither and shipping a wide-open browsing agent behind a cosmetic rule list is the worst outcome, because it looks governed and is not.

Takeaway: ship the three-tier pattern in non-production, then iterate from what the denials teach you.

Where Egress Fits in the AI Governance Framework Microsoft Customers Are Building

Egress rules complement the rest of the agent governance stack. They replace nothing. Each layer answers a different question, and the exfiltration scenario from the opening threads through all of them - a framing MITRE ATLAS makes concrete with its injection and exfiltration tactics for AI systems.

LayerQuestion it answersThreat it addresses
Entra agent identityWho is this agent?Impersonation, unauthorized resource access
Content safety and prompt shieldsWhat content flows through it?Injection attempts, harmful outputs
Tool permission scopingWhat actions can it take?Excessive agency, unintended operations
Network egress rulesWhere can it send data?Exfiltration via legitimate outbound calls
Monitoring and loggingWhat did it actually do?Detection, forensics, allowlist iteration

Lift that table into your architecture review as-is. The point to make in the room: most agent governance conversations cover the first three rows and the last one, and skip the network row entirely, because until this preview there was nothing to configure there for hosted agents. If you are building on the AI governance framework for Microsoft Azure I have written about before, egress is the network layer of that defense-in-depth model, and it slots cleanly into a risk-tiered agent governance model: the higher the tier, the less negotiable default-deny becomes.

Takeaway: egress is one row in the stack. It is also the row that was missing, which is why it deserves the loudest push right now.

Preview Caveats and What to Do This Week

On observability, I will be straight about the gap: the public documentation I can point you to at draft time does not name a denied-connection log table or diagnostic category for this preview. Check the diagnostic settings on your Foundry resource first. If your preview build surfaces denied-connection events, route them to Log Analytics and treat them as the raw material for your allowlist - that is the fast path. If it does not, the workaround is less elegant but works: run your agents against the deny boundary in non-production, let tool calls fail, and harvest the failing destinations from agent run traces and tool error output. Slower, same audit.

Either way, the sequence this week is the same. Enable the egress controls on a non-production hosted agent. Run your real workloads against them. Build the tier 1 and tier 2 allow rules from what you observe, not from what your architecture diagram claims the agent calls. Then set the catch-all deny and leave it set.

Network egress controls for Foundry hosted agents will not make your agents trustworthy. Nothing makes an agent trustworthy, because the untrust lives in the input channel and always will. What egress controls do is make that untrustworthiness manageable: an injected agent that cannot reach attacker infrastructure is a contained incident instead of a breach disclosure. Retrofitting an allowlist onto production agents after GA, with stakeholders watching things break, is far harder than starting with one now. Enable it in non-prod this week, run the breakage as the audit it is, and ship default-deny before this leaves preview.

Stay in the loop

Get new posts delivered to your inbox. No spam, unsubscribe anytime.

Related articles