The AI Sandbox Problem: Trust Boundaries, Tool Execution and Enterprise Security

A Microsoft Copilot bug bounty report closed as "not a vulnerability" revealed something more interesting: the gap between what an AI model refuses to do and what its execution sandbox is actually capable of.

Security boundary composition diagram: an AI assistant chat interface flows through an orchestrator (tools and context) into an isolated execution sandbox (filesystem, Python, Node.js) and out through egress boundaries to the internet, databases, cloud services and enterprise systems
AI execution pipeline: model policy, orchestration, sandboxed execution and egress boundaries are four separate security layers.

The chatbot is only the front door

Most users interact with AI assistants through a chat window.

Ask a question. Upload a document. Convert a file. Analyze a spreadsheet.

It feels like the AI is doing the work directly.

It isn't.

Somewhere behind the interface, something has to receive the uploaded files, execute code, manipulate data and return the result.

That something is usually a combination of an LLM, an orchestrator, and an execution environment.

The execution environment is the interesting part.

For a normal user, the sandbox is invisible infrastructure.

For a security researcher, it immediately raises a different question:

What exactly is the computer behind the chatbot allowed to do?

A minimal sandbox can be remarkably safe.

A highly integrated enterprise AI system is a completely different security problem.

And, to borrow one of the internet's favourite descriptions:

It's free real estate.

A sandbox is only as safe as its boundary

Imagine an empty room.

There is a computer inside, but it has:

Even arbitrary code execution inside that room has limited value.

Now add Python.

Then Node.js.

Then pip, npm, uploaded files, subprocesses, package installation and networking.

Suddenly, that room is a reasonably capable computer.

The problem is not that any one capability is inherently dangerous.

The problem is capability composition.

This is why modern agentic systems have a much larger security surface than a traditional chatbot.

OWASP's current agentic-AI guidance explicitly identifies sandbox and tooling escape, sensitive information leakage, and orchestration-layer compromise as separate threat categories.

The important word there is orchestration.

The LLM is only one component.

I wasn't trying to break Copilot

My original motivation had nothing to do with security research.

I wanted to build my own agentic assistant.

The concept is simple enough.

An ordinary LLM generates text.

An agent gets a harness around it.

The harness gives the model tools.

A crude prototype might look something like this:

{
  "tools": [
    {
      "name": "execute",
      "description": "Execute a command in the sandbox"
    }
  ]
}

The real implementations are much more sophisticated, of course.

But conceptually:

LLM      → reasoning
Harness  → orchestration
Sandbox  → execution

Once I started thinking about Copilot in those terms, I stopped looking at it as a chatbot.

I started looking at it as a remote execution platform.

That changed the questions.

Where does the code execute?

Which files are present?

Which operating-system identity is used?

What software is installed?

What can the process reach?

And most importantly:

Which restrictions are enforced by the AI, and which ones are enforced by the infrastructure underneath it?

That was the beginning of the rabbit hole.

The first interesting detail: /mnt/data

During testing, uploaded files appeared in the execution environment under:

/mnt/data

That single path says quite a lot.

There is a real filesystem.

There is a workspace.

There is state associated with the execution session.

And there is a mechanism that takes an object uploaded through a chat application and makes that object available to code execution.

That is not inherently dangerous.

It is exactly how a useful code interpreter needs to work.

But from a security perspective, it creates a very important primitive:

The user can introduce arbitrary data into an environment capable of executing code.

Microsoft's public documentation describes Code Interpreter as operating in isolated Azure-hosted virtual machines, with a fresh VM for each execution session and destruction after the session. It also states that session data is not persisted after the environment is destroyed.

That is a strong security property.

It also means that the question is no longer simply:

"Is there a sandbox?"

The better question is:

"What exactly is inside the sandbox while it exists?"

The second detail: it wasn't an empty box

Once files were present, I started looking around.

Nothing exotic.

Just standard operating-system inspection.

Commands in the ls / cat family were enough to reveal that the environment contained much more than the uploaded file.

There was a normal userspace.

There were interpreters.

There were utilities.

There were development tools.

There were package managers.

In my testing, the environment exposed an unprivileged execution identity:

oai

Again, this is an important distinction.

I did not obtain root.

I did not demonstrate a host escape.

I did not demonstrate a VM escape.

The interesting discovery was much more mundane:

The AI assistant was sitting on top of a real operating-system environment.

Once you know that, the attack surface starts looking much more familiar.

Python is more than "data analysis"

Suppose a product documentation page says:

"The AI can run Python to analyze your Excel spreadsheet."

That sounds relatively harmless.

But Python is an interpreter, not an Excel analyzer.

Python can read files.

Python can write files.

Python can start subprocesses.

Python can create sockets.

Python can load native libraries.

Python can invoke installed packages.

The same principle applies to Node.js.

The runtime does not know whether your program is:

calculate.py

or:

exfiltrate.py

It executes code.

That is why the actual security boundary has to exist below the LLM.

The model can provide policy.

The sandbox must provide enforcement.

And then there was pip

One capability that deserves more attention than it usually gets is package installation.

If pip is available, the execution environment is not limited to whatever code the provider originally installed.

The user can potentially introduce additional Python functionality.

Similarly, npm changes the Node.js environment from a fixed runtime into something that can be extended dynamically.

From a software-engineering perspective, that is convenient.

From a security perspective, it changes the threat model.

You now have:

User input
    ↓
LLM-generated or user-provided code
    ↓
Runtime
    ↓
Third-party packages
    ↓
Additional executable code

That introduces familiar supply-chain concerns into an AI sandbox.

OWASP's AI Agent Security guidance explicitly recommends minimizing tool access and applying least privilege to the execution environment, including avoiding unnecessary access to network resources and sensitive system resources.

File extensions turned out to be an interesting side door

The next thing I ran into was the file-upload layer.

Copilot imposed limits around file uploads and accepted file types.

That sounds like a security control.

But a filename is not a security boundary.

Consider:

sample.txt

and:

sample.zip

The extension tells an application what it thinks the file is.

It doesn't determine what the bytes actually contain.

This created an interesting mismatch between the interface layer and the execution layer.

A restriction could be imposed at the upload layer while the underlying execution environment simply received bytes.

That meant a larger project structure could be transported through a representation accepted by the UI and then reconstructed inside the sandbox.

Conceptually:

Project directory
       │
       ▼
   archive/data
       │
       ▼
accepted upload format
       │
       ▼
     /mnt/data
       │
       ▼
reconstructed files

This is not a sandbox escape.

It is not necessarily a vulnerability at all.

It demonstrates something much more important:

An interface restriction and an execution restriction are two different controls.

The UI can say:

"I don't accept this file type."

The execution environment can effectively say:

"Give me bytes and tell me what to do with them."

Security controls become much stronger when those two layers agree.

Then I started asking the obvious question

What else can this sandbox do?

The answer matters because an AI execution environment is not dangerous merely because it contains a shell.

It becomes interesting when several capabilities are combined.

In my testing, that combination included:

Linux userspace
      +
Python
      +
Node.js
      +
pip / npm
      +
uploaded files
      +
process execution
      +
network primitives

Any one of these capabilities can be legitimate.

Together, they represent a fairly general-purpose execution environment.

That is exactly why traditional application-security concepts matter here.

Least privilege.

Isolation.

Network segmentation.

Capability-based access.

Egress control.

Telemetry.

Agentic AI did not make those principles obsolete.

It made them easier to forget.

The model had its own security layer

There was another interesting observation.

The model itself would refuse some requests.

That is what we normally expect from a modern AI assistant.

Ask it for something obviously dangerous and it may decline.

For example, a direct request to build malicious networking functionality could trigger a refusal.

That creates an architecture something like:

                 USER
                   │
                   ▼
             ┌───────────┐
             │    LLM    │
             │   policy  │
             └─────┬─────┘
                   │
                   ▼
             ┌───────────┐
             │Orchestrator│
             └─────┬─────┘
                   │
                   ▼
             ┌───────────┐
             │  Sandbox  │
             └───────────┘

This produces a deceptively simple security question:

What happens when the model refuses an operation that the sandbox itself is technically capable of performing?

That is where things became interesting.

A refusal is not the same thing as a prohibition

This distinction is probably the most important concept in the entire article.

Imagine that the LLM refuses:

"Create a covert network channel."

That tells us something about the AI policy layer.

It does not automatically tell us anything about the technical capabilities of the underlying operating system.

The sandbox may still have:

So there are two separate questions:

Policy question

Will the model assist me?

Security question

Can the underlying system technically do it?

Those are very different properties.

A secure architecture needs the second one to remain secure even if the first one completely fails.

The DNS experiment

This is where the networking layer became particularly interesting.

DNS tunnelling is not a new technique.

Security teams have dealt with it for years.

The basic idea is to encode information into DNS queries and responses, turning DNS into a communication channel:

Client
  │
  │ encoded data
  ▼
DNS query
  │
  ▼
authoritative DNS
  │
  ▼
DNS response
  │
  ▼
Client

The interesting question in an AI sandbox is not:

"Can DNS tunnelling exist?"

It obviously can.

The interesting question is:

What does the sandbox's egress policy actually block?

During my testing, I observed a difference between ordinary outbound connectivity and DNS resolution.

That distinction is important.

A security engineer saying:

"The sandbox has no internet access."

could mean any of these:

A) No outbound TCP
B) No HTTP/HTTPS
C) Only approved destinations
D) No arbitrary UDP
E) No DNS
F) No outbound traffic whatsoever

Those are not equivalent.

If DNS is permitted while other egress is restricted, DNS becomes a very different class of security surface.

Important distinction: what I actually proved

This deserves its own section because security articles often become misleading at exactly this point.

I did not demonstrate a VM escape.

I did not demonstrate host compromise.

I did not obtain root on the infrastructure.

I did not demonstrate cross-tenant access.

And I did not demonstrate unrestricted access to another customer's Microsoft 365 data.

What I did demonstrate was narrower:

The execution environment was substantially more capable than the chat interface suggested.

It exposed a real userspace environment.

It exposed interpreters and package-management functionality.

User-controlled files could be made available inside the execution environment.

The model's refusal behavior was not identical to the capabilities of the underlying runtime.

Networking behavior did not appear identical to a simple "no network" assumption.

And pre-existing code artifacts could be treated differently from code generated directly by the model.

Those are architectural observations.

Whether they form a vulnerability depends on where the vendor defines the security boundary.

The part that really interested me: removing the payload from model context

This is where the experiment moved beyond a normal jailbreak.

The obvious approach would be:

Ask the AI to write malicious code.

That gives the model complete visibility into the intended operation.

It can classify the request.

It can refuse.

A more interesting architecture appears when the code already exists as an artifact.

Conceptually:

             LLM CONTEXT
                  │
        benign execution request
                  │
                  ▼
             ORCHESTRATOR
                  │
                  ▼
               SANDBOX
             /mnt/data
                  │
                  ▼
             pre-existing
                artifact
                  │
                  ▼
              execution

Now the model is no longer necessarily generating the behavior.

It is facilitating its execution.

The difference is subtle but important.

A model can reason about content that enters its context.

It cannot reason about content that it never sees.

That makes context visibility itself a security boundary.

The "encrypted path" experiment

I encountered the same problem while investigating access to more sensitive filesystem locations.

Suppose an execution artifact contains a path that the model recognizes as belonging to protected system architecture.

The model may refuse to work with it.

But if the path is stored separately and recovered only during execution, the model no longer has to see the sensitive value.

Conceptually:

       LLM sees
          │
          ▼
     benign script
          │
          ▼
       Sandbox
          │
      decrypt/read
          │
          ▼
    sensitive value
          │
          ▼
       operation

This was a useful proof of concept for one particular architectural weakness:

The AI policy layer cannot make a semantic decision about data it never receives.

Again, this does not mean that encryption magically turns malicious code into safe code.

It means that where security-relevant information is inspected matters.

The difference between generated code and supplied code

This produces a broader lesson for AI security.

There are two very different workflows:

User → prompt → LLM → generated code → execution

and:

User → artifact → execution environment
              ↘
                LLM receives only metadata/instructions

The first gives the model an opportunity to inspect intent.

The second can potentially move some security-relevant decisions outside the model's semantic view.

This is not unique to Microsoft.

It is a general architectural problem for agentic systems.

The more an application allows users to provide executable artifacts, the less meaningful a model-only safety layer becomes.

That is why OWASP's agent-security guidance treats tool execution security separately from prompt-level injection defenses.

What happened when I pushed this further?

At this point I wanted to answer a simple question:

If the model refuses a dangerous operation, is the underlying system also preventing that operation?

I built a proof of concept around a DNS-based communication mechanism.

I won't turn this article into a step-by-step covert-channel tutorial, because the implementation details are less interesting than the architectural result.

The important observation was that the model's policy decision and the runtime's actual capability were not necessarily the same thing.

That distinction is precisely where AI security becomes traditional system security again.

And Microsoft said: not a vulnerability

I reported the issue as:

VULN-210492

The report was submitted on August 11, 2026.

Microsoft's eventual conclusion was that the described behavior did not meet its definition of a security vulnerability.

That is a completely legitimate outcome.

A bug bounty report is not a referendum on whether something is interesting.

It asks a much narrower question:

Does this behavior cross a security boundary that the vendor considers protected?

In this case, Microsoft's answer was no.

That actually makes the result more interesting.

Because now we have to ask:

Where exactly is Microsoft's security boundary?

The public documentation makes this even more interesting

Microsoft's current documentation describes Code Interpreter as running inside isolated Azure-hosted VMs.

It says each execution gets a fresh VM, that the VM is destroyed afterward, and that the environment allows no inbound or outbound network traffic. Microsoft also describes runtime safeguards such as monitoring and terminating suspicious execution.

Microsoft's Copilot Studio documentation similarly describes code execution as sandboxed and isolated, with restrictions intended to prevent network access, system-level commands and unauthorized file operations.

That creates an important caveat for my research:

The behavior I observed should not automatically be generalized to every Microsoft Code Interpreter deployment or to the current documented architecture.

Product behavior changes.

Different Copilot surfaces can use different execution paths.

Features can be rolled out incrementally.

And security controls can exist at multiple layers.

That is why I would describe the findings as observed behavior in the tested environment, rather than claiming they represent the universal design of Microsoft's current sandbox architecture.

That distinction matters.

The state-reset question

One of the useful properties to establish when evaluating a sandbox is whether it persists.

Microsoft's current documentation says it does not.

The documented architecture creates a fresh execution VM and destroys it after the session, specifically to prevent persistent storage of code and data.

From a security perspective, that is excellent.

Ephemeral environments reduce the impact of:

It also changes the attacker's incentives.

A disposable environment is far less interesting than a persistent one.

But it does not eliminate the importance of the runtime while the session is alive.

A fire extinguisher makes a burning room safer.

It does not make the fire harmless.

The more interesting question: can the model be bypassed?

The answer is clearly yes in the most literal sense.

You can construct workflows where the model does not need to generate every operation it ultimately facilitates.

But that still doesn't mean:

"Copilot can be bypassed."

It means something more precise:

A model-level refusal should not be mistaken for an infrastructure-level security control.

If your threat model assumes that arbitrary code execution inside the sandbox is acceptable because the LLM will refuse malicious requests, then the model is acting as a security boundary.

That is a dangerous assumption.

The runtime should remain safe even if the model:

Then the enterprise architecture makes the stakes much higher

A standalone code sandbox is one thing.

An enterprise Copilot deployment is another.

Microsoft describes Copilot as using Microsoft Graph to ground responses in organizational data that the user is authorized to access, including emails, chats and documents. Existing Microsoft 365 permissions and security controls remain part of that model.

That is precisely what you want from an enterprise AI assistant.

But from a security-research perspective, a second question becomes unavoidable:

Which component can access what?

There is a major architectural difference between:

LLM
  ↓
specific authorized Graph operation
  ↓
approved data

and:

arbitrary execution environment
  ↓
enterprise API
  ↓
organizational data

I am not claiming that my testing demonstrated unrestricted Graph access from the sandbox.

That would require a separate, reproducible demonstration of the exact authorization path.

The point is that the execution plane and the enterprise-data plane must have explicit boundaries between them.

Otherwise a vulnerability in one can potentially turn into privilege escalation across the other.

The "Excel holds up the building" problem

There is an old enterprise joke that Excel is the tiny brick at the bottom holding the entire infrastructure together.

AI systems increasingly have the same problem.

Look at the dependency chain:

                     Copilot
                        │
        ┌───────────────┼────────────────┐
        ▼               ▼                ▼
      LLM          Orchestrator       Identity
        │               │                │
        ▼               ▼                ▼
    Grounding        Tools            Graph
        │               │                │
        └───────┬───────┴───────┬────────┘
                ▼               ▼
             Files           Enterprise data
                │
                ▼
             Sandbox

Every additional integration creates another boundary.

Every boundary creates another place where assumptions can diverge.

And every place where the model's perception differs from the actual machine becomes an interesting security surface.

The shell wasn't the vulnerability

This is perhaps the most important conclusion.

The shell wasn't particularly interesting.

Linux has shells.

Containers have shells.

VMs have shells.

Cloud build systems have shells.

CI runners have shells.

The interesting part was the relationship between:

the LLM

the orchestrator

the execution sandbox

the filesystem

the network

and the enterprise identity layer.

The security boundary is not the chat window.

The chat window is just the interface.

The security model I would want to see

A secure agentic execution architecture should assume that the LLM will eventually fail.

Not because the model is bad.

Because every security system should assume individual controls will fail.

A robust design therefore looks more like:

                    USER
                      │
                      ▼
                ┌──────────┐
                │   LLM    │
                └────┬─────┘
                     │
              intent / tool call
                     │
                     ▼
             ┌──────────────┐
             │ Orchestrator │
             └──────┬───────┘
                    │
             authorization
                    │
                    ▼
             ┌──────────────┐
             │   Sandbox    │
             └──────┬───────┘
                    │
          ┌─────────┼─────────┐
          ▼         ▼         ▼
      Filesystem  Network   Identity
          │         │         │
          └─────────┴─────────┘
                    │
                    ▼
              Enterprise data

Every layer should assume the layer above it may be compromised.

That means:

LLM refusal should not be the final enforcement point.

The orchestrator should authorize capabilities independently.

The sandbox should enforce operating-system isolation.

The network should enforce egress policy.

Enterprise credentials should be scoped to the minimum possible privilege.

Every meaningful action should be observable.

This is exactly the defense-in-depth model recommended in OWASP's AI Agent Security guidance.

Security checklist for AI execution environments

Before giving an AI system access to company information, I would want concrete answers to these questions.

Execution

Filesystem

Network

Identity

Orchestration

Monitoring

The real lesson

The most interesting part of this research was not getting a shell behind Copilot.

It was discovering that the shell was almost beside the point.

The modern AI security conversation spends an enormous amount of time asking whether a model can be jailbroken.

That matters.

But as soon as the model can use tools, execute code, access files or interact with enterprise systems, another class of security questions becomes unavoidable.

What can the runtime do?

What can the orchestrator do?

What can the network do?

What can the identity do?

And what happens when the model is removed from the equation completely?

Microsoft's assessment of VULN-210492 was that the behavior I reported did not constitute a security vulnerability under its criteria.

I can accept that conclusion while still finding the architectural behavior worth studying.

Because a system can be secure enough to pass a vendor's vulnerability threshold and still contain fascinating trust boundaries worth understanding.

That is where AI security becomes traditional security engineering again.

The model is the brain.

The orchestrator is the nervous system.

The sandbox is the machine.

And the network is the road out.

The interesting question is not whether the brain says no.

It is whether the machine can enforce that answer anyway.

What I'm looking at next

There is still a lot of unexplored territory around these systems.

Shadow patching.

Orchestration-layer trust boundaries.

Tool isolation.

Egress controls.

Enterprise API exposure.

And the increasingly strange places where AI safety policy meets ordinary operating-system security.

The rabbit hole is deeper than the chat window suggests.

Stay tuned.

← All posts