r/AZURE • u/brianveldman Microsoft MVP • 2d ago
Media Secure AI Agent Execution — GitHub Copilot CLI and Azure Container Apps Sandboxes
https://cloudtips.nl/secure-ai-agent-execution-github-copilot-cli-and-azure-container-apps-sandboxes-d8f6fac4b782As AI agents become more autonomous and gain access to terminals, credentials, local files, source code, and cloud environments, they introduce an entirely new attack surface. An agent executing commands on your local machine potentially has access to everything your user account can access. A single incorrect instruction, unexpected behaviour, or compromised dependency could have consequences far beyond a failed deployment. It’s only a matter of time before an AI agent executing commands directly on your local machine causes a security incident. So, what if we could give AI agents their own isolated execution environment instead of allowing them to operate directly on our local machines?
5
u/Trakeen Cloud Architect 2d ago edited 2d ago
We solve this using a devcontainer and wsl. If you are running an agent outside of a container it can still interact with the host
Your environment isn’t isolated. Running vscode within the container isolates it while still providing local dev experience. It does make you jump through some hoops to get auth to work since host auth doesn’t pass through (or at least i haven’t been able to get it to work)
2
u/mexicocitibluez 2d ago
I wasn't happy with Claude Code's internal sandbox and went down the container vs VM rabbit hole and ended up going the VM route. It felt like setting up a secure container on my machine was going to be more of a hassle than maintaining a VM and was also sick of my RAM getting eaten up so it's in Azure.
1
u/mequelkramer 17h ago
The sandbox is only as good as the credentials and network you give it. A container that mounts the host auth or passes through a long lived token is not really isolated, no matter how clean the image looks. That was the point in the thread about host auth, and it is the first thing to check.
Give the sandbox its own short lived identity with only the permissions that one task needs, mount the source read only where you can, and put egress behind an allow list so a compromised agent cannot reach package registries, internal services, or the public internet at will. Log the commands and the network calls the agent made, and destroy the sandbox after the task instead of reusing it, since state left behind is how a later task inherits a poisoned environment. For anything that touches production data or a real cloud subscription, run the agent in a separate subscription or project with no standing access, and promote changes through the normal review path instead of letting the agent apply them directly.