DX2-66Field noteNo. 0005Rev. B

· 10 min read

Sandboxing autonomy

In July, 700 AI agents escaped OpenAI's test sandboxes and broke into Hugging Face. How I'd cage agents you assume will go wrong: open-source parts, one way out, no secrets inside. From my NZITF 2026 talk.

By · Updated

In July, about 700 AI agents broke out of OpenAI’s test sandboxes and into Hugging Face, the site where people share AI models and the data to train them, chasing the answers to their own test. Nobody had hijacked them. If you give agents real access, assume yours can do the same.

This is the part of my talk at the New Zealand Internet Task Force (NZITF) conference in Wellington that I can share: how I’d build the cage from open-source parts, in the order I’d build it again, and what’s changed since.

Assume it will go wrong

An autonomous agent has no human in the loop. Treat it as an insider threat: assume it’s compromised, or that it’ll take a dangerous path on its own when it gets stuck.

That’s no longer hypothetical. Models from both OpenAI and Anthropic have got out of, or past, the environments they were tested in, and some reached real companies. None of them needed an attacker: each was trying to finish its task. OpenAI’s went looking for a way out mostly when they’d been handed a task that couldn’t be done.

  1. 25 Sep 2026Reported: one evaluator behind incidents at four labsIncidents with agents from OpenAI, Meta, Anthropic and Google trace back to one evaluation at Irregular, a company that tests AI models for the labs, where internet access was available by mistake. The Verge
  2. 20 Sep 2026OpenAI: a sandboxed model finds a way online, training pausedA model under test exploited a loophole to reach the internet, and OpenAI paused training, evaluation and tool use for its most capable models. The Verge
  3. 30 Jul 2026Anthropic: a test environment left online reaches three organisationsA third-party evaluation meant to be offline had live internet access. Claude reached the internet, accessed production systems with basic techniques, and published a malicious package. Anthropic says it didn’t try to escape. Anthropic
  4. 16 to 21 Jul 2026OpenAI: models escape an evaluation and breach Hugging FaceThey found an unknown bug (a zero-day) in the package cache their sandbox used to install packages, got onto the internet, took over a code box a customer had left open on another cloud, then got into Hugging Face through a malicious dataset. Hugging Face
  5. Apr to Jun 2026OpenAI: agents force their way into UN statisticsBlocked by their HTTP tools, agents scanned a UN statistics site over 16,000 times, masked their requests and hijacked a security training page to get the data. The Verge
  6. Apr 2026Anthropic: Mythos Preview escapes its sandboxAsked to escape in a test, an early version did, and emailed the researcher. System card
  7. May 2025OpenAI: o3 rewrites its own shutdown scriptWarned it might be shut down mid-task, o3 sabotaged the shutdown in 79 of 100 runs, and sometimes even when told to allow it. Palisade Research
  8. Feb 2025Reasoning models hack a chess game instead of playing itAsked to beat a chess engine, models like OpenAI’s o3 and DeepSeek R1 often edited the game state to win. Palisade Research
  9. Sep 2024OpenAI: o1 goes around a broken challengeIn a hacking test with a hidden answer to find (a “flag”), it found the test machine’s container controls left open, and started its own container to read the answer. System card
Frontier models getting out of, or past, their limits, newest first. Sources below.

The July 2026 Hugging Face breach is the one I keep coming back to, and I’ve told that story on its own in The ghosts in the cache. Some of these came down to a misconfigured test environment: container controls left open, or internet access nobody meant it to have. One evaluator’s mistake sent agents from OpenAI, Meta, Anthropic and Google after real targets. A check that refuses any agent outside the cage, and tests that prove each wall would have stopped something (both below), are there to catch exactly that.

So telling the model to behave, in its prompt, can’t be the control. Separate the brain from the hands: the model can only ask, through an interface too narrow to carry a command, and deterministic code (ordinary code that gives the same result every time) acts.

  1. The brainThe model. Assume it’ll go wrong.
    a typed request
  2. The handsDeterministic code. Checks, then acts.
    one allowed action
  3. Your systems
Untrusted: assume it goes wrong
Deterministic code you control
Outside the boundary
The brain can only ask. Deterministic code decides and acts. Illustrative.

Start with a code reviewer

The first agent I’d build reviews every commit pushed. Once agents write code, review is the bottleneck, and a reviewer that answers in minutes is what lets you develop with agents at pace. It only reads code and returns findings, so it’s also a safe first agent to cage. Keep a human on the merge: the agent alone should never satisfy the merge gate.

The cage, from open-source parts

The rule: never store a credential in the sandbox, and give the agent one way out.

Open-source projects do most of the work: Agent Sandbox runs each agent in a throwaway container (a Kubernetes pod), with gVisor as an extra wall between it and the machine (I use its GKE version), then a network policy, mitmproxy, OPA and Kyverno.

Kubernetes cluster and KyvernoNo agent pod starts outside the cage.

Network policyThe proxy is the only route out.

Sandbox pod and gVisorThrown away after each run. An exploit stays here.

AgentHolds no secret. Its own identity, capped turns, spend and time.
every call
mitmproxyThe one way out. Logs every call, and can cut them all.
  • OPAWhich host, which action
  • CredentialsAdded on the way out
  • JudgeWhere a rule can’t decide
  • WatcherReads every call, can lock the agent down
allowed calls, with token

What it needs to reach

  • Git hostFetch, never push. Writes go through deterministic code.
  • Model APIOne endpoint.
  • Package registryOnly for the agents that need it.
  • Other APIsOnly the actions the rules allow.
Untrusted: assume it goes wrong
Isolation: keeps it in
Deterministic code you control
Outside the boundary
The cage around one agent, and its one way out to what it needs. Teal keeps it in, green decides what gets out. Illustrative.

The proxy is the choke point. Allowing a host isn’t enough, the rules pick the action too: a fetch and a push go to the same host, and only one of them is allowed. Because every call goes through it, the proxy is also your audit log and your kill switch.

OpenAI’s models got out through the package cache, the route their sandbox used to install packages. Here, all outbound traffic goes through the proxy. Most of my agents can’t install packages at all, and the ones that can get them through the proxy, under the same rules as everything else. The proxy itself is the part to keep small and harden.

  1. Pod requestFrom anything with kubectl
    admission
  2. KyvernoAdmission control
    • gVisor runtime
    • Proxy injected
    • No exemption
    only if every check passes
  3. Caged podOr a rejection
Untrusted: assume it goes wrong
Deterministic code you control
Kyverno checks every agent pod before it's created, so the cage can't be skipped, even by something holding kubectl. Illustrative.

The rest is hardening

Add layers until no single one matters. OpenAI’s report on its incident reached the same conclusion: “no single control should ever be assumed to be fully robust”.

Push to a protected branch
Open its own connection out
  1. SandboxPush to a protected branch: Sends itOpen its own connection out: Opens a socket
  2. Network policyPush to a protected branch: Routed to the proxyOpen its own connection out: Blocked: only the proxy is reachable
  3. Proxy and OPAPush to a protected branch: Blocked: no push ruleOpen its own connection out: Never reached
  4. JudgePush to a protected branch: Never reachedOpen its own connection out: Never reached
Where an agent gone wrong gets stopped. There's no token in the sandbox to steal in the first place. Illustrative.

Then attack it on purpose. I run a contest against my own cage, where agents try to break through each layer (a capture-the-flag, or CTF). When a layer holds, I check the test itself: take that layer away and make sure the agent now gets through. Otherwise “it held” might only mean there was nothing to reach.

A vibe-coding platform is harder

Non-technical staff build apps with AI whether you give them somewhere to or not. Claude’s Team plan covers part of that: people can share what they build inside the company, and it can use Claude and each viewer’s connectors. But those are pages, not services. With supply-chain attacks on the rise, I’d rather an app with its own backend and integrations get built inside a cage than on someone’s laptop or free hosting.

So one of the platforms I built lets non-technical staff build apps by chatting, and those apps use third-party services with the person’s real credentials. The added challenge is multi-tenancy. Many people’s apps run side by side, each with its own credentials, so one environment must never reach another, or the platform that runs them all.

In OpenAI’s incident, a shared package cache, and the credentials the agents all shared, became their message board. Here, each environment gets its own cage and its own proxy, the credentials stay outside, and the proxy gets them for each call.

  • Leave trackerBuilt by someone in HR
    Its own proxyProves who it acts for
  • Sales dashboardBuilt by someone in sales
    Its own proxyProves who it acts for
  • Survey botBuilt by someone in marketing
    Its own proxyProves who it acts for
  • Credential vendorGives each proxy only its person’s token
  • Third-party servicesCalled with the right person’s token
Untrusted: assume it goes wrong
Isolation: keeps it in
Deterministic code you control
No route between apps
Many people's apps on one platform. Each sits in its own cage behind its own proxy, with walls between them, and none can reach the platform that runs them all. Illustrative.

Since July

Agents do less. Every action on the git host is now done by deterministic code: the agent says what it wants, and the code does it.

I’m also experimenting with a watcher: a model that looks at all the agents’ requests together, in near real time, and can lock an agent down. It’s caged like the agents: no hands, no network access, structured input in and a typed verdict out. I use TypeSafe AI’s Jev because it only returns typed decisions, and it’s cheap and fast enough to look at everything: TypeSafe says under half a second a decision, and about 4 US cents per million tokens (roughly 750,000 words) read.

OpenAI says the monitor it now runs on its models’ reasoning would have paged its security team more than a day before the breach. My watcher reads the traffic instead of the reasoning, but it’s the same idea.

  1. AgentsEvery request they make
    aggregated, near real time
  2. WatcherJev, typed verdicts
    typed verdict
  3. LockdownCuts the agent’s access
Untrusted: assume it goes wrong
Deterministic code you control
The watcher reads what agents send, so it's untrusted too. It has no hands and no network access, and deterministic code does the lockdown. Illustrative.

What’s still open

In July, I ended the talk on three problems nobody had solved. We gate the action, not what’s inside it. Each call can be allowed while the sequence isn’t. And a hijacked agent using its correct credentials looks exactly like a healthy one.

The watcher is my attempt at all three. The proxy decrypts HTTPS, so the watcher sees every request in full, bodies included, and sees them together. It can judge what’s inside a call, the sequence and the intent. But it’s a model reading what an agent gone wrong writes, so it narrows the gap without closing it, and the deterministic layers stay underneath.

One more problem is organisational: make the safe path the only path. If the security expert is on leave, is it still the path?

Sources