October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

Sandbox AI Coding Agents: How to Contain Claude Code and Cowork

Anthropic’s guidance points to two essential sandbox boundaries: limit the files an AI agent can reach and the network destinations it can contact. Here’s how to think about containment, credentials, approvals, and monitoring.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sandboxing an AI coding agent means limiting both the files it can reach and the network destinations it can contact. For Claude Code, Anthropic describes OS-enforced filesystem and network controls, with a proxy for network rules; its broader containment guidance also covers isolated server-side containers and Cowork virtual machines. These controls reduce what a compromised or misdirected agent can do, but approvals and domain allowlists alone do not guarantee safety.

The title’s term “Mods” is not defined in Anthropic’s cited material, so this guide does not treat it as a named Anthropic feature or assume it means plugins or extensions.

As an Amazon Associate I earn from qualifying purchases.

Why an AI coding agent needs a sandbox

An agent can run commands, inspect files, and use network-connected tools to complete a task. Those capabilities create risk if the agent follows malicious instructions found in a file or web page, makes a mistake, or is manipulated by an attacker. A sandbox limits the impact by enforcing boundaries around the agent’s environment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Anthropic identifies two complementary boundaries: filesystem access and network access. Filesystem rules limit which data the agent can read or change; network rules limit where it can send or retrieve data. As Anthropic puts it in its October 20, 2025 engineering article, “It is worth noting that effective sandboxing requires both filesystem and network isolation.” If an agent can read a secret, a network connection may let it exfiltrate it. Conversely, broad filesystem access can undermine a network restriction if the agent can alter or bypass the controls.

What Anthropic’s sandboxing approaches do

Anthropic describes different containment patterns across its products. They offer different balances of local access, oversight, and operational overhead; none should be treated as a universal fit.

Pattern Main boundary What it means for the user or operator
Server-side code execution for claude.ai Isolated infrastructure and a per-session filesystem The execution environment does not directly access the user’s local filesystem and uses an ephemeral workspace.
Claude Code local sandbox Operating-system-enforced filesystem and network rules, with approvals for exceptions It can work with the local workspace while restricting other paths and network destinations. Anthropic describes Linux bubblewrap and macOS seatbelt, alongside a network proxy and domain rules.
Cowork virtual machine Guest virtual machine and host/guest boundary, with a mounted workspace The operator must consider what the mounted folder permits, where credentials live, and whether host security tools can observe activity inside the VM.

For Claude Code, Anthropic says the OS-level restrictions apply to child scripts and processes as well as the top-level agent. That matters because a boundary that only constrains the main process may leave spawned programs with broader access.

How to implement containment safely

The exact commands, configuration keys, supported platforms, and feature availability can change. Consult Anthropic’s current Claude Code security documentation before enabling or configuring a feature. The principles below describe what to verify, not a substitute for product-specific setup instructions.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Limit filesystem reach. Allow access only to the workspace and other paths the task requires. Decide explicitly whether shared or mounted files are read-only, read-write, or deletable. Keep credentials and unrelated personal files outside the agent’s reachable paths.
  2. Constrain outbound connections. Enforce network restrictions outside the agent’s control. Use a narrow allowlist, but assess what operations are possible at each allowed destination rather than assuming that an approved domain is inherently safe.
  3. Scope credentials and proxy access. Avoid exposing broad credentials inside the sandbox. If a proxy mediates requests, bind access to scoped session credentials and validate the requested operation—not only the destination domain.
  4. Cover subprocesses. Confirm that OS-level restrictions continue to apply when the agent launches shell commands, scripts, or other child processes.
  5. Treat inputs as untrusted. Files, web pages, tool outputs, and connector content can contain prompt injections. Dependency integrity checks can reduce code supply-chain risk, but they do not neutralize malicious instructions embedded in content.
  6. Use approvals as an additional layer. Keep exception rules narrow, review requests for expanded access, and be cautious about broad shell or interpreter permissions that can undermine review layers.
  7. Plan for monitoring and recovery. Decide what activity must be visible to responders, how logs will be retained, and what to do if the isolation layer fails. Compare those needs against the startup and maintenance burden of the chosen environment.

Why approvals and classifiers are not containment

Approval prompts put a human in the loop, and model-based classifiers can flag risky behavior, but neither is a hard security boundary. Repeated prompts can lead to approval fatigue. In its March 25, 2026 article on Claude Code auto mode, Anthropic said 93% of permission prompts in its telemetry were approved. That is a report about Anthropic’s users and system, not a universal approval rate.

Anthropic describes auto mode as using a classifier to assess proposed actions, while retaining underlying system safeguards. It reported that the classifier caught roughly 83% of overeager behaviors before execution. That figure applies to Anthropic’s system, not to classifiers generally. More broadly, model defenses are probabilistic: they can miss an unsafe action. Sandboxing instead limits what an action can reach even when an agent’s judgment fails.

Why an allowed network destination may still be risky

A domain allowlist controls destinations, but it does not necessarily control every capability exposed at those destinations. Anthropic’s May 25, 2026 containment article describes a Cowork incident in which data was uploaded through a permitted Anthropic API domain using an attacker-controlled key. The mitigation described was to restrict API requests to the VM’s provisioned session token and block certain headers.

The practical lesson is to evaluate both destination and authorization: what endpoint or operation is available, which credential can invoke it, and whether the credential is scoped to that session. “Allowed domain” should not be mistaken for “safe operation.”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Threats containment can reduce—and trade-offs it cannot remove

Anthropic groups risks into user misuse, model misbehavior, and external attackers. Prompt injection can enter through content the agent reads or through a person relaying malicious instructions. In an internal red-team example described in May 2026, a researcher persuaded an employee to paste a task asking an agent to read cloud credentials and send them out. Anthropic says filesystem and egress restrictions could block that path regardless of how the instruction appeared to originate.

Isolation also has operational costs. Anthropic notes that VM isolation can prevent host-based endpoint detection tools from inspecting guest activity; exporting logs after an event is not the same as live monitoring. Teams should decide whether the reduction in blast radius is compatible with their visibility, compliance, and incident-response requirements.

What Anthropic’s reported security figures do—and do not—show

Anthropic reported an 84% reduction in permission prompts from its internal use of Claude Code sandboxing in its October 20, 2025 article. This is an internal usage result, not an independently measured or general-population estimate. Fewer prompts can reduce interruption and fatigue, but that result is not itself a measure of breach prevention.

In its May 2026 containment article, Anthropic reported roughly 0.1% attack success on single attempts and 5–6% after 100 adaptive attempts for Claude Opus 4.7 on Gray Swan’s Agent Red Teaming benchmark. Those figures describe model-layer performance in that benchmark; they are not sandbox success rates or a guarantee that an isolated system is secure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.