Skip to content

Network

Base classes

Name Children Inherits
ClaudeCodeBaseModel
clawd_code_sdk.models.base
Base model for all Claude Code Pydantic models.

⋔ Inheritance diagram

graph TD
  3679792072["settings.Network"]
  2604142835["base.ClaudeCodeBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2604142835 --> 3679792072
  3879467795 --> 2604142835
  2751680898 --> 3879467795

🛈 DocStrings

Bases: ClaudeCodeBaseModel

Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration.

Source code in src/clawd_code_sdk/models/settings.py
class Network(ClaudeCodeBaseModel):
    """Configures network isolation settings for the sandboxed bash environment, including domain restrictions, Unix socket access, and custom proxy configuration."""

    model_config = ConfigDict(
        extra="forbid",
    )
    allow_unix_sockets: list[str] | None = Field(None, alias="allowUnixSockets")
    """
    Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    allow_local_binding: bool | None = Field(None, alias="allowLocalBinding")
    """
    Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    http_proxy_port: int | None = Field(None, alias="httpProxyPort", ge=1, le=65535)
    """
    HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration
    """
    socks_proxy_port: int | None = Field(None, alias="socksProxyPort", ge=1, le=65535)
    """
    SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration
    """
    allow_all_unix_sockets: bool | None = Field(None, alias="allowAllUnixSockets")
    """
    Allow all Unix domain socket connections. If true, this overrides allowUnixSockets. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    allowed_domains: list[AllowedDomain] | None = Field(None, alias="allowedDomains")
    """
    Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    denied_domains: list[DeniedDomain] | None = Field(None, alias="deniedDomains")
    """
    Blocklist of network domains for sandboxed commands. Blocks specific domains even when a broader allowedDomains wildcard would otherwise permit them. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    allow_managed_domains_only: bool | None = Field(None, alias="allowManagedDomainsOnly")
    """
    (Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    allow_mach_lookup: list[AllowMachLookupItem] | None = Field(
        None, alias="allowMachLookup", examples=[["com.apple.coresimulator.*"]]
    )
    """
    macOS only. Additional XPC/Mach service names the sandbox may look up. Supports a single trailing * for prefix matching. Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. See https://code.claude.com/docs/en/sandboxing#network-isolation
    """
    tls_terminate: TlsTerminate | None = Field(None, alias="tlsTerminate")
    """
    Experimental. Terminate TLS inside the sandbox proxy so it can read the contents of HTTPS requests. Required for mask credential substitution. Set {} to generate an ephemeral certificate authority for the session, or set caCertPath and caKeyPath to use your own. Only honored from user, managed, or CLI --settings settings, not from .claude/settings.json or .claude/settings.local.json. Requires Claude Code v2.1.199 or later. See https://code.claude.com/docs/en/sandboxing#protect-credentials
    """
    strict_allowlist: bool | None = Field(None, alias="strictAllowlist")
    """
    UNDOCUMENTED. Deny non-allowlisted hosts for sandboxed commands without prompting (added v2.1.219). See https://code.claude.com/docs/en/sandboxing#network-isolation
    """

allow_all_unix_sockets class-attribute instance-attribute

allow_all_unix_sockets: bool | None = Field(None, alias='allowAllUnixSockets')

Allow all Unix domain socket connections. If true, this overrides allowUnixSockets. See https://code.claude.com/docs/en/sandboxing#network-isolation

allow_local_binding class-attribute instance-attribute

allow_local_binding: bool | None = Field(None, alias='allowLocalBinding')

Allow binding to local network addresses (e.g., localhost ports). Defaults to false if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation

allow_mach_lookup class-attribute instance-attribute

allow_mach_lookup: list[AllowMachLookupItem] | None = Field(
    None, alias="allowMachLookup", examples=[["com.apple.coresimulator.*"]]
)

macOS only. Additional XPC/Mach service names the sandbox may look up. Supports a single trailing * for prefix matching. Needed for tools that communicate via XPC such as the iOS Simulator or Playwright. See https://code.claude.com/docs/en/sandboxing#network-isolation

allow_managed_domains_only class-attribute instance-attribute

allow_managed_domains_only: bool | None = Field(None, alias='allowManagedDomainsOnly')

(Managed settings only) Only allowedDomains and WebFetch(domain:...) allow rules from managed settings are respected. User, project, local, and flag settings domains are ignored. Denied domains are still respected from all sources. Non-allowed domains are automatically blocked without user prompts. See https://code.claude.com/docs/en/sandboxing#network-isolation

allow_unix_sockets class-attribute instance-attribute

allow_unix_sockets: list[str] | None = Field(None, alias='allowUnixSockets')

Allow Unix domain sockets for local IPC (SSH agent, Docker, etc.). Provide an array of specific paths. Defaults to blocking if not specified. See https://code.claude.com/docs/en/sandboxing#network-isolation

allowed_domains class-attribute instance-attribute

allowed_domains: list[AllowedDomain] | None = Field(None, alias='allowedDomains')

Allowlist of network domains for sandboxed commands. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation

denied_domains class-attribute instance-attribute

denied_domains: list[DeniedDomain] | None = Field(None, alias='deniedDomains')

Blocklist of network domains for sandboxed commands. Blocks specific domains even when a broader allowedDomains wildcard would otherwise permit them. Supports wildcard patterns like *.example.com. See https://code.claude.com/docs/en/sandboxing#network-isolation

http_proxy_port class-attribute instance-attribute

http_proxy_port: int | None = Field(None, alias='httpProxyPort', ge=1, le=65535)

HTTP proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration

socks_proxy_port class-attribute instance-attribute

socks_proxy_port: int | None = Field(None, alias='socksProxyPort', ge=1, le=65535)

SOCKS proxy port to use for network filtering. If not specified, a proxy server will be started automatically. See https://code.claude.com/docs/en/sandboxing#custom-proxy-configuration

strict_allowlist class-attribute instance-attribute

strict_allowlist: bool | None = Field(None, alias='strictAllowlist')

UNDOCUMENTED. Deny non-allowlisted hosts for sandboxed commands without prompting (added v2.1.219). See https://code.claude.com/docs/en/sandboxing#network-isolation

tls_terminate class-attribute instance-attribute

tls_terminate: TlsTerminate | None = Field(None, alias='tlsTerminate')

Experimental. Terminate TLS inside the sandbox proxy so it can read the contents of HTTPS requests. Required for mask credential substitution. Set {} to generate an ephemeral certificate authority for the session, or set caCertPath and caKeyPath to use your own. Only honored from user, managed, or CLI --settings settings, not from .claude/settings.json or .claude/settings.local.json. Requires Claude Code v2.1.199 or later. See https://code.claude.com/docs/en/sandboxing#protect-credentials

:fa-brands-github: Show source on GitHub