What’s a secure way to isolate agent executions, from swarms to harnesses to generated code, within the operational boundaries of highly regulated industries? The architecture options on Azure now include the recently generally available service of Azure Container Apps Sandboxes.
1) Enterprise Agent Design Today
This article covers agent runtime options for regulated startups and digital-native companies, including those in financial services. The primary need identified today across many customers is for strong isolation without building and operating an entire execution platform themselves.
Many enterprises have established controls around networking, DNS, egress, image governance, infrastructure ownership, and model access, making it challenging to introduce new agent execution environments without creating additional operational and governance overhead. Traditional application compute platforms can provide many of these enterprise controls, but they are generally designed to host trusted application workloads, leaving enterprises to design and operate additional isolation patterns when agents need to execute dynamically generated or otherwise untrusted code.
This creates an important question for secure enterprise agent design: Can we introduce isolated agent execution while preserving enterprise control boundaries, without requiring application teams to build and operate another execution platform? This is where Azure Container Apps Sandboxes are different: each sandbox runs within its own security boundary and is designed specifically for untrusted execution, while also supporting OCI images, explicit lifecycle control, persistent state, and network policies. For outbound connectivity specifically, Azure Container Apps Sandboxes include an egress policy engine that can allow, deny, or transform requests, with Microsoft recommending deny-by-default plus explicit destination allowlists for untrusted workloads.
Figure 1. Image from Microsoft Reactor Demo on Azure Container Apps Sandboxes (slides available publicly via Pamela Fox blog)Azure Container Apps Sandboxes can be thought of more like a managed PaaS service, rather than the operational model common in self-hosted VMs or Kubernetes. Azure Container Apps Sandboxes are first-class Microsoft.App/SandboxGroups resources and provide explicit lifecycle, state, networking, and bring-your-own-container-image capabilities. The way Azure Container Apps Sandboxes work is that the controls don't disappear; the infrastructure implementation beneath them becomes managed. For users like banks in regulated industries, customers retain governance of what is allowed to execute without becoming the operator of the infrastructure that executes it. To emphasize customer responsibility as with other similar Azure services: Azure Container Apps Sandboxes provide isolation and security controls, but they don't make the solution compliant by themselves; customers still own authorization, data governance, auditing, resilience and the regulatory validation.
Notice: Azure Container Apps Sandboxes currently don't have an availability SLA, the sandbox groups are regional, there is no automatic cross-region failover and snapshots are not cross-region backups. For updates to this service, check this Learn page.
Here is how Azure Container Apps Sandboxes work at a conceptual level in a Markdown Diagram for a minimalist agent design, which includes a Foundry hosted agent passing untrusted code to a sandbox. Documentation and additional visuals available on the sandbox service page: Sandboxes | Azure Container Apps Sandboxes Portal Docs.
Figure 2. Simple markdown diagram explaining managed agent architecture with Foundry Agents and Azure Container Apps SandboxesWhy Azure Container Apps Sandboxes?
There are various constraints in enterprise regulated industries where this sandbox offering uniquely provides mitigation and solutions. Specifically, you may be wondering how this service compares to regular ACA (without the sandbox part) or Microsoft Foundry’s already existing option of Dynamic Sessions for agent workloads. Dynamic Sessions address execution isolation through Hyper-V options. The important distinction is that Dynamic Sessions manage short-lived execution through a pool, while Azure Container Apps Sandboxes give the developer direct lifecycle control, persistent state, snapshots and richer networking. For more on dynamic sessions in Microsoft Foundry, see this Learn page.
Instead of building a separate combination of containers + isolation + credential handling + outbound enforcement around generated Python, Azure Container Apps Sandboxes make that untrusted execution environment itself a managed platform primitive. If you prefer additional management, then you can still use regular Azure Container Apps (ACA) when you’re running a trusted application or agent service that you own, deploy, and operate as a normal containerized workload.
That is what makes a sandbox compelling: it turns isolated, policy-controlled execution into a managed platform primitive, while allowing the enterprise to retain governance over the image, network access, identity, and resources that execution is allowed to use. But that is not to say you should use Azure Container Apps Sandboxes for all compute or execution use cases, rather this is another option available and fully supported by Azure with its update to Generally Available (GA), see announcement here. Check out the table below on when to use which option at various decision points in agent design.
Notice
This article was written prior to Ignite 2026 Announcements. For latest updates, please see this page: Microsoft Ignite.
Table 1. Decision Support for Agent Compute Design
|
Decision |
Requirement |
Recommendation |
Explanation |
|
Agent hosting |
Framework flexibility + enterprise model path |
Foundry-hosted agent |
Separate orchestration runtime from model governance |
|
Untrusted or agent-generated code and execution |
Isolation + controlled network access. Agent needs state that can survive across task boundaries. |
Azure Container Apps Sandboxes |
Choose execution primitive based on security envelope |
|
Run a trusted agent/app/API |
Long-running service that you own and deploy as a container |
Azure Container Apps (ACA) |
Regular ACA Apps are intended for continuously running services, APIs, and web apps. |
|
Execute short-lived LLM-generated code |
Disposable isolated environments, very fast startup, minimal lifecycle management |
ACA Dynamic Sessions |
Use prewarmed session pools and automatically manage/deprovision ephemeral sessions. Good fit for short-lived scripts.
|
|
Simple event-driven serverless logic |
Execute trusted functions in response to HTTP/events/timers without managing a containerized application |
Azure Functions |
When the problem is serverless application logic, not isolation of untrusted agent-generated execution. |
|
Need full container/orchestration control |
Complex Kubernetes platform requirements or control beyond the managed abstractions above |
AKS / Kubernetes |
use this when Kubernetes itself is an architectural requirement. Don't introduce it solely to provide a place for agents to execute code if a managed execution primitive satisfies the requirement. |
2) Trusted system architecture
The security model behind Azure Container Apps Sandboxes is to not trust anything generated. Aligned with this, the critical pattern we are recommending for Azure Container Apps Sandboxes is no secrets in the sandbox. Let's look at how this works when it comes to a common use-case of agent-generated execution, for example python executable files or calls to an API service. This is an important risk vector in the threat model of an agent system, where actions could be taken in your environment as a result of the AI generated content.
Don't only ask:
“Where does my agent run?”
Also ask:
“Where does code created or selected by the agent run, and what can that environment reach?”
For enterprise agent architectures, where the agent runs and where the code generated from that agent runs can be separate design decisions. The current Microsoft Learn documentation positions Azure Container Apps Sandboxes as isolated environments for scenarios such as AI code execution, agent workflows, and secure multitenant compute, with lifecycle and networking controls. As agents become more autonomous, the design assumption needs to shift from “the application code is trusted because we deployed it” to “any action selected or code generated at runtime may behave unexpectedly.” Microsoft’s Zero Trust guidance for AI describes runtime isolation in similar terms: constrain what an AI system can do when a model response, plugin, or generated-code path behaves unexpectedly, and expose only narrowly defined access to networks, files, APIs, and other resources. Azure Container Apps Sandboxes fit naturally into this architecture because each sandbox runs within its own secure isolation boundary and is explicitly designed for untrusted code execution. The platform also exposes lifecycle and networking policies so the execution environment can be treated as a distinct security boundary rather than simply another process running alongside the agent.
That does not mean a sandbox makes arbitrary agent behavior inherently safe. Microsoft explicitly cautions that Azure Container Apps Sandboxes reduce the risk of running untrusted code rather than making the code safe, which is why identity, authorization, network restrictions, tool mediation, and approval controls still matter. The architectural goal is therefore containment and least privilege: if an agent generates unexpected code or chooses an unexpected execution path, the blast radius is determined by the sandbox's boundaries and the narrowly scoped resources exposed to it, rather than by everything available to the host running the agent. In summary, agent autonomy changes the trust boundary, so execution isolation becomes a first-class system-design decision rather than just a compute choice.
Network egress controls
Azure Container Apps Sandboxes support per-sandbox outbound policies with a default Allow or Deny action and host allow/deny rules. Egress restrictions are opt-in: without an explicit policy, outbound access is unrestricted. For regulated workloads, configure default Deny at creation and allow only required destinations. Traffic inspection modes are Full, Partial, and None; Full supports host rules and advanced path/method matching, rewrites, and header transforms. Verify the current transport behavior before relying on a policy for enforcement. See Control egress.
The built-in egress proxy also supports credential injection, allowing credentials to be added outside the untrusted execution environment. Azure Container Apps Sandboxes groups can connect to a VNet for access to private resources; inbound private endpoints are separate controls and do not replace outbound restrictions. Recommended practice is to combine narrowly scoped egress policies with private connectivity where required, rather than assuming isolation alone prevents data exfiltration. See Azure Container Apps Sandboxes architecture and networking.
Important note: these and any other restrictions are not automatic. For untrusted code, the recommendation is to configure a default Deny policy and explicitly allow only the required destinations.
Tenant-aware MCP access, RBAC, and identity
MCP provides the tool interface; it does not automatically tenantize the application. Microsoft’s multitenant identity guidance separates authentication from authorization within each tenant. Recommended pattern: authenticate the caller with Microsoft Entra ID, map the validated identity to an authorized application tenant, and have the trusted orchestrator select that tenant’s sandbox, data, and permitted tools. Never trust a tenant identifier supplied only in a prompt or tool argument. Sandbox labels support tenant filtering and routing but should not be treated as an authorization boundary. Use separate sandbox groups when tenants require independent shared networking, identities, or configuration. See Multitenant identity considerations and Sandbox group boundaries.
Protect the MCP server as an API: require an access token on every request and use established authentication middleware to validate it before running a tool. Enforce tenant membership and tool/data permissions server-side. For Foundry agents, shared keys or agent/project identities do not preserve individual user context; supported Microsoft Entra client user delegation or OAuth identity passthrough does. For hosted agents, Microsoft recommends connecting delegated tools through a Foundry toolbox, which isolates per-user credentials and manages consent and token lifecycle. Keep the agent identity that accesses the toolbox separate from the user identity used downstream. See Secure an MCP server with Microsoft Entra ID and Toolbox authentication.
Separate platform RBAC from business authorization. The documented sandbox data-plane role is Azure Container Apps Sandbox Group Data Owner, assigned at sandbox-group scope to the principal calling the sandbox APIs; control-plane provisioning is a separate permission concern. Keep that access with the trusted orchestrator rather than granting it to generated code or end users. Managed identities attach at group level for token-broker access to Azure services, so scope their downstream permissions carefully and do not assume a shared group identity provides per-user or per-tenant authorization. For untrusted execution, prefer mediated tool calls and proxy-side credential injection; the service also supports boot-time secret injection, so “no secrets in the sandbox” must be an explicit architecture choice, not an assumed platform guarantee. See Sandbox data-plane RBAC, Sandbox identity and secrets, and MCP authentication methods.
3) Samples and getting started
In an example of hosting an isolated coding sandbox, Azure Container Apps Sandboxes separate the agent runtime from the environment that is executing dynamically generated code, with Hyper-V and network boundaries around the execution environment. For ready to deploy samples, check out this GitHub repo specifically showing this isolated code interpreter scenario: Microsoft Sample GitHub - Sandbox. The Azure Container Apps Sandboxes Code Interpreter sample shows this trusted-system pattern in practice by deliberately separating the model that decides what code to run from the environment that actually runs it. A host-side Python harness sends the user's request to Azure OpenAI with a python_exec tool. When the model chooses that tool, its generated Python is written into a fresh Azure Container Apps Sandboxes microVM and executed there. The sandbox returns only the execution results, including stdout, stderr, and the exit code, back to the harness, which supplies those results to the model for the next reasoning step. This generate → execute → observe → iterate loop continues until the model produces a final answer.
Figure 3. Example use of Code Interpreter sample with Azure Container Apps Sandboxes viagithubThe important architecture decision is what does not cross the trust boundary. The sample discussed here stages the source data inside the sandbox, while only information printed by the generated code is returned to the model. The Azure OpenAI credential remains with the host-side harness rather than being passed into the sandbox, so the environment executing generated code is not also the model client. The sample can additionally be combined with deny-by-default egress so generated Python cannot freely establish outbound connections. Artifacts such as charts can be explicitly retrieved from the sandbox before it is deleted.
This illustrates a useful pattern for production agent systems: give the agent the ability to request computation without giving generated code the same trust, credentials, or network reach as the agent itself. In this sample, the harness remains the trusted orchestrator, Azure OpenAI performs the reasoning and requests tool calls, and the sandbox becomes the isolated tool-execution boundary. That separation means each layer can have a different security policy based on what it actually needs to do, rather than treating the agent and everything it generates as one trusted application.
Get started today: Quickstart Portal on Azure Container Apps Sandboxes
Conclusion
For fintech startups, banks and any other regulated industry enterprise customers, Azure Container Apps Sandboxes are compelling because they allow greater agent autonomy without requiring a comparable increase in the trust boundaries. An agent can reason and orchestrate in its trusted runtime while generated code and higher-risk actions execute inside a separately isolated, constrained environment. With all the compute options on Azure for agent systems, customer can design around containment, least privilege, controlled connectivity, and explicit separation of responsibilities, rather than assuming everything the agent generates deserves the same access as the application hosting it. The result is a stronger pattern for production agents: trust the orchestration you control, treat dynamically generated execution as untrusted, and give it only the resources it needs to complete the task.
References
-
Egress policies and network controls for Azure Container Apps Sandboxes | Microsoft Learn
-
Reliability in Azure Container Apps Sandboxes | Microsoft Learn
- Official page on Azure Container Apps Sandboxes from Azure team: https://sandboxes.azure.com/docs/sandboxes/quickstart/setup-portal
- Official Azure Samples GitHub: https://github.com/Azure-Samples/azure-container-apps-sandboxes/tree/main
Published Dec 01, 2026
Version 1.0gabyb
Microsoft
Joined September 18, 2025
Startups at Microsoft
Follow this blog board to get notified when there's new activity