Microsoft Foundry Hosted Agents Production Architecture Deep Dive: Shared Subnet IPs (/24 60k Sessions), Out-of-Sandbox Egress Guardrails, Memory Snapshots, and BYO-AKS Boundaries
An architectural deep dive into Microsoft Foundry Agent Service Hosted Agents at Ignite 2026: shared subnet IPs (/24 scaling from 250 to ~60,000 sessions), out-of-sandbox network egress guardrails and Azure Policy governance, Key Vault private CA trust, memory snapshot state boundaries, and guardrail fail-open prevention.
Architecture overview of Microsoft Foundry Agent Service Hosted Agents at Ignite 2026: shared subnet IPs, out-of-sandbox egress guardrails, memory snapshots, and BYO-AKS
At Microsoft Ignite 2026 (announced November 18, 2026), Microsoft unveiled a comprehensive set of production readiness upgrades for Hosted agents in Foundry Agent Service—its managed runtime for containerized, bring-your-own-code AI agents built with Microsoft Agent Framework, LangGraph, Semantic Kernel, or custom Python and C# code. The release directly targets the enterprise blockers that stall agents between pilot and production: shared subnet IPs (GA), out-of-sandbox network egress controls (GA) with Azure Policy governance (preview), private certificate authority (CA) trust (preview), long-running resilient execution (GA), memory snapshots for cold-start acceleration (preview), A2A v1.0 passthrough (preview), and upcoming deployment to customer-operated AKS clusters (BYO-AKS).
The core architectural rule to keep in mind is that Hosted agents scale and bill per VM-isolated session sandbox rather than per replica, and with shared subnet IPs now generally available, a /24 delegated subnet scales from roughly 250 concurrent sessions to an estimated ~60,000 sessions (~7,500 on a minimum /27), shifting the real bottleneck to your regional subscription concurrency quota (1,000 or 2,000 sessions by default). At the same time, enabling Memory snapshots changes session state semantics—restoring only a version's ready-to-run startup baseline rather than preserving $HOME and local files across idle eviction—and Responsible AI (RAI) guardrails (rai_config) can silently fail open if a policy ARM ID is mistyped or if invocations_moderation selectors are omitted on the invocations protocol. This deep dive cross-references the official Microsoft Foundry Blog announcement, Hosted Agents Concept Documentation, Guardrails & Network Egress Guide, Azure Policy Governance Guide, and Private CA Integration Docs as of November 20, 2026; capacity figures reflect official Microsoft planning estimates and specification contracts rather than live multi-thousand-session load testing in a private tenant.
1. Shared Subnet IPs (GA), Out-of-Sandbox Egress Guardrails, and Private CA Trust
1.1 Shared Subnet IPs (GA): From ~250 to ~60,000 Concurrent Sessions on a /24
Previously, every active hosted agent session inside a customer-delegated VNet subnet consumed its own dedicated IP address, causing a /24 subnet to hit exhaustion around 250 concurrent sessions.
- VM Isolation Preserved with IP Sharing: Hosted agent sessions still execute inside dedicated, VM-isolated sandboxes, but multiple sandboxes now share subnet IP addresses automatically across all regions without a feature opt-in. Microsoft Foundry Blog
- Planning Estimates vs. Subscription Quotas: Microsoft's planning estimate for a
/24subnet jumps to roughly 60,000 concurrent sessions, while a/27(the smallest supported delegated subnet) is planned for roughly 7,500 concurrent sessions (Microsoft still recommends a/24or larger in production to leave headroom for upgrades and platform components). Consequently, your practical ceiling is now the regional per-subscription concurrent session quota—1,000 or 2,000 sessions by default depending on the region, extendable via support request. Foundry limits & quotas
1.2 Out-of-Sandbox Network Egress Controls (GA) and Proxy CA Rotation
Because agent code can spawn subprocesses, execute generated code, or follow HTTP redirects, an MCP tool list is not a network security boundary.
- Fail-Closed Enforcement Outside the Sandbox (Up to 480 Rules):
- Network egress rules are defined inside a Responsible AI (RAI) policy (
Microsoft.CognitiveServices/accounts/raiPolicies@2026-09-01) underegressPolicy, supporting up to 480 ordered rules per policy (first-match wins). Add guardrails to a hosted agent - Rules are enforced by an egress proxy outside the agent's VM sandbox before outbound packets leave the platform. Evaluation is fail-closed (if a policy cannot be evaluated, the request is denied), and denied outbound calls return
HTTP 403to the agent's HTTP client while logging aNetwork egress decisionspan to Application Insights. Allow,Deny, andRewrite(routing traffic through an enterprise gateway) actions are GA, whileTransformrules (Set,Insert, orRemoveheaders using static values,managedIdentityRef, orsecretRef) remain in public preview.
- The
Audit→EnforceWorkflow and Session Immutability: - Start with
mode: "Audit"anddefaultAction: "Deny". In Audit mode, would-be denied destinations are allowed and logged so you can discover secondary download hosts (such asfiles.pythonhosted.orgbehindpypi.org). However, note thatTransformandRewriterules take effect immediately even inAuditmode. - Because running session sandboxes never reload policy updates dynamically, switching from
AudittoEnforcedrequires updating the RAI policy and deploying a new immutable agent version.
- ~30-Day Egress Proxy CA Rotation and Key Vault Private CA Trust:
- To inspect outbound HTTPS traffic, the runtime injects an infrastructure-specific egress proxy CA into the sandbox trust store and exposes it via
SSL_CERT_FILE,REQUESTS_CA_BUNDLE,GRPC_DEFAULT_SSL_ROOTS_FILE_PATH, andNODE_EXTRA_CA_CERTS. This proxy CA rotates approximately every 30 days and varies by cluster, so you must never pin its thumbprint/public key or bake it into images or persistent volumes. - When your agent needs to call internal MCP servers, APIs, or model gateways signed by an internal enterprise root, Private CA trust (public preview) lets you register the CA certificate in Azure Key Vault once on the Foundry resource. Certificate and hostname validation stay enabled, and toolboxes/gateways pick up changes within about a minute—though remote builds and mutual TLS (mTLS) are not covered yet.
- Centralized Azure Policy Governance (Preview in Korea Central, Canada Central, Spain Central):
- Platform admins can audit or block non-compliant egress configurations across subscriptions or resource groups by assigning three control-plane definitions (
mode: All, governing RAI policy authoring) together with one data-plane definition (mode: Microsoft.CognitiveServices.Data, targetingMicrosoft.CognitiveServices.Data/accounts/projects/agentswith a 30–60 minute propagation window). Govern hosted agent egress with Azure Policy
2. Five Architectural Boundaries and Pitfalls to Separate
- Volume-backed
$HOMEpersistence vs.Memory snapshotsbaseline reset: In standard volume-backed sessions, when no request arrives within the configurable idle timeout (2 to 240 minutes, 15 minutes default), compute scales to zero while$HOMEand/filesare preserved (expiring after 30 days of inactivity). By contrast,Memory snapshots(public preview) capture and restore only the agent version's ready-to-run startup point—memory and local files, including$HOME, do NOT survive an idle period in snapshot sessions. When snapshots are enabled, store conversation checkpoints and state in Foundry's server-backed Durable State Store (key-value JSON store with per-user partitioning and a 30-day or non-expiring TTL) or external storage. Hosted agents concepts
Background modevs.Resilient execution(GA):background: trueon theResponsesprotocol simply lets work continue asynchronously after the initial HTTP call returns.Resilient executionrecovers a long-running job after the underlying hosting process crashes, restarts, or redeploys, replaying streamed output to reconnecting clients. Because recovery reruns your handler, your code must save incremental progress and make external side effects (such as sending emails or charging cards) strictly idempotent.
- Two silent Fail-Open traps in RAI guardrails (
rai_config): First, you must pass the full ARM resource ID torai_policy_name; referencing a nonexistent policy ID often succeeds at deploy time and reportsactive, but fails open with zero content filtering. Second, on the custom-payloadinvocationsprotocol, attachingrai_policy_namewithout declaringinvocations_moderation(input_paths,output_paths, or top-level case-sensitivestream_selectors) leaves the policy completely inert—requests pass through unfiltered withHTTP 200(also note payload limits: requests > 2 MB bypass input screening, buffered responses > 1 MB or undeclaredresponse_modeshapes fail withHTTP 502, and strings > 10,000 chars are truncated before analysis). Add guardrails to a hosted agent
- Per-agent
Agent Identityvs.Project Managed Identity: Every deployed hosted agent receives a dedicated Microsoft Entra ID (Agent Identity) for runtime model calls, Toolbox access, and downstream Azure RBAC (supporting OAuth 2.0 On-Behalf-Of delegation when a user token is present, or autonomous self-authentication otherwise). The project-wide system-assigned managed identity is strictly for platform infrastructure tasks such as pulling container images from Azure Container Registry.
- Managed Hosted Agents vs.
BYO-AKS(Early December Preview): Managed Hosted Agents run on Microsoft-operated compute, where the new egress proxy and private CA features apply. BYO-AKS runs the exact same Foundry agent runtime, APIs, andazddeployment flow inside your own Azure Kubernetes Service cluster using lightweight VM pod sandboxing (AKS pod sandboxing), leaving cluster capacity, node pools, container supply chain, and network firewalling under your platform team's control.
| Capability / Subsystem | Release Status | Architectural Specification & Hard Limits | |
| Shared Subnet IPs | GA | Per-session VM sandboxes share delegated subnet IPs; planned for ~60,000 sessions on /24 and ~7,500 on /27 | Regional subscription quota (1,000 or 2,000 concurrent sessions) is now the real cap; keep /24 • in production for maintenance headroom |
| Network Egress Controls | GA (Transform in preview) | Up to 480 ordered rules per RAI policy ( 2026-09-01); enforced fail-closed outside the sandbox (blocks with HTTP 403) | Transform and Rewrite still execute in Audit mode; never pin the injected egress proxy CA (rotates ~every 30 days) |
| Azure Policy for Egress | Public Preview | Available in Korea Central, Canada Central, and Spain Central; requires 3 control-plane + 1 data-plane definitions | Data-plane policy assignments take 30–60 minutes to propagate and apply only to hosted agents, not prompt agents |
| Private CA Trust | Public Preview | Register corporate CA in Azure Key Vault once per Foundry resource; applies to VNet toolboxes (~1 min) and new agent sessions | Preserves public CA trust and hostname verification; remote builds and mutual TLS (mTLS) are not covered yet |
| Resilient Execution & Idle Window | GA | Opt-in job recovery across crashes/redeploys + stream replay; configurable idle timeout from 2 to 240 minutes (default 15m) | Recovery reruns the handler (idempotency required); inactive sessions delete after 30 days (Temporal integration preview in early 2027) |
| Memory Snapshots | Public Preview | Per-version startup memory capture for Python and .NET agents to bypass heavy library/data cold starts | Restores startup baseline only— $HOME and local files do not survive idle eviction; use Durable State Store instead |
| BYO-AKS & A2A v1.0 Passthrough | Public Preview (AKS early Dec) | BYO-AKS isolates sessions in AKS pod-sandboxed micro-VMs; A2A v1.0 passthrough wraps existing agents via Python JSON-RPC adapter | A2A preview excludes streaming/push notifications; sandbox tiers are 0.5vCPU/1GiB, 1vCPU/2GiB, 2vCPU/4GiB (20GiB disk with ~20% system reserve) |
3. Implementation Reference: Bicep Egress Policy & Pre-Deploy Static Validator
3.1 Provisioning an RAI Egress Guardrail Policy (2026-09-01 API)
When authoring an RAI policy via Bicep or ARM REST (2026-09-01), you must include the contentFilters array even if you are only configuring egressPolicy. Omitting contentFilters causes deployment to fail with HTTP 400 (Content filters cannot be null for policy). Add guardrails to a hosted agent
3.2 Pre-Deployment Static Auditor for Hosted Agent Specifications (Python)
Because several critical misconfigurations—such as bare RAI policy names, missing invocations_moderation blocks, JSONPath syntax inside stream_selectors.text_field, or combining Memory snapshots with $HOME persistence assumptions—do not fail at deploy time, run the following validator in CI before executing azd deploy or project.agents.create_version():
4. Production Readiness Checklist
Align subnet sizing with regional session quotas: With shared subnet IPs (GA), a /24 supports roughly 60,000 sessions, so verify your regional per-subscription concurrent session quota (1,000 or 2,000 by default) and file a support request early if peak concurrency requires a higher ceiling. Microsoft Foundry Blog
Run Audit mode before enforcing egress and deploy a new agent version: Capture Kusto traces | where message == "Network egress decision" logs in Application Insights under Audit mode (defaultAction: "Deny") to uncover transitive package/API redirect domains, then switch to Enforced and deploy a new agent version so fresh sandboxes pick up the policy. Add guardrails to a hosted agent
Verify guardrail attachment and handle mid-stream SSE blocks: Confirm the target RAI policy exists via az rest so the guardrail cannot fail open, and ensure streaming clients treat an SSE event: error ("code": "content_filter") as terminal even though HTTP headers already returned status 200.
Externalize state before enabling Memory snapshots: Move any state or checkpoints out of $HOME into Foundry's Durable State Store or external databases before turning on memory snapshots, and ensure Resilient execution handlers are idempotent across process restarts. Hosted agents concepts
Right-size per-session CPU/memory and isolate $HOME uploads: Because billing multiplies active sessions by per-session vCPU and memory (0.5 vCPU / 1 GiB, 1 vCPU / 2 GiB, or 2 vCPU / 4 GiB), inspect peak resource utilization in Application Insights (Investigate → Performance) against the 70% threshold, and set PYTHONNOUSERSITE=1 so untrusted files uploaded to /files ($HOME) are never imported as code.
5. Official References (Verified 2026-11-20)
Verified on: November 20, 2026
Korean version:
Microsoft Foundry Hosted Agents 프로덕션 아키텍처 해부: 서브넷 IP 공유(/24 6만 세션)·외부 Egress 가드레일·메모리 스냅샷과 BYO-AKS 경계 점검하기