AI Agent Containment on Azure: Stop Buttons, Identity and Network Controls
TL;DR
A model can pass standard evaluations and still carry a backdoor. Microsoft showed a fine-tuning set poisoned at about 1% hijacking a coding agent in roughly 78% of trials on the harnesses it was trained with, and a sleeper agent planted by editing fewer than ten neurons. You can’t prompt your way out of that.
ASD’s new guidance on AI testing environments says it plainly: prompts and model safeguards aren’t containment. Build it into the architecture instead: a model intake gate, one identity per agent, default-deny egress, logs the agent can’t reach, and stop buttons at the inference, identity and infrastructure layers that you’ve actually tested.
In a hurry? Jump to the three stop buttons, the Azure mapping or the containment checklist, then come back for the why.
This is Part 2 of my Governance for AI Agents series. Part 1 covered the governance gap, the OWASP Agentic Top 10 and a deterministic policy check in front of every tool call. This part is about what happens when that isn’t enough: containment, and the stop buttons you’ll want when something gets past the policy.
Three things this month changed how I think about it. Microsoft published two research posts showing a model can carry a backdoor that standard evaluation may miss. Australia’s ASD published guidance that says, in so many words, that prompts are not containment. And OpenAI described a system that halts its research models’ output within 35 seconds and denies inference if that system itself goes down.
The guidance and product details below were checked against primary sources on 20 November 2026.
What changed this month
flowchart TB
accTitle: Containment research and guidance in 2026
accDescr: OpenAI described Control Room. On 10 November Microsoft published research on sleeper agents hidden in model neurons and OWASP released Securing Agentic Applications V2. On 12 November ASD published guidance on securing AI testing environments and Microsoft published its trained to betray research. As at 20 November, Foundry hosted agent egress controls are generally available, Defender runtime protection for local agents on Windows became generally available at Ignite, and an Agent Sandbox extension for AKS is in preview.
subgraph R["Research and guidance"]
A["OpenAI Control Room
stops research inference, fails closed"]:::ext
B["10 Nov · Microsoft: sleeper agents
a backdoor in fewer than ten neurons"]:::threat
C["10 Nov · OWASP Securing
Agentic Applications V2"]:::guide
D["12 Nov · ASD: securing
AI testing environments"]:::guide
E["12 Nov · Microsoft: trained to betray
poisoned fine-tunes hijack coding agents"]:::threat
B --> C --> D --> E
end
subgraph P["Products, as at 20 November"]
F["Foundry hosted agent
egress controls, GA"]:::prod
G["Defender runtime protection
for local agents on Windows, GA"]:::prod
H["Agent Sandbox extension
for AKS, preview"]:::prod
F --> G --> H
end
classDef ext fill:#f1f5f9,stroke:#334155,color:#0f172a
classDef threat fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
classDef guide fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e
classDef prod fill:#dcfce7,stroke:#15803d,color:#14532dThe research says the model itself can’t be fully trusted, the guidance says build containment around it, and the products are starting to catch up.
If that sounds theoretical, July made it concrete. Hugging Face disclosed an intrusion into part of its production infrastructure that was “driven, end to end, by an autonomous AI agent system”. OpenAI later confirmed the agents were its own models under internal cyber testing, in an evaluation environment without direct internet access, and that they “exploited a previously unknown zero-day vulnerability in Artifactory” to get out. ASD’s new guidance makes its case with exactly this class of incident, citing disclosures from the UK AI Security Institute, OpenAI and Anthropic of test agents that reached or affected real systems.
The threat: a model that passes standard tests
Microsoft’s two studies attack the same assumption: that a model which passes evaluation is safe to hand tools.
- Trained to betray (12 November). Microsoft Defender Research added 90 poisoned examples to roughly 9,000 terminal-agent conversations, about 1% of the set, and fine-tuned gpt-4.1-mini on it. The trigger was a routine request to create project documentation. On the two harnesses seen in training, the unsafe action fired in 78.0% and 77.8% of 500 trials. On two unseen harnesses it fell to 11.0% and 0%, so the harness changes behaviour, but it isn’t a control. Threat hunting also turned up rows in a large public dataset that mapped benign requests to unsafe tool calls, including downloading and running a remote script. The same post covers a second study by the Microsoft AI Red Team: in its strongest configuration, open-weight checkpoints poisoned before release reached 84.1% to 94.8% attack success on repositories they hadn’t seen, and the backdoor still fired under Claude Code, Pi and Codex CLI, which Microsoft stresses isn’t a weakness in those tools.
- Sleeper agents (10 November). Microsoft Research showed a capable agent model can become a sleeper agent by editing fewer than ten neurons. It passes standard evaluations, then runs an attacker’s command when a trigger appears, and the trigger can be as mundane as the date rolling into 2027. Microsoft hasn’t seen threat actors use the technique.
The Trained to betray authors land where this post lands: “Strict authorization controls at the tool-execution layer can prevent a triggered backdoor from acting.”
sequenceDiagram
accTitle: A poisoned model meets its trigger, and where containment stops it
accDescr: A poisoned dataset plants a trigger during fine-tuning and the model passes normal evaluation. Later a developer makes a routine request, and the model proposes an unsafe tool call. If the tool-call policy denies it, it never runs. If the policy misses it, the command runs in a sandbox where egress to an unknown host is blocked. Either way the decision is logged to a store the agent can't reach.
autonumber
participant P as Poisoned data or checkpoint
participant M as Model in the agent harness
actor U as Developer
participant G as Tool-call policy
participant S as Sandbox and egress
participant L as Protected log store
P->>M: Fine-tuning plants the trigger
Note over P,M: Passes normal evaluation
U->>M: Create the project documentation
M->>G: Proposes: download and run a remote script
alt Policy denies it
G-->>M: Denied, the call never runs
else Policy misses it
G->>S: Command runs inside the sandbox
S-->>S: Egress to an unknown host blocked
end
G->>L: Decision recorded out of the agent's reachA trigger can be a normal request. Evaluation may miss a backdoor that fires only on a particular everyday phrase. Independent controls around the tool call can limit the damage: the policy that decides, the sandbox that runs it, the network that restricts it and the log that records it.
Microsoft’s phrasing of the risk is worth keeping in your back pocket for design reviews: “The available tools and their permissions define the potential blast radius.”
Prompts aren’t containment
ASD’s guidance on securing AI testing environments, published on 12 November, is the clearest statement I’ve read on this. It says prompts, scoped instructions and model safeguards “do not provide sufficient technical containment on their own”, and it tells operators not to rely on them as containment controls. It then describes containment you can actually build: minimum tools and credentials, secrets applied by a proxy, default-deny egress, logs out of the agent’s reach, execution limits, a separate management plane, and tested termination at three levels.
One scoping note. This guidance is written for testing environments, and ASD says it doesn’t cover production. I still use it as the blueprint for production, alongside ASD’s May guidance on adopting agentic AI services, which New Zealand’s NCSC co-authored with ASD and other Five Eyes partners. An agent with real credentials deserves at least the containment we’d give one in a lab. ASD’s September guidance on agent harnesses, written for adoption rather than testing, is blunter still: “No harness is inherently secure.”
flowchart TB
accTitle: A containment boundary for an AI agent, based on ASD's guidance
accDescr: Inside the boundary the agent runs with a unique short-lived identity, minimum tools that are denied by default, execution limits, and a credential proxy that applies secrets without handing them over. Egress is denied by default except approved model endpoints and package mirrors. Logs flow one way to a store outside the boundary, and operators on a separate management plane hold the stop buttons.
subgraph B["Containment boundary"]
A["Agent
unique, short-lived identity"]:::agent
T["Minimum tools
denied by default"]:::inside
X["Execution limits
duration, runs, tool-call rate, tokens"]:::inside
CP["Credential proxy
applies secrets, never hands them over"]:::inside
A --> T
A --> X
T --> CP
end
EG{"Egress
default deny"}:::gate
CP --> EG
EG -- "approved model endpoints
and package mirrors" --> OK["Allowed destinations"]:::ok
EG -- "everything else" --> NO["Blocked"]:::no
A -. "one-way export" .-> LOG["Logs and traces
outside the boundary"]:::out
OP["Operators
separate management plane"]:::out -- "stop buttons" --> A
classDef agent fill:#1e293b,stroke:#0f172a,color:#ffffff
classDef inside fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e
classDef gate fill:#f1f5f9,stroke:#334155,color:#0f172a
classDef ok fill:#dcfce7,stroke:#15803d,color:#14532d
classDef no fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
classDef out fill:#ede9fe,stroke:#6d28d9,color:#3b0764Containment lives outside the agent. ASD asks for network restrictions and execution limits enforced where the agent can’t modify them. A compromised model can ignore an instruction. It can’t edit a firewall rule it has no access to.
Layer 1: a model intake gate
If a checkpoint can carry a backdoor, it’s a dependency, and it needs the same supply chain discipline as a package. This is OWASP’s ASI04, Agentic Supply Chain Vulnerabilities, applied to the model itself. Foundry already ties catalogue models to their original publisher and scans the containers they run in, so the gate matters most for checkpoints you bring yourself: fine-tunes, merges, adapters and open weights from public hubs. Microsoft’s recommendations translate into a gate:
- Pin the data. Pin training datasets by cryptographic hash and review examples for actions that don’t follow from the request.
- Prove where the model came from. Source checkpoints from the original publisher, check its hashes, record source, version, hash and review status, and reject models without a verifiable base.
- Diff against the base. Legitimate fine-tunes change weights diffusely, while implants tend to change a few sharply. Microsoft found frontier agents acting as auditors are highly effective at spotting these edits, and it’s turning the technique into a red-teaming harness. Today it’s a research method, not a product.
- Scan the files. Turn on Defender for Storage malware scanning on upload for the staging account. Defender for Cloud’s AI model security (preview) covers supported models in Azure Machine Learning workspaces and registries, but it scans weekly, doesn’t support private link workspaces or registries, and has a 10 GB file limit. Add a supported command-line scan to the release pipeline as a gate, and handle unsupported files explicitly. Microsoft is clear that this covers serialisation and code-level risks rather than auditing the weights.
- Evaluate in your own harness. The 78% against 11% result shows the harness changes behaviour, so test in the one you’ll run.
- Enforce at deployment. Register approved models in a private Azure Machine Learning registry. For Foundry deployments, assign the built-in Azure Policy “Foundry model deployments should only use approved models” in Deny mode with the appropriate approved asset IDs or publishers. Publisher approval is broader than approving a specific version. The companion “Foundry model deployments should meet eligibility requirements” can deny preview models with
denyPreviewModelsset to true; both of its switches default to false. If you serve your own checkpoints on Azure Machine Learning endpoints, evaluate “[Preview]: Azure Machine Learning Deployments should only use approved Registry Models” as well. Check each policy’s scope and verify it blocks an unapproved deployment.
flowchart TB
accTitle: A model intake gate on Azure
accDescr: A candidate model from a public hub lands in staging storage with malware scanning on upload. Provenance is checked against the publisher and hash, the checkpoint is compared with its declared base model, and the model is evaluated in your production harness. Approved models go into a private Azure Machine Learning registry, and Azure Policy allows deployments only of approved models. Anything that fails a check is rejected.
H["Public hub or
vendor checkpoint"]:::ext --> S["Staging storage
malware scan on upload"]:::step
S --> P{"Provenance
publisher, version, hash"}:::q
P -- "unverifiable" --> R["Rejected"]:::no
P -- "verified" --> W{"Diff against the
declared base model"}:::q
W -- "sharp, sparse edits" --> R
W -- "expected changes" --> E{"Evaluate in your
production harness"}:::q
E -- "unexpected tool calls" --> R
E -- "passes" --> REG["Private Azure Machine
Learning registry"]:::ok
REG --> POL["Azure Policy
approved models only, Deny"]:::ok
POL --> DEP["Deployment, within
the policy's scope"]:::ok
classDef ext fill:#f1f5f9,stroke:#334155,color:#0f172a
classDef step fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e
classDef q fill:#fef9c3,stroke:#a16207,color:#713f12
classDef no fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
classDef ok fill:#dcfce7,stroke:#15803d,color:#14532dA gate, not a guarantee. Microsoft says it directly: “no scan can prove beyond any doubt that a model is safe”. The gate cuts the odds of a bad model arriving. The next two layers limit what one can do if it gets through.
Layer 2: one identity per agent, minimum tools, no raw secrets
ASD asks for unique, short-lived, least-privilege credentials, tools denied by default, and secrets that the agent never holds: “use an intermediary mechanism, such as a controlled proxy, that applies the required credential”. ASD’s May guidance says to “construct each agent as a distinct principal”. That covers OWASP’s ASI02, Tool Misuse and Exploitation, and ASI03, Identity and Privilege Abuse.
On Azure the pieces exist:
- Identity. Microsoft Entra Agent ID is generally available, every agent identity and blueprint needs a sponsor, and Foundry now gives each new agent its own identity with no permissions until you grant them. Conditional Access for agent identities can block them.
- The credential proxy. An AI gateway in API Management that authenticates callers with Entra ID and calls the model with its own managed identity is exactly ASD’s controlled proxy. I covered the pattern in Go Keyless on Azure.
- A decision before every tool call. That’s the Part 1 idea, and it has matured. AGT 5.0 moved policy into the Agent Control Specification, a deterministic, fail-closed decision runtime. Bind approvals to the exact call and test that changed continuations are rejected before an approval executes.
flowchart TB
accTitle: A policy decision in front of every tool call
accDescr: When an agent proposes a tool call, a policy decides before it runs. Allowed calls run in the sandbox with the agent's own identity. Denied calls are blocked and logged. Calls that need approval go to a human who approves the exact call, and anything rejected or timed out is blocked. If the policy service is unavailable, the call is blocked.
T["Agent proposes a tool call"]:::agent --> P{"Policy decision
before it runs"}:::q
P -- "allow" --> R["Runs in the sandbox
with the agent's own identity"]:::ok
P -- "deny" --> D["Blocked and logged"]:::no
P -- "needs approval" --> H["A person approves
the exact call"]:::human
H -- "approved" --> R
H -- "rejected or timed out" --> D
P -- "policy unavailable" --> D
classDef agent fill:#1e293b,stroke:#0f172a,color:#ffffff
classDef q fill:#f1f5f9,stroke:#334155,color:#0f172a
classDef ok fill:#dcfce7,stroke:#15803d,color:#14532d
classDef no fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
classDef human fill:#ede9fe,stroke:#6d28d9,color:#3b0764Fail closed, every time. The interesting branch is the last one. If the thing that makes the decision is down, the answer is no. AGT’s own README is honest about the limit: “AGT enforces governance at the application middleware layer, not at the OS kernel level.” Run each agent in its own container so the next layer still holds if the process doesn’t.
Layer 3: default-deny egress and logs the agent can’t reach
ASD’s egress rule is simple: allow only approved model endpoints, “block all other external destinations by default”, and treat package repositories the same way. Treat the mirror itself as part of the boundary too: patch it, make it read-only to agents and watch what it fetches. In July, a package cache proxy was the way out. Here’s how that maps on Azure, traps included:
- Foundry Agent Service on your own network. Network injection uses a delegated subnet of /27 or larger (/24 is Microsoft’s starting point for production), with no public egress by default. For hosted agents, set it when you create the Foundry account, because you can’t add it later.
- Foundry managed virtual network. “Allow only approved outbound” mode works, but FQDN rules create a Microsoft-managed Azure Firewall at extra cost, and Learn notes “No logging of outbound traffic support yet.” Log at another layer.
- Foundry hosted agents. Network egress controls are generally available, except Transform rules. Governing them with Azure Policy is in preview in Canada Central, Spain Central and Korea Central only, and a new Deny assignment doesn’t stop a running session.
- Network security perimeter. Generally available for Foundry resources, while classic Azure OpenAI resources are still in preview. In enforced mode it denies public inbound and outbound traffic that no access rule allows, and outbound rules are FQDN-based.
- Code execution. Container Apps dynamic sessions default to
EgressDisabled. The new Container Apps Sandboxes are the opposite: “Without a policy, outbound access is unrestricted.” Attach one. For coding agents on developer machines, Defender’s runtime protection for local agents on Windows is now generally available. - AKS. Route outbound traffic through Azure Firewall with
userDefinedRouting, or use outbound typenonefor a network-isolated cluster. My AKS static egress gateway post covers per-namespace egress if agents share a cluster.
For logs, ASD’s rule is just as direct: “Store logs and traces on a system the agent cannot access, modify or delete.”
flowchart TB
accTitle: Logs an agent can't reach on Azure
accDescr: The agent runtime emits traces and diagnostic logs into a Log Analytics workspace in a separate subscription that requires workspace permissions. Data export copies the tables to immutable storage with a locked retention policy, and Microsoft Sentinel runs detections on the workspace. The agent's identity has no role that can read, change or delete the workspace or the storage.
A["Agent runtime"]:::agent -- "emits traces and logs" --> LA["Log Analytics workspace
separate subscription
workspace permissions required"]:::log
LA -- "data export" --> W["Immutable storage
locked time-based retention"]:::safe
LA --> SN["Microsoft Sentinel
detections and response"]:::safe
ID["Agent identity"]:::agent -. "no read or delete rights" .-> LA
ID -. "no read or delete rights" .-> W
classDef agent fill:#1e293b,stroke:#0f172a,color:#ffffff
classDef log fill:#e0f2fe,stroke:#0369a1,color:#0c4a6e
classDef safe fill:#dcfce7,stroke:#15803d,color:#14532dWrite once, out of reach. Two Azure defaults work against you here. A workspace’s default access mode lets anyone who can read a resource read that resource’s logs, so switch it to require workspace permissions. And Log Analytics data can be purged, so export the tables that matter to immutable storage with a locked retention policy and protected append writes turned on, because data export writes append blobs. Data export retries failed deliveries for 12 hours and then discards them, so alert on export health too.
Three stop buttons
ASD’s guidance asks operators to “Test emergency termination at the inference, identity and infrastructure levels”. The controls should be independent, so “a failure at one level does not prevent operators from stopping the test”. It also asks for documented owners, a method and an expected time for each, and for an operator who doesn’t depend on the agent or its execution environment.
flowchart TB
accTitle: Three independent stop buttons for an AI agent on Azure
accDescr: An operator on a separate management plane can press three independent stop buttons. Inference: a gateway policy returns 503 after the change propagates, or the model deployment is paused, while the process may keep running. Identity: disabling the agent identity or blueprint and blocking it with Conditional Access stops new tokens after propagation, while issued tokens may remain usable until expiry. Infrastructure: an Azure Firewall deny drops relevant existing sessions after the rule change, and scaling to zero or deactivating the revision stops the compute.
OP["Operator
separate management plane and identity"]:::op
OP --> I1["Inference
gateway returns 503,
or pause the deployment"]:::btn
OP --> I2["Identity
disable the agent identity or blueprint,
Conditional Access block"]:::btn
OP --> I3["Infrastructure
Azure Firewall deny,
deactivate or scale to zero"]:::btn
I1 --> E1["Calls fail after propagation
the process may keep running"]:::effect
I2 --> E2["No new tokens after propagation
issued tokens may remain valid"]:::effect
I3 --> E3["Relevant sessions dropped
compute stopped"]:::effect
classDef op fill:#1e293b,stroke:#0f172a,color:#ffffff
classDef btn fill:#fee2e2,stroke:#b91c1c,color:#7f1d1d
classDef effect fill:#fef9c3,stroke:#a16207,color:#713f12The inference stop can leave the process running, the identity stop can leave issued tokens usable, and the infrastructure stop is the bluntest instrument. Each one covers a gap in the others, which is why you press them together. Timing and coverage depend on the actual configuration, so verify each action during the drill.
Inference stop
Use a gateway policy that returns 503, pause the Foundry deployment, or suspend the agent’s API Management subscription if it calls with a key. This refuses subsequent model calls after the change takes effect. A paused deployment returns HTTP 423 to every caller, and pausing works on Standard, Data Zone Standard and Global Standard deployments. Unpublishing an API Management product doesn’t invalidate subscription keys.
Identity stop
Disable the agent identity or its blueprint in Entra, and block it with Conditional Access. This stops new tokens after the change takes effect; disabling a blueprint stops every identity created from it. Assume tokens issued before you press it work until they expire: the default access token lifetime is 60 to 90 minutes. Agent identity policies alone don’t cover all delegated scenarios. Review the separate policies for agents acting as users and users signing into agents.
Infrastructure stop
Apply an Azure Firewall deny rule to egress that routes through your firewall, deactivate the container app’s revision, or scale the agent’s Kubernetes deployment to zero. The firewall rule drops relevant sessions and the compute actions stop the workload. Cordoning a node only stops new pods, so drain it or scale to zero. A Foundry managed network’s firewall isn’t yours to edit, so remove its outbound rules instead. Removing an NSG allow rule leaves existing connections up. An Azure Policy deny doesn’t stop anything already running.
AGT’s kill switch is a fourth, application-level option. It’s fast and precise, but it runs in the same process as the agent, so treat it as a complement to the three ASD layers rather than one of them.
Run the drill
sequenceDiagram
accTitle: A stop button drill for one agent
accDescr: The drill stages an out-of-scope action that should raise an alert. The operator presses the inference stop and confirms the next model call fails, disables the agent identity and confirms new tokens are refused, then applies the firewall deny and scales to zero and confirms sessions drop. Finally the operator checks the evidence survived and records each time against its target.
autonumber
actor O as Operator
participant A as Agent
participant G as AI gateway
participant E as Microsoft Entra ID
participant N as Firewall and compute
participant L as Protected log store
A->>N: Staged out-of-scope action
N-->>O: Alert, inside the target time?
O->>G: Press the inference stop
A->>G: Next model call
G-->>A: 503
O->>E: Disable the agent identity
A->>E: Token request
E-->>A: Refused
O->>N: Firewall deny and scale to zero
N-->>A: Sessions dropped
O->>L: Evidence intact, times recordedMeasure it like an outage. ASD asks for measurable maximum times for detecting out-of-scope activity, alerting and stopping it, and for containment verification to be the first test on higher-risk work. A stop button you haven’t timed is a hope.
Fail closed at the choke point
OpenAI’s Control Room is the most interesting design I saw this month, even though it’s internal research infrastructure rather than a product. Every agentic research workload must be tied to an approved safety case, and inference engines check with Control Room before serving each request. It “halts model output within 35 seconds of a decision to intervene”, where 35 seconds is the maximum lag from an authorisation cache. It stops output, not the job. And if Control Room itself goes down, for any reason including tampering, every inference request is denied until it recovers.
sequenceDiagram
accTitle: A fail-closed control check in front of inference
accDescr: An agent job sends an inference request to the gateway, which checks the control state before forwarding. If the agent is approved and running, the request reaches the model. If the agent is stopped, the gateway returns 503 and nothing reaches the model. If the control state is unavailable, the gateway denies the request.
autonumber
participant J as Agent job
participant G as AI gateway
participant C as Control state
participant F as Model deployment
J->>G: Inference request
G->>C: Is this agent approved and running?
alt Running
C-->>G: Yes
G->>F: Forward the request
F-->>G: Response
G-->>J: Response
else Stopped
C-->>G: Stopped
G-->>J: 503, nothing reaches the model
else Control state unavailable
G-->>J: Denied, fail closed
endCopy the pattern, not the scale. A single place every inference request passes through is useful, but a separate control that defaults to “no” when its state is unavailable needs additional design.
The diagram shows the stronger pattern with a separate control-state check. In API Management, a simpler manual stop uses a named value and a short choose block:
1 | <inbound> |
Set the plain named value agent-traffic-state to running initially. Change it to stopped to refuse requests after the update reaches the gateway. Restrict changes to those two controlled values: named values are substituted into the policy expression, so arbitrary strings can make it invalid. The comparison denies other valid string values, but this is not equivalent to Control Room’s fail-closed service: a gateway may continue using its last deployed configuration if a control-plane update cannot reach it. It also doesn’t terminate an in-flight response or a running process. Scope controls to the intended agents and measure propagation and stop times at each gateway during the drill.
This only works if the gateway is the only way in. Disable key authentication on the Foundry resource, give the agent’s identity no role on it and keep the endpoint private. For Foundry agents whose model calls never pass through your gateway, the inference stop is pausing the deployment.
ASD and OWASP, mapped to Azure and an owner
OWASP’s Securing Agentic Applications V2, released on 10 November, covers the same ground from the builder’s side: identity and access controls, runtime protection, supply chain security and assurance testing. I’ve used OWASP’s Top 10 IDs so each control maps to a named risk.
Model intake gate
Microsoft’s backdoor research informs this control for ASI04, Agentic Supply Chain Vulnerabilities. The AI platform team can use Defender for Storage on upload, Azure Machine Learning registries, Defender for Cloud AI model security (preview) and the approved-models policy.
One identity per agent
ASD and Microsoft recommend distinct identities for ASI03, Identity and Privilege Abuse. The identity team can use Entra Agent ID, Foundry agent identities and Conditional Access for agents.
Minimum tools and a credential proxy
ASD’s guidance addresses ASI02, Tool Misuse and Exploitation. The application and platform teams can combine AGT or Agent Framework policy and approvals with API Management managed identity and Key Vault.
Sandboxed code execution
ASD and Microsoft recommend isolation for ASI05, Unexpected Code Execution (RCE). The platform team can use Container Apps dynamic sessions, Container Apps Sandboxes with a policy, or Agent Sandbox for AKS (preview).
Default-deny egress
ASD’s guidance helps limit ASI01, Agent Goal Hijack, and ASI10, Rogue Agents. The network team can use Foundry network injection, a managed network in approved-outbound mode, hosted agent egress controls, a network security perimeter and Azure Firewall.
Logs out of reach
For ASI10, ASD recommends protected logs. Security operations can use Log Analytics in a separate subscription, immutable storage, Sentinel and Purview audit.
Execution limits
ASD’s guidance helps limit ASI08, Cascading Failures. The platform team can use API Management token limits, AGT circuit breakers and budgets.
Three tested stop buttons
ASD’s guidance and OpenAI’s Control Room illustrate responses to ASI08, Cascading Failures, and ASI10, Rogue Agents. Operations and security operations can combine API Management policy, Entra disable and Conditional Access, Azure Firewall and scaling to zero.
Ten containment checks
- Models come through the gate. Provenance, hashes, a diff against the declared base and an evaluation in your own harness, with the approved-models policy in Deny mode.
- Training data is pinned. Datasets are pinned by hash and reviewed for actions that don’t follow from the request.
- Every agent is its own principal. Its own identity, a sponsor, and no standing access beyond its tools.
- Tools are denied by default. Credentials are applied by a proxy and never handed to the agent.
- Egress is default deny. Package repositories included, the mirror patched and read-only to agents, and enforced outside the agent’s environment.
- Code runs in a sandbox with its own egress policy. Container Apps Sandboxes need one attached.
- Logs go one way. The agent’s identity can’t read, change or delete them, and the copies that matter are immutable.
- Three independent stop buttons exist. Each has a named owner, a method and a target time.
- You’ve run the drill. Timed, with the evidence checked afterwards.
- Containment comes first. For any higher-risk agent, verifying the boundary is the first test you run.
My take
Containment is architecture, not prompting. In my experience, teams spend weeks on system prompts and an afternoon on egress rules. This month’s research says to flip that. A prompt is a request to a component you can’t fully inspect. A firewall rule is a fact.
The backdoor work changed how I think about the model as an artefact. A checkpoint is a dependency, with a supply chain, a provenance and a blast radius set by the tools you hand it. Microsoft’s own conclusion is that no scan proves a model safe, which is why the intake gate is the first layer and not the only one.
None of the stop buttons is perfect on its own: issued tokens may outlive a disabled identity, an NSG change leaves live connections up, and AGT’s kill switch shares a process with the agent. The defaults don’t help either: a Foundry managed network doesn’t log outbound traffic yet, and Container Apps Sandboxes ship with open egress. ASD wrote its guidance for testing, not production. I treat it as the floor for production anyway, because the agents with real credentials are the ones that most need it.
If I had one week, I’d pick one production agent, give it its own identity, put a gateway stop and a firewall deny in front of it, and run the drill on a weekday morning with a stopwatch and the owners in the room.
Key Takeaways
- A model can pass standard evaluations and still carry a backdoor: about 1% poisoned fine-tuning data gave roughly 78% attack success on familiar harnesses, and fewer than ten edited neurons made a sleeper agent.
- Prompts and model safeguards aren’t containment. ASD says so, and the controls that work sit outside the agent.
- Treat models as dependencies: provenance, hashes, a diff against the base model, evaluation in your own harness and an approved-models policy.
- Give every agent its own identity, deny tools by default, and let a proxy apply credentials so the agent never holds them.
- Default-deny egress and logs the agent can’t reach, with the Azure traps in mind: open egress on Container Apps Sandboxes, no outbound logging on Foundry managed networks, and purgeable Log Analytics data.
- Build three independent stop buttons, at inference, identity and infrastructure, and time them in a drill. Fail closed when the control itself is in doubt.
Related posts
- Governance for AI Agents (Part 1): The Gap, the OWASP Agentic Top 10, and Where AGT Fits: the policy layer in front of every tool call that this part builds on.
- AI Agents Exploit Leaked Keys in Minutes: Go Keyless on Azure: the credential proxy and agent identities in practice.
- AKS Static Egress Gateway: Per-Namespace Static Egress IPs: controlled egress when agents share a cluster.
- MCP Goes Stateless: No Handshake, No Sticky Sessions, Better AI Gateways: the gateway as the choke point for agent traffic.
References
Guidance
- Australian Signals Directorate, Securing AI testing environments, 12 November 2026
- Australian Signals Directorate and partners including NCSC-NZ, Careful adoption of agentic AI services, 1 May 2026
- Australian Signals Directorate, Agentic AI harnesses, 11 September 2026
- OWASP GenAI Security Project, Securing Agentic Applications V2: A Builder & Defender’s Guide, 10 November 2026
- OWASP GenAI Security Project, OWASP Top 10 for Agentic Applications for 2026, 9 December 2025
Research and incidents
- Microsoft Security Blog, Trained to betray: How post-training supply chain attacks hijack coding agents, 12 November 2026
- Microsoft Security Blog, Detecting sleeper agents hiding in AI model neurons, 10 November 2026
- Microsoft Research, Lazare, veni foras: Reprogramming Dormant Neurons to Backdoor AI Agents, 10 November 2026
- OpenAI, Control Room: A central system to track and stop model workloads across our research infrastructure
- Hugging Face, Security incident disclosure, July 2026, 16 July 2026
- OpenAI, OpenAI and Hugging Face partner to address security incident during model evaluation, 21 July 2026
- OpenAI, The Hugging Face incident and the road ahead, 26 August 2026
Microsoft Azure and Entra
- Microsoft Learn, Built-in policies for model deployment in Microsoft Foundry portal
- Microsoft Learn, AI model security (preview) in Microsoft Defender for Cloud
- Microsoft Learn, On-upload malware scanning in Microsoft Defender for Storage
- Microsoft Learn, Machine learning registries for MLOps
- Microsoft Learn, Azure Policy built-in policy definitions for Azure Machine Learning
- Microsoft Learn, What’s new in Microsoft Entra Agent ID
- Microsoft Learn, Administrative relationships in Microsoft Entra Agent ID (Owners, sponsors, and managers)
- Microsoft Learn, Agent identity blueprints in Microsoft Entra Agent ID
- Microsoft Learn, Agent identity concepts in Microsoft Foundry
- Microsoft Learn, Disable agent identities in your tenant
- Microsoft Learn, Target agent identities in Microsoft Entra Conditional Access policies
- Microsoft Learn, Configurable token lifetimes in the Microsoft identity platform
- Microsoft Learn, Set up private networking for Foundry Agent Service
- Microsoft Learn, Configure managed virtual network for Microsoft Foundry projects
- Microsoft Learn, Govern Microsoft Foundry hosted agent egress with Azure Policy (preview)
- Microsoft Learn, What is a network security perimeter?
- Microsoft Learn, Use session pools in Azure Container Apps
- Microsoft Learn, Azure Container Apps Sandboxes overview
- Microsoft Learn, Customize cluster egress with outbound types in AKS
- Microsoft Learn, Design a Log Analytics workspace architecture
- Microsoft Learn, Log Analytics data export rules in Azure Monitor
- Microsoft Learn, Store business-critical blob data with immutable storage in a write once, read many (WORM) state
- Microsoft Learn, Audit logs for Copilot and AI applications
- Microsoft Learn, Set up tracing in Microsoft Foundry
- Microsoft Learn, Subscriptions in Azure API Management
- Azure REST API specs, Microsoft.CognitiveServices deployment operations, including pause
- Microsoft Learn, Use named values in Azure API Management policies
- Microsoft Learn, Azure network security groups overview
- Microsoft Learn, Azure Firewall rule processing logic
- Microsoft, Microsoft Ignite 2026 Book of News, 17 to 20 November 2026
Open source
- Microsoft, Agent Governance Toolkit and its changelog
Image Credits
- Cover image generated by Copilot
AI Agent Containment on Azure: Stop Buttons, Identity and Network Controls




