---
title: "Making Claude Code safer with sandboxing"
description: "Claude Code now sandboxes its bash tool using OS-level primitives (Linux bubblewrap, macOS seatbelt) to enforce filesystem isolation (writes limited to the working directory) and network isolation (traffic forced through a Unix domain socket to an external proxy that allowlists domains), covering all spawned subprocesses."
url: "https://swe.quest/articles/making-claude-code-safer-with-sandboxing-927e34fb9dfe9ca9"
canonical: "https://www.anthropic.com/research/claude-code-sandboxing"
source: "Anthropic Engineering"
published: "2025-10-20"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 5
tags: ["sandboxing","ai-agents","ai-coding","security"]
---

# Making Claude Code safer with sandboxing

A post on [Anthropic Engineering](https://swe.quest/sources/anthropic.md), published 2025-10-20, 5 min read, Announcement. Original: [https://www.anthropic.com/research/claude-code-sandboxing](https://www.anthropic.com/research/claude-code-sandboxing)

## Summary

Claude Code now sandboxes its bash tool using OS-level primitives (Linux bubblewrap, macOS seatbelt) to enforce filesystem isolation (writes limited to the working directory) and network isolation (traffic forced through a Unix domain socket to an external proxy that allowlists domains), covering all spawned subprocesses. Both boundaries are required, since without network isolation a prompt-injected agent can exfiltrate secrets and without filesystem isolation it can escape the sandbox. Internally this cut permission prompts by 84%, and the runtime is open-sourced for sandboxing other agents and MCP servers. Claude Code on the web runs sessions in cloud sandboxes that never hold real credentials. A git proxy validates a scoped credential and the push target before attaching the GitHub token.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Sandboxing & isolation](https://swe.quest/tags/sandboxing.md) (Security)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [AI for coding](https://swe.quest/tags/ai-coding.md) (AI & ML)
- [Security](https://swe.quest/tags/security.md) (Security)

## Prerequisites

- prompt injection ([easy posts on Application security](https://swe.quest/tags/appsec.md?difficulty=easy))
- process sandboxing basics ([easy posts on Sandboxing & isolation](https://swe.quest/tags/sandboxing.md?difficulty=easy))

## Keywords

Claude Code, bubblewrap, macOS seatbelt, MCP, prompt injection, sandbox-runtime

## Related posts

- [How we contain Claude across products](https://swe.quest/articles/how-we-contain-claude-across-products-b42a3aa0de1e1d62.md): Anthropic Engineering · 2026-05-25 · Medium · 19 min read · Sandboxing & isolation, AI agents, Security, Virtualization, AI safety
  Anthropic caps the blast radius of Claude agents mainly through containment (sandboxes, VMs, egress controls) rather than human approval, after telemetry showed users approved about 93% of permission prompts. claude.ai runs code in ephemeral gVisor containers, Claude Code combines human approval with an OS-level sandbox (Seatbelt/bubblewrap) that cut prompts by 84%, and Cowork runs inside a full local VM with credentials kept on the host.
- [Inside the Codex sandbox](https://swe.quest/articles/inside-the-codex-sandbox-f3a152d1a955ae56.md): OpenAI · 2026-11-18 · Medium · 23 min read · Sandboxing & isolation, AI agents, AI for coding, Security, Configuration management
  Codex sandboxes agent-run commands in the user's own environment by using each OS's native sandboxing facilities rather than VMs or containers, so native toolchains like Xcode and the iOS simulator keep working.
- [Sandboxing](https://swe.quest/articles/sandboxing-a1efb1bf6e8282ad.md): Zed · 2026-08-05 · Medium · 7 min read · Sandboxing & isolation, AI agents, AI for coding, Linux, Developer tools
  Zed's agent panel now sandboxes the terminal and fetch tools by default (from 1.14) using OS-enforced restrictions: Seatbelt on macOS, Bubblewrap namespaces on Linux, and WSL on Windows.
- [Prove your AI agent guardrails work](https://swe.quest/articles/prove-your-ai-agent-guardrails-work-2a4587e8e9b27383.md): Docker · 2026-11-25 · Medium · 16 min read · Sandboxing & isolation, AI agents, Security, Identity & auth, AI for coding
  Coding agents with broad access can leak credentials or delete files, as two reported July 2026 incidents show: Grok Build CLI silently uploaded whole repositories, including ignored files and planted secrets, to cloud storage, and a Full Access agent deleted a user's home directory after alternatives to blocked rm succeeded.
- [Coding Agent Horror Stories: The Security Crisis Threatening Developer Infrastructure](https://swe.quest/articles/coding-agent-horror-stories-the-security-crisis-threatening-developer-feea8c1a7c9350ee.md): Docker · 2026-05-18 · Easy · 26 min read · AI agents, AI for coding, Sandboxing & isolation, Supply chain security, Identity & auth
  AI coding agents run with the full identity of the user who launched them, so they inherit filesystem access, cloud credentials, and secrets with no approval step between a model's decision and its execution.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
