Answer: Use the reference container's init-firewall.sh script, which limits outbound traffic to the destinations the script allows; running a firewall inside a container requires extra permissions, so the reference adds the NET_ADMIN and NET_RAW capabilities through runArgs. Status: Confirmed Entry: tool/claude-code/permissions-and-security/restrict-network-egress Revision: 1 Digest: sha256:480c0402ed3ac94e (changes whenever the content changes) Timeline: Created: 2026-11-13T03:04:05Z Last changed: 2026-11-13T03:04:05Z Last verified: 2026-11-20T12:20:27Z Next check: 2026-11-21T12:20:27Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of firewall script | init-firewall.sh | [1] | 2026-11-20 required capability | NET_ADMIN | [1] | 2026-11-20 configuration mechanism | runArgs | [1] | 2026-11-20 Sources: [1] Anthropic. "Development containers". https://code.claude.com/docs/en/devcontainer.md Role: primary. Accessed: 2026-11-20T12:20:27Z Quote: "The reference container includes an [`init-firewall.sh`](https://github.com/anthropics/claude-code/blob/main/.devcontainer/init-firewall.sh) script that limits outbound traffic to the destinations the script allows." (Supports: firewall script) Quote: "the reference adds the `NET_ADMIN` and `NET_RAW` capabilities through `runArgs`" (Supports: required capability, configuration mechanism) Published: 2026-11-20T02:57:22Z Snapshot SHA-256: c3f08346262f8e0c0824bca732af96214b896504ee961ecfc19b4f348bdd576e (captured 2026-11-20T12:20:27Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. Cross-check: not-available at 2026-11-20T12:20:27Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:20:27Z Last attempt: 2026-11-20T12:20:27Z Notes and limitations: Extracted automatically from a single official source (section "Restrict network egress"). Related: https://latestn.com/tool/claude-code/permissions-and-security/review-plugin-before-install How do I review a Claude Code plugin before installing it? https://latestn.com/tool/claude-code/permissions-and-security/run-without-permission-prompts How do I run Claude Code in a dev container without permission prompts? https://latestn.com/tool/claude-code/permissions-and-security/sandbox-modes What are the sandbox modes in Claude Code, including auto-allow mode and strict sandbox mode? https://latestn.com/tool/claude-code/permissions-and-security/report-security-vulnerability How do I report a security vulnerability in Claude Code? https://latestn.com/tool/claude-code/permissions-and-security/require-approval-cross-machine-messages How do I require approval for cross-machine messages in Claude Code? https://latestn.com/tool/claude-code/permissions-and-security/restrict-channel-plugins How do I restrict which channel plugins can run in Claude Code? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:04:05Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/claude-code/permissions-and-security/restrict-network-egress/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/claude-code/permissions-and-security/restrict-network-egress POST: https://latestn.com/dispute/tool/claude-code/permissions-and-security/restrict-network-egress with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/claude-code/permissions-and-security/restrict-network-egress?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I restrict network egress for Claude Code in a dev container? Revision 1, last verified 2026-11-20T12:20:27Z. https://latestn.com/tool/claude-code/permissions-and-security/restrict-network-egress (accessed 2026-11-21T10:02:31Z). @misc{LatestN_tool_claude_code_permissions_and_security_restrict_network_egress_r1, title = {How do I restrict network egress for Claude Code in a dev container?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/claude-code/permissions-and-security/restrict-network-egress}}, note = {Revision 1; digest sha256:480c0402ed3ac94e; last verified 2026-11-20T12:20:27Z; accessed 2026-11-21T10:02:31Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/claude-code/permissions-and-security/restrict-network-egress