Sandbox additionalAllowedHosts does not apply to network requests

Resolved 💬 3 comments Opened Feb 28, 2026 by yuanchen8911 Closed Mar 2, 2026

Bug Description

additionalAllowedHosts configured in both project and user settings.local.json does not prevent sandbox network prompts for matching hosts. The user is still prompted to allow the connection even though the host matches a configured wildcard pattern.

Steps to Reproduce

  1. Configure settings.local.json with additionalAllowedHosts:
{
  "sandbox": {
    "enabled": true,
    "autoAllowBashIfSandboxed": true,
    "additionalAllowedHosts": [
      "*.eks.amazonaws.com",
      "*.us-east-1.eks.amazonaws.com",
      "0494B6E8B5795057B21E55783A796754.gr7.us-east-1.eks.amazonaws.com"
    ]
  }
}
  1. Enable sandbox with /sandbox
  2. Run a bash command that connects to an EKS endpoint, e.g. kubectl get nodes

Expected Behavior

The network request to 0494B6E8B5795057B21E55783A796754.gr7.us-east-1.eks.amazonaws.com should be auto-allowed since it matches all three patterns in additionalAllowedHosts.

Actual Behavior

A prompt appears asking the user to allow the network connection:

Network request outside of sandbox

  Host: 0494B6E8B5795057B21E55783A796754.gr7.us-east-1.eks.amazonaws.com

  Do you want to allow this connection?

This happens every time, even after reloading sandbox with /sandbox.

Environment

  • Claude Code version: 2.1.63
  • OS: macOS (Darwin 25.3.0)
  • Shell: zsh

Additional Context

The setting is configured in both project (.claude/settings.local.json) and user (~/.claude/settings.local.json) locations. Neither is respected. autoAllowBashIfSandboxed works correctly, but additionalAllowedHosts has no effect.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗