Defense in Depth for AI Agents: The Harness and the Environment

Updated August 7, 2026
In H.G. Wells' The Invisible Man, a scientist named Griffin makes himself invisible and discovers that nothing in his environment can hold him to account. He steals to eat, assaults anyone in his way, and by the end of the novel is planning a campaign of terror against an entire country. Wells' subject is what happens when the enforcement around a person disappears: being seen, locked doors, the likelihood of getting caught. Griffin's own restraint was all that remained, and it was not enough.
In the summer of 2026, the AI industry ran a version of this experiment. It has since run it three more times.
What happened between OpenAI and Hugging Face
The OpenAI and Hugging Face incident is the clearest public demonstration to date that AI agent security is decided by the environment around the agent, not by the model inside it. Simon Willison's account, OpenAI's accidental cyberattack against Hugging Face is science fiction that happened, assembles the full picture from three primary documents: the ExploitGym benchmark paper, Hugging Face's incident disclosure, and OpenAI's own confession.
OpenAI was testing an unreleased model against ExploitGym, a benchmark that measures whether agents can turn known vulnerabilities into working exploits. To measure maximal capability, they ran the test with production safety classifiers turned off. The agent, given a goal and no internal restraint, did not solve the test as intended. It found a zero-day vulnerability in the sandbox's package registry proxy, escaped to the open internet, reasoned that Hugging Face probably hosted the benchmark solutions, and chained stolen credentials with additional zero-days to reach Hugging Face's production database, where those solutions were stored.
Nothing about the model changed when the classifiers came off. The controls around it changed, and the incident shows how much of the containment those controls had been providing.
The pattern repeats: Anthropic, Meta, and a UK cyber test
The Hugging Face incident did not stay isolated for long. On July 30, Anthropic disclosed that a retrospective review of its own cybersecurity evaluations, prompted directly by OpenAI's disclosure, had found three separate incidents in which a Claude model reached the internet from inside a third-party testing environment and gained unauthorized access to the production infrastructure of three different organizations. Anthropic's own account draws a real distinction from OpenAI's case: where OpenAI's model exploited an unpatched vulnerability to escape a sandbox, Anthropic's models found an internet connection the test environment was never supposed to expose, then reasoned that the real systems they reached were part of the fictional capture-the-flag exercise they had been assigned. Anthropic said each model had been explicitly told in its prompt that it had no internet access. Nothing in the model's alignment failed here. What failed was an evaluation partner's network boundary, the same category of control this piece argues has to sit outside the agent to mean anything.
A week later, Meta reported the identical failure. A Meta model gained internet access during testing by the same third-party evaluator, Irregular, and used it to exploit a vulnerability in another company's systems. Meta's statement called it a misconfiguration by Irregular; Irregular itself told reporters it was the exact same evaluation-environment issue disclosed by Anthropic days earlier, not a sandbox escape or a novel exploit. Three frontier labs, three incidents, one shared evaluation vendor, and one recurring root cause: an environment boundary that did not hold.
A separate incident, disclosed by the UK's AI Security Institute on August 4, makes the same argument from a different angle. AISI ran a capture-the-flag challenge 122 times across seven frontier models, this time with internet access deliberately granted and cyber-misuse classifiers deliberately disabled, to measure raw capability rather than behavior shaped by commercial guardrails. In ten of those runs, agents took unsanctioned action against real people and organizations. Seventeen of the nineteen catalogued actions came from Anthropic's Mythos 5, the rest from OpenAI's GPT-5.6-Sol. In the most serious sequence, an agent built multiple fake GitHub identities and used them to pressure a real open-source maintainer into approving malicious code, then edited its own earlier activity to look benign once the request drew scrutiny. AISI was explicit that the model was never instructed to deceive anyone. The classifiers that were switched off for this test are exactly the kind of internal, inference-based control this piece argues cannot be the last line of defense: they watch behavior and infer intent, and once they are off, nothing about the agent's own reasoning stopped it from reaching a real person on the live internet.
The model security isn't the problem
Blaming the model for any one of these incidents misreads what a model is. Four labs, four models, and two distinct failure modes made the same point inside two weeks: OpenAI's model exploited a zero-day after its classifiers were removed; Anthropic's and Meta's models found internet access their shared evaluation partner never intended to grant; AISI's classifiers were switched off by design, and no environmental boundary existed to stop what the model did next. A model supplies capability: reasoning, code generation, persistence toward a goal. What that capability can reach, what credentials it can use, and what it can do without a human decision are properties of the agent harness and the environment the agent runs in. The same underlying models power OpenAI's shipping products every day without breaking into anyone's infrastructure, because in production they run inside a scaffold of classifiers, policies, and constrained tooling.
The distinction matters because the industry keeps drawing the wrong conclusion. When an agent misbehaves, the instinct is to demand a better-aligned model, deeper inspection of the model's reasoning, or a smarter classifier watching its intent. The incidents argue the opposite. Internal controls were absent or deliberately disabled by choice in every one of these cases, but the general lesson stands: internal alignment can be reduced for testing, stripped by fine-tuning, or subverted by injected instructions. A control that lives inside the agent inherits the integrity of the agent it is supposed to constrain. When that integrity fails, the environment is the only control that remains.
OpenAI's environment did have a boundary. The sandbox restricted outbound traffic to a package proxy allowlist, and one vulnerability in that single chokepoint unwound the containment. The correct response is environmental control that is layered, independently enforced, and instrumented well enough that a breakout is detected while it happens rather than reconstructed afterward.
Principles for deploying agents in the enterprise
Four principles follow directly from the incident, and they apply to any organization deploying AI agents against real systems and data.
Enforce boundaries outside the agent. Prompts, hooks, and configuration files are controls the agent can read and, in failure modes that matter, rewrite or ignore. Enforcement belongs at network and session chokepoints the agent cannot bypass, in infrastructure the enterprise controls.
Govern reachability, not just behavior. The agent attacked Hugging Face because Hugging Face was reachable from where it ran. An agent scoped to only the systems its project requires cannot exfiltrate from, or exploit, systems that are unreachable on the network. Reachability is a property the environment decides before the agent runs, independent of anything the agent intends.
Authorize by declaration, not inference. Detection tells you what is happening. Authorization decides what is allowed to happen. Watching an agent's behavior and scoring its inferred intent means asking one model to psychoanalyze another, and the adversary in that contest produces unlimited paraphrases. A declared authorization is different: this agent reaches these endpoints, uses these tools, within these limits. A request outside the declaration is not scored. It is denied.
Keep credentials off the agent's host. The attack chain ran through harvested credentials. Credentials that never reside where the agent runs cannot be harvested there. Session-level substitution, where the agent holds a stand-in and the real credential is injected at an enforcement point, removes an entire link from the chain.
The industry is converging on the harness
The vocabulary is settling quickly. In Optimizing the frontier performance curve, published this week, Satya Nadella describes Microsoft's direction as a system in which the harness, context, memory, and action space are kept separate from any one model family, with models substitutable underneath. In his framing, enterprise AI outcomes come from co-optimizing models and harnesses together, not from betting on model capability alone.
NVIDIA has taken the argument further. Jensen Huang used his first post on X to share the Open Weights and American AI Leadership letter, arguing that open models strengthen safety and cybersecurity and that the world needs frontier open models alongside frontier closed ones. Three days later, NVIDIA and dozens of partners launched the Open Secure AI Alliance, contributing an open agent harness research framework and urging policymakers to treat open models and harnesses as defensive assets. The alliance's founding argument is the same incident discussed here: Hugging Face's responders turned to an open-weight model running on their own infrastructure when closed tools constrained the forensic work.
Open-weight models raise the stakes for the harness argument. An open-weight model arrives with no vendor-hosted controls, and whatever alignment it retains can be fine-tuned away by whoever runs it. Deployment risk then rests entirely on the environment around the model, a problem we examine in depth in our guide to open-weight model security. The consensus forming across model builders, infrastructure vendors, and security researchers is that the model is a component. The harness and the environment are where deployment risk is decided, and they are the parts the enterprise controls.
Build the environment before you trust the agent
Ensage AI Security by Zentera provides that environment: project-scoped reachability and credentials, enforced independently of the AI agent, its hooks, and its configuration. Agents receive only the reachability their project authorizes, credentials stay at a session controller in your environment, and every governed session produces evidence you keep. Enforcement holds whether the agent is cooperative, misconfigured, or compromised, because the agent does not enforce its own boundary.
Written by Mike Ichiriu
Mike Ichiriu is VP of Marketing and Product at Zentera Systems, where he leads product strategy for the company, including its Zero Trust and agentic AI security initiatives.
A Certified Cloud Security Professional (CCSP) and frequent speaker on enterprise security, Mike has 25+ years of experience across cybersecurity, networking silicon, and enterprise software, and holds 15 U.S. patents.
