You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ai-sandbox-docker): close sbx review bugs A46-A54
Allow localhost on real sbx allowlists so the host proxy rewrite
does not block the tool bridge. Keep denyNetwork-only empty.
Treat more already-exists texts as a live name collision. Delete
the owned clone on that path. Do not run sbx rm.
Walk every brace in parseJsonAfterBanner. Do not treat a sandbox
already-exists as policy init success.
Fix the connectPort error after a live publish. Add the abort
listener before reading aborted. Drop the stale Task 8 comments.
Copy file name to clipboardExpand all lines: docs/sandbox/policy.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,10 +99,11 @@ Most providers leave `capabilities.network` to the harness. `sbxSandbox()` also
99
99
100
100
| TanStack `capabilities.network`| What `sbxSandbox()` writes |
101
101
| --- | --- |
102
-
| No policy and no `allowNetwork` / `denyNetwork`| If the policy list is empty, `sbxSandbox()` runs `sbx policy init deny-all`. A known adapter (`grok-build`, `claude-code`, `codex`) then writes its model API host as a per-sandbox allow on top of that deny-all. Unknown adapters stay on the machine preset. |
103
-
| No policy and `allowNetwork`| Per-sandbox allow of the model API host (when the adapter is known) plus `allowNetwork`, then apply `denyNetwork`. |
102
+
| No policy and no `allowNetwork` / `denyNetwork`| If the policy list is empty, `sbxSandbox()` runs `sbx policy init deny-all`. A known adapter (`grok-build`, `claude-code`, `codex`) then writes its model API host and `localhost` as a per-sandbox allow on top of that deny-all. Unknown adapters stay on the machine preset. |
103
+
| No policy and `allowNetwork`| Per-sandbox allow of the model API host (when the adapter is known), `localhost`, and `allowNetwork`, then apply `denyNetwork`. |
104
+
| No policy and `denyNetwork` only | Per-sandbox deny of those hosts. Allow stays empty. No auto hosts and no `localhost`. This is additive deny on the machine preset. |
104
105
|`allow`| Allow `**`, then apply `denyNetwork`. |
105
-
|`deny`| Allow only the model API host plus`allowNetwork`, then apply `denyNetwork`. |
106
+
|`deny`| Allow the model API host, `localhost`, and`allowNetwork`, then apply `denyNetwork`. |
106
107
|`ask` (or the policy `default` when `network` is unset) | Same allowlist as `deny`. The harness still asks for tools and commands. |
107
108
108
109
Auto-allowed model hosts:
@@ -114,6 +115,8 @@ Auto-allowed model hosts:
114
115
115
116
If the allowlist would be empty under `deny` or `ask`, create throws. Pass `allowNetwork`, or use `grokBuildText` / `claudeCodeText` / `codexText`.
116
117
118
+
The guest still dials `host.docker.internal` for the tool bridge. The `sbx` proxy rewrites that host to `localhost` before the policy match. `sbxSandbox()` adds `localhost` when it writes a real allowlist. It does not add `localhost` for `denyNetwork` only.
Copy file name to clipboardExpand all lines: docs/sandbox/tools.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,15 +68,24 @@ That holds in two cases and breaks in a third.
68
68
69
69
| Topology | Host the sandbox dials | Setup |
70
70
| --- | --- | --- |
71
-
| Local process / Docker |`localhost` / `host.docker.internal`| None. Works out of the box. |
72
-
| Deployed orchestrator (production) | Your public host, derived from the request | None. Works out of the box. |
71
+
| Local process |`localhost`| None. Works by default. |
72
+
| Docker container (`dockerSandbox`) |`host.docker.internal`| None. Works by default. |
73
+
| Docker Sandboxes (`sbxSandbox`) |`host.docker.internal`| The guest URL stays `host.docker.internal`. The `sbx` proxy rewrites that host to `localhost` before the policy match. A deny or ask allowlist must include `localhost`. `sbxSandbox()` adds `localhost` when it writes a real allowlist. |
74
+
| Deployed orchestrator (production) | Your public host, derived from the request | None. Works by default. |
73
75
| Remote cloud sandbox, driven from your laptop | Your laptop, which has no public URL | Tunnel the bridge with `withNgrokBridge`. |
74
76
75
-
### Local process / Docker
77
+
### Local process / Docker container
76
78
77
79
The orchestrator is the same machine as the sandbox, reached on `localhost`
78
-
(local-process) or `host.docker.internal` (Docker). Bridged tools work with no
79
-
extra configuration.
80
+
(local-process) or `host.docker.internal` (Docker container). Bridged tools
81
+
work with no extra configuration.
82
+
83
+
### Docker Sandboxes (`sbxSandbox`)
84
+
85
+
The guest still dials `host.docker.internal`. The host HTTP proxy rewrites
86
+
that host to `localhost` before it checks `sbx policy`. If you write a deny
87
+
or ask allowlist, allow `localhost` (or let `sbxSandbox()` add it).
88
+
`denyNetwork` alone does not write that allowlist.
`sbxSandbox()` needs `sbx` on `PATH`, `sbx login`, a hypervisor, and a Git repo to pass to `sbx create --clone`. See the [providers guide](https://tanstack.com/ai/latest/docs/sandbox/providers).
17
+
`sbxSandbox()` needs `sbx` on `PATH`, `sbx login`, a hypervisor, and a Git
18
+
repo to pass to `sbx create --clone`. Pass `allowNetwork` when you use a
19
+
deny or ask policy, or when you need extra hosts besides the model API host
20
+
and `localhost`. See the [providers guide](https://tanstack.com/ai/latest/docs/sandbox/providers).
'sbxSandbox: network deny/ask has an empty allowlist. Pass allowNetwork, or use grokBuildText / claudeCodeText / codexText so the model API host is added.'
15
15
16
+
/** Guest URLs use host.docker.internal; the sbx proxy rewrites that to localhost. */
0 commit comments