Introduction
AI agents are increasingly being connected to APIs, databases, internal services, file stores, and external applications. This makes them useful, but it also creates a security boundary that needs to be designed carefully.
An agent may need network access to complete a task, but unrestricted connectivity can create unnecessary risk. An agent that can reach every available endpoint may be able to access services that were never required for its job.
Network access should therefore be treated as part of the agent's security architecture, not as an afterthought.
Microsoft Foundry provides capabilities for building and operating AI applications and agents. When deploying agents that interact with external resources, developers need to understand how networking, identity, authorization, and application-level controls work together.
This article explains the main principles for controlling AI agent network access in Microsoft Foundry and how to design a more controlled production architecture.
Why Network Access Matters for AI Agents
A traditional application normally follows predefined code paths.
An AI agent introduces another decision-making component:
User
|
v
AI Agent
|
+----> API
|
+----> Database
|
+----> Search
|
+----> External Service
The model can decide which available tool or capability should be used based on the request and instructions.
That makes the list of available network destinations important.
For example, an expense-processing agent may need access to:
Expense API
Document Storage
Approval Service
It probably does not need direct access to:
Payroll Database
Production Administration API
Customer Identity Database
Internal Management Console
Giving the agent access to all of them increases the attack surface.
Network Access and Authorization Are Different
One of the most important concepts is that network reachability is not the same as authorization.
Consider:
Agent
|
v
Network
|
v
Internal API
|
v
Authorization
|
v
Business Operation
Network controls determine whether traffic can reach a destination.
Identity and authorization determine whether that destination should allow the requested operation.
Both layers are necessary.
An application should not assume that because an endpoint is unreachable from the public internet, an AI agent is automatically authorized to use it.
A Layered Security Model
A practical architecture uses several controls.
User
|
v
Agent Application
|
+--------+--------+
| |
v v
Model/Agent Policy Layer
|
v
Tool Authorization
|
v
Network Controls
|
+-------------+-------------+
| | |
v v v
API Storage External Service
Each layer has a different responsibility.
Layer | Primary responsibility |
|---|---|
Identity | Establish who is making the request |
Agent instructions | Define intended behavior |
Tool authorization | Control which actions are allowed |
Network controls | Restrict connectivity |
API authorization | Enforce service-level permissions |
Data permissions | Restrict accessible information |
Monitoring | Detect unexpected behavior |
The model should not be the only security mechanism.
Define the Agent's Network Requirements
Before configuring networking, document exactly what the agent needs.
For example:
Agent: Invoice Processing Agent
Required:
- Invoice API
- Document storage
- Vendor validation API
Not required:
- Employee database
- Production database
- Administration APIs
- Internal source-control systems
This creates a simple allowlist.
An allowlist approach is generally easier to reason about than giving an agent broad access and attempting to block individual destinations later.
Use Private Connectivity Where Required
Enterprise applications often need access to resources that should not be exposed directly to the public internet.
Depending on the architecture and supported Microsoft Foundry capabilities, private networking features can be used to create controlled connectivity between the AI application and Azure resources.
A simplified architecture can look like:
Azure Environment
|
+-- Microsoft Foundry
| |
| v
| Agent
| |
| v
| Controlled Network
| |
| +---- Private API
| |
| +---- Storage
| |
| +---- Database
|
+-- Monitoring
The exact networking configuration depends on the services involved, their network capabilities, and the deployment architecture.
The important design principle is to avoid exposing sensitive resources simply because an agent needs to communicate with them.
Control Egress Traffic
Ingress controls protect resources from unwanted incoming connections.
Egress controls address the opposite direction:
Agent
|
+----> Approved API
|
+----> Approved Storage
|
+----> Blocked Destination
For agent-based systems, egress deserves particular attention because an agent can potentially generate requests based on model output.
A controlled egress design can restrict outbound traffic to approved destinations.
For example:
Allowed:
api.internal.example
storage.internal.example
approved.vendor.example
Denied:
unknown destinations
unapproved external services
administrative endpoints
The implementation should use the network controls available in the surrounding Azure architecture rather than relying on prompt instructions alone.
Do Not Trust the Model to Enforce Network Policy
A prompt can say:
Only call the approved payment API.
Never access other services.
That is useful guidance, but it should not be treated as a network security control.
A model can misunderstand instructions, encounter prompt injection, or select an unexpected tool.
A stronger architecture is:
Model Decision
|
v
Application Policy
|
+---- Is tool allowed?
|
+---- Is destination allowed?
|
+---- Is user authorized?
|
v
Network Request
The application or platform should enforce the policy.
Control Tools as Well as Network Destinations
Network restrictions alone do not solve the complete problem.
Join the conversation! Your thoughts help the community grow.