Skip to content

Commit 5499d25

Browse files
dvdksnclaude
andauthored
docs: add internal CA sandbox troubleshooting (#25198)
## Summary Add troubleshooting guidance for Docker Sandboxes users whose internal HTTPS inspection proxy requires a custom CA certificate inside the sandbox. The section covers repeatable setup with a sandbox kit, one-off setup for existing sandboxes, Node.js CA configuration, and policy log diagnostics. Generated by Codex --------- Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 40eb1f7 commit 5499d25

2 files changed

Lines changed: 92 additions & 0 deletions

File tree

content/manuals/ai/sandboxes/customize/kit-examples.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,44 @@ step should run as the agent user — for example, `npm install -g`
7272
against a user-scoped prefix, or anything that writes to
7373
`/home/agent/`.
7474

75+
## Install an internal CA certificate
76+
77+
If your organization uses a proxy that inspects HTTPS traffic, install
78+
the proxy's internal root CA in the sandbox trust store. This helps
79+
agents and SDKs trust certificates signed by the proxy.
80+
81+
```text
82+
internal-ca/
83+
├── spec.yaml
84+
└── files/
85+
└── home/
86+
└── internal-ca.crt
87+
```
88+
89+
Use a PEM-encoded certificate with a `.crt` extension. Files under
90+
`files/home/` land in `/home/agent/` in the sandbox, so
91+
`files/home/internal-ca.crt` becomes `/home/agent/internal-ca.crt` —
92+
which is the path the install command reads from. If traffic can be
93+
signed by more than one internal proxy, include each proxy's root CA in
94+
the kit and install each certificate before running
95+
`update-ca-certificates`.
96+
97+
```yaml {title="internal-ca/spec.yaml"}
98+
schemaVersion: "1"
99+
kind: mixin
100+
name: internal-ca
101+
102+
commands:
103+
install:
104+
- command: "install -m 0644 /home/agent/internal-ca.crt /usr/local/share/ca-certificates/internal-ca.crt && update-ca-certificates"
105+
user: "0"
106+
description: Install internal CA certificate
107+
```
108+
109+
`update-ca-certificates` adds the certificate to the system trust
110+
store, so tools and SDKs that read the system bundle trust the proxy's
111+
certificates without further configuration.
112+
75113
## Run a background service
76114

77115
<!-- TODO: follow up on commands.startup[].background.

content/manuals/ai/sandboxes/troubleshooting.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,60 @@ configured to use the forward proxy. See
109109
[Monitoring network activity](governance/monitoring.md)
110110
for details.
111111

112+
## API calls fail with a certificate error
113+
114+
If your organization uses a proxy that inspects HTTPS traffic, agent requests
115+
can fail with a certificate error such as
116+
`SSL certificate problem: self-signed certificate in certificate chain`. Install
117+
your organization's internal root CA inside the sandbox so the agent and its
118+
SDKs trust certificates signed by the proxy. Certificate errors can stop a
119+
request before the credential proxy can inject credentials.
120+
121+
For repeatable setup, create a [sandbox kit](customize/kits.md) that installs
122+
the CA when the sandbox is created. See
123+
[Install an internal CA certificate](customize/kit-examples.md#install-an-internal-ca-certificate)
124+
for an example kit.
125+
126+
Use a PEM-encoded certificate with a `.crt` extension. If traffic can be signed
127+
by more than one internal proxy, install each proxy's root CA before running
128+
`update-ca-certificates`.
129+
130+
Create a sandbox with the kit:
131+
132+
```console
133+
$ sbx run claude --kit ./internal-ca/
134+
```
135+
136+
To update an existing sandbox, copy the certificate into the sandbox and update
137+
the trust store:
138+
139+
```console
140+
$ sbx cp ./internal-ca.crt <sandbox-name>:/tmp/internal-ca.crt
141+
$ sbx exec <sandbox-name> -- sudo install -m 0644 /tmp/internal-ca.crt /usr/local/share/ca-certificates/internal-ca.crt
142+
$ sbx exec <sandbox-name> -- sudo update-ca-certificates
143+
```
144+
145+
> [!IMPORTANT]
146+
> Install the CA into the system trust store with `update-ca-certificates`, as
147+
> shown above. Don't override the sandbox's TLS trust variables (such as
148+
> `SSL_CERT_FILE`) to point at only your internal CA. Doing so replaces the
149+
> system bundle
150+
> and breaks the trust the credential proxy depends on, so requests on the
151+
> `forward` egress path fail.
152+
153+
If API calls still fail after installing the CA, run `sbx policy log` and check
154+
the egress path in the **PROXY** column:
155+
156+
- `forward`: the credential proxy terminates TLS and presents its own
157+
certificate, which the sandbox already trusts. Requests on this path don't
158+
need the internal CA, and overriding the sandbox's trust variables breaks
159+
them, as described above.
160+
- `forward-bypass` and `transparent`: the proxy forwards packets to the
161+
upstream proxy without terminating TLS, so the sandbox sees your
162+
organization's certificate directly. These paths are where installing the
163+
internal CA applies. The only difference between them is whether the client
164+
knows it's talking to a proxy.
165+
112166
## Docker build export fails with an ownership error
113167

114168
Running `docker build` with the local exporter (`--output=type=local` or `-o

0 commit comments

Comments
 (0)