Skip to content

fix(claude): let sandboxed tools verify TLS and run Terraform plugins - #119

Merged
0xA3B merged 2 commits into
mainfrom
fix/claude-sandbox-tls
Nov 11, 2026
Merged

0xA3B merged 2 commits into
mainfrom
fix/claude-sandbox-tls

Conversation

@0xA3B

@0xA3B 0xA3B commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Sandboxed commands could not verify TLS through macOS's Security.framework, and Terraform tooling
could not download providers or start its plugins inside the sandbox.

Solution

  • enableWeakerNetworkIsolation lets sandboxed commands reach the macOS trust service,
    com.apple.trustd.agent. Without it, Go tools such as gh, and other clients that verify TLS
    through Security.framework, fail with x509: OSStatus -26276. Sandboxed gh therefore no longer
    needs SSL_CERT_FILE. The user instructions now tell the agent to rerun any tool, not only gh,
    outside the sandbox when it hits that error.
  • The network allowlist adds registry.terraform.io and releases.hashicorp.com.
    allowUnixSockets allows Unix sockets only in ~/.cache/terraform-tmp, the directory that
    projects use as TMPDIR for Terraform and TFLint, whose plugins handshake over a socket.

Review notes

  • The trust service is a data path outside the sandbox's network proxy. The settings comment records
    that trade-off.
  • Both keys appear in the published Claude Code settings schema. Inside a sandbox that already has
    these settings, a socket binds and connects in ~/.cache/terraform-tmp but not in ~/.cache, so
    the ~ expands. Sandboxed gh api succeeds with SSL_CERT_FILE unset.

…ervice

The sandbox blocked com.apple.trustd.agent, so every client that verifies TLS
through Security.framework failed with x509: OSStatus -26276 unless it ran
unsandboxed or had SSL_CERT_FILE set. enableWeakerNetworkIsolation allows the
trust service, at the cost of a path outside the network proxy.
…dbox

Terraform and TFLint fetch providers from registry.terraform.io and
releases.hashicorp.com, and their plugins handshake over a Unix socket in
TMPDIR. Projects point TMPDIR at ~/.cache/terraform-tmp for those tools, so
the sandbox allows sockets in that one directory.
@0xA3B
0xA3B force-pushed the fix/claude-sandbox-tls branch from d46cba1 to 4ad26a7 Compare November 11, 2026 00:41
@0xA3B
0xA3B merged commit 575eafc into main Nov 11, 2026
2 checks passed
@0xA3B
0xA3B deleted the fix/claude-sandbox-tls branch November 11, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant