Wrestling with a Python - Escaping Copilot Studio's AI Guarded Sandbox
Where
Main Stage
DEF CON 34
Duration
38 min
Shows how an attacker escapes the Python sandbox behind Microsoft Copilot Studio's code interpreter, then defeats the LLM guardrail that screens the code.
Summary
The talk starts with Microsoft Copilot Studio, where agents can run Python through a code interpreter. The presenters treat that interpreter as a target. Behind it sit a Windows container on Azure Service Fabric, a Python sandbox, and a small language model that decides whether each piece of code is safe to run. They picked the smallest model in the settings, expecting it to be the easiest to get past.
Early probes used module introspection and file-reading helpers to reach sandbox internals and TLS material. The guardrail turned out to be non-deterministic: the same payload sometimes passed and sometimes failed. Its API responses also echoed its security reasoning, which gave the team feedback for refining payloads. Walking Python's method resolution order got around the dunder filters. The team then found a hard-coded administrator credential in a related Dataverse plugin environment that also appeared in the Copilot containers, and it cracked quickly. The haul included certificates, private keys, around 75 environment variables, and application source, along with command execution as a container user.
Microsoft first rated the reports low severity. The speakers said the escape still worked in some environments after the tickets were marked fixed, and they released their tooling. The takeaways: sandboxing untrusted code is hard, LLM-based guardrails are fallible, and organizations should keep sensitive data out of agent sandboxes.
Materials
Related talks
Briefings·36 min
Andres Riancho · Hillai Ben-Sasson · Ronen Shustin
The overwhelming majority of AI applications run on NVIDIA hardware and software and use NVIDIA tools to containerize and isolate applications running on the same infrastructure.
Main Stage·19 min
Elad Meged
Shows how a project config file loaded before Gemini CLI's sandbox starts gave attackers host code execution in CI, and how to audit similar pre-task inputs.
Main Stage·42 min
B Sternberg · N Poran · R Bobrov
Shows how attacker-controlled text in WAF logs, Sentry errors and Datadog telemetry can steer AI coding agents into DNS changes, cross-agent takeover and data exfiltration.


