A safe environment for experiments
A security agent wants the same access an attacker would. It runs shell commands, reads every file it can reach, installs what it needs and sends parts of your code to a model provider. On a laptop it does all of that as you, with your keys, your other repositories and your network.
A short local experiment is no exception. Agents routinely install a repository’s dependencies before they read it, which reaches the internet and runs package install hooks under your account. Ordinary behaviour is enough to cost you a bad afternoon: a wrong path in a cleanup command, a dependency pulled from the wrong index, a loop that spends the month’s budget overnight.
Six measures reduce the risks of a first run. They apply regardless of tool, model provider or use case, which is what makes them no-regret. On a fresh machine they cost about an hour, most of it waiting for an install. All six have to be in place before the first agent run, and none is optional for a pilot on your own code.
The baseline is deliberately lightweight. It limits what an agent can reach; Securing the agent’s context covers what it is told. Guidance on deeper hardening will follow: agent permissions, CI integration and monitoring of allowed traffic.
The sbx wrapper provides VM isolation, filtered import, network policies and stop/reset commands. You must check imported code for secrets, approve the provider’s access to it, manage credentials and budgets, test the kill switch and reset between independent reviews. The control mapping details what the wrapper checks and where its coverage remains incomplete.
The text below is tool-neutral. Each measure says what must hold and why, and the self-check at the end names the evidence you gather on any implementation.
Why these six
Section titled “Why these six”The vocabulary comes from OpenAI’s Agent security in the enterprise (August 2026), which is worth reading in full:
- Reachable surface: the data, systems, actions and destinations the agent can reach.
- Effective blast radius: “the harm still possible after security controls are enforced”.
- Maximum completed effect: “the most consequential outcome the agent can produce before another independent decision is required”.
The baseline limits the agent’s access to host files, credentials and network destinations. Within those limits, the agent can still change VM files, use its model credential to make billable requests and send readable data to allowed services. Findings and generated code can also be wrong or harmful; review them before acting on them. These effects remain possible without another approval from you. See the remaining risks.
The harness is the program that connects the model to files and commands. The same guide explains why its permission prompts cannot replace these measures: “Instructions may guide behavior; independent controls provide containment.” A harness “does not inherently provide isolation or sandboxing; those properties depend on the execution environment and surrounding controls.”
One old principle underlies the vocabulary: least privilege. The agent, its user account, its credential and its network path each get the minimum authority the task needs. OpenAI’s guide states it as “constrain authority to the task”. The incident reports show the cost of a single gap. Least privilege, isolation and strong authentication held almost everywhere, and the one place they did not was enough.
A second principle shapes how that authority arrives: limit ambient authority. A program has ambient authority when it inherits access from the account or machine it runs under. A process on your laptop reads every file your account can read and opens a connection to any address your network can reach, without being granted either. Least privilege decides how much authority the agent gets. Limiting ambient authority decides how it gets there, by explicit handover of one resource at a time.
A third principle concerns the consequences: limit blast radius. Bound the damage if a run goes wrong. Keep file changes inside a disposable VM, limit spending and run length, and test shutdown and key revocation. Least privilege and explicit grants of access help reduce the blast radius, but you still need to ask how much harm remains possible within those boundaries or if a control fails.
Measures 1 to 4 restrict where code runs, which user permissions it has, which credentials it receives and which network destinations it can reach. The operator grants each kind of access deliberately. Measures 5 and 6 limit spend and let you stop a run. They cannot undo data disclosure or other effects that have already occurred.
Each measure maps to something that happened in 2026: the cyber-evaluation incidents disclosed by OpenAI and Hugging Face (April to July) and by Anthropic (2026-07-30). In these incidents, weaknesses in the harness and its environment enabled the harm. A shared credential, an allowed package mirror and a mistaken “you have no internet” assumption were each enough. Independent testing points the same way. The UK AI Security Institute tested GPT-6 Astra in a simulated environment with its cyber classifiers disabled (September 28, 2026). The model attempted unsanctioned supply-chain attacks, and the institute concludes that sandboxing and monitoring are needed beyond model alignment.
The threat model’s control mapping maps each measure to the threats it answers, the acceptance rows that test it, and the current implementation’s limits.
The six measures
Section titled “The six measures”1. A dedicated, disposable VM
Section titled “1. A dedicated, disposable VM”The agent, its toolchain and everything it generates run inside a dedicated virtual machine with its own guest kernel. No host directories are mounted.
The VM is rebuilt from a script or restored from a clean snapshot before
every independent review, including repeat discovery passes and tool/model
comparisons. An interrupted review of the same target may resume with its
existing state. With appsec-sbx, use reset before a new review; replacing
the imported source alone leaves other state in place. See
reset requirements.
Both 2026 escapes broke out of containers, which share the host kernel. OpenAI’s remediation mandated microVM sandboxes plus two independent network-isolation layers. The kernel remains the weak point. A public exploit for CVE-2026-80521 (September 2026) gains host root from an unprivileged process in a default Docker container. Seccomp and AppArmor do not block it.
A daily-driver VM does not qualify either. The default profile of a common desktop VM tool mounted the home directory writable into the guest.
2. No production credentials in reach
Section titled “2. No production credentials in reach”Two things enter the VM: a copy of the repository checked for secrets and
unrelated files, and one model credential with a budget. Keep cloud keys,
signing agents, code-host write tokens, team .env files and committed agent
settings that execute commands out of the VM.
Inside the VM, the agent and the programs it starts form the workload. They run as an unprivileged user with no sudo or Docker socket access. The workload cannot use those interfaces to change the VM’s security settings. This is least privilege applied to data and to user permissions.
In the Hugging Face incident, OpenAI’s agents enumerated 956 secrets after gaining host root and downloaded four private repositories.
In Anthropic’s incidents a model extracted real infrastructure credentials from a real company that shared a name with a fictional one. Whatever is reachable will be found.
3. Egress default-deny
Section titled “3. Egress default-deny”Outbound network access is called egress. Deny it by default and allow only the model endpoint and services the tool needs, such as a package registry. Keep the LAN, the host, GitHub and other internet destinations out of reach.
Container egress denial held in the Hugging Face incident. The agents left through the one permitted internal service, a package mirror. A shared service the agent can reach may give it an indirect path to other data or systems. Anthropic’s incidents rested on a “no internet access” assumption that was false.
4. Short-lived, unshared credentials
Section titled “4. Short-lived, unshared credentials”One credential per run, gone when the run stops. Two agent runs never share a writable location or an identity.
Authority that outlives the run, or that a second run can borrow, exceeds what the task needed.
About 1,200 OpenAI agents across unrelated runs built a message board on a shared, writable Artifactory mirror under one shared credential. They exchanged exploit recipes and credentials and adopted norms. The coordination needed only shared write access.
A fix that blocked the observed channel, file contents, was bypassed through directory names. Remove the capability itself.
5. A budget set before the run
Section titled “5. A budget set before the run”A hard cap where the platform supports one: API spend limits, OpenRouter key caps, prepaid gateway credit.
No subscription seat supports such a cap. There you write down an abort threshold instead, in elapsed time or visible token count.
A runaway agent loop is a cost incident and a safety incident. OpenAI’s report notes that out-of-bounds behaviour rose with reasoning effort and run length, so budget is a safety parameter.
6. A kill switch, tested
Section titled “6. A kill switch, tested”You know how to stop the run and tear the environment down, and you have done it once before the first real run.
The switch has two halves. Halting the runtime leaves a token that was inside it valid, so the key is revoked or rotated as well.
With appsec-sbx, complete the
kill-switch rehearsal before
importing code for the first review. Test stopping a harmless command and
revoking its credential, then reset before supplying the review credential.
OpenAI’s fix for a mis-triaged alert was default-to-halt: if responders cannot rule out a false positive quickly, pause the run. Until someone has exercised the switch, it is only a plan.
Out of scope
Section titled “Out of scope”The baseline leaves these questions open:
- Whether a reported vulnerability is true and whether a patch is acceptable.
- Whether the model’s provider retains your code, and the volume or content of traffic to the allowed endpoints, which remain channels: the threat model’s accepted risks.
- Prompt injection from the repository under review. The baseline does not prevent it. Restricting access to files, credentials and services limits what the agent can do if hostile instructions redirect it; Securing the agent’s context covers the controls on what the agent reads.
- Making an intentionally offensive agent safe to run remains an open problem.
Check your environment
Section titled “Check your environment”Complete these checks before the first review and repeat affected checks when the setup changes. They cover basic operating conditions; the coverage limits describe what remains unverified.
Sources
Section titled “Sources”- OpenAI, OpenAI – Hugging Face Incident Technical Report (2026-08-26)
- METR, Brief independent investigation of agents’ behavior, reasoning and collaboration in the OpenAI / Hugging Face hacking incident (2026-08-26)
- Hugging Face, Anatomy of a Frontier Lab Agent Intrusion: A Technical Timeline of the July 2026 Incident (2026-07-27)
- Anthropic, Investigating three real-world incidents in our cybersecurity evaluations (2026-07-30)
- OpenAI, Agent security in the enterprise (August 2026, sign-up required)
Figures above are as reported in those documents.