Defense in Depth for AI Agents: The Harness and the Environment
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 July 2026, the AI industry ran a version of this experiment.
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 model security isn't the problem
Blaming the model for this incident misreads what a model is. 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 incident argues the opposite. Internal controls were absent in this case by deliberate choice, 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.
