Skip to content

Commit 92a4a9d

Browse files
dvdksnclaude
andcommitted
sandboxes: document accessing host services via host.docker.internal
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 8adfb60 commit 92a4a9d

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

content/manuals/ai/sandboxes/troubleshooting.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ To allow all outbound traffic instead:
3434
$ sbx policy allow network "**"
3535
```
3636

37+
## Can't reach a service running on the host
38+
39+
If a request to `127.0.0.1` or a local network IP returns "connection refused"
40+
from inside a sandbox, the address is not routable from within the sandbox VM.
41+
See [Accessing host services from a sandbox](usage.md#accessing-host-services-from-a-sandbox).
42+
3743
## Docker authentication failure
3844

3945
If you see a message like `You are not authenticated to Docker`, your login

content/manuals/ai/sandboxes/usage.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,26 @@ A few things to keep in mind:
298298
must use `--unpublish 8080:3000`. Run `sbx ports my-sandbox` first if you
299299
used an ephemeral port and need to find the assigned host port.
300300

301+
## Accessing host services from a sandbox
302+
303+
Services running on your host are reachable from inside a sandbox using the
304+
hostname `host.docker.internal`.
305+
Use this instead of `127.0.0.1` or your machine's local network IP address,
306+
which are not routable from inside the sandbox.
307+
308+
You must also add `host.docker.internal` to your network policy allowlist:
309+
310+
```console
311+
$ sbx policy allow network host.docker.internal
312+
```
313+
314+
Then use `host.docker.internal` in any configuration or request that points at
315+
the host service. For example, to verify connectivity from a sandbox shell:
316+
317+
```console
318+
$ curl http://host.docker.internal:11434
319+
```
320+
301321
## What persists
302322

303323
While a sandbox exists, installed packages, Docker images, configuration

0 commit comments

Comments
 (0)