Repository navigation
Description
Description
The in-sandbox openclaw channels add/remove denial-hint guard (scripts/nemoclaw-start.sh, hardened by the PR that added the host-side hint) renders the sandbox-name token as the literal placeholder <name> instead of the actual sandbox name, in the interactive nemoclaw <sandbox> connect shell — the primary place the hint fires. The user gets:
Run 'nemoclaw <name> channels add discord' on the host.
instead of Run 'nemoclaw <sandbox> channels add discord' on the host., so the copyable host command still does not carry the real sandbox name. This defeats the usability goal of the hint (users/CI could not determine the correct host-side command from generic tokens).
Root cause
_nemoclaw_policy_denial_hint_label() reads $OPENSHELL_SANDBOX and allowlists it — it only renders the value when it matches a valid sandbox-name pattern (lowercase RFC-1035 label), else falls back to <name>. OpenShell ≥ 0.0.44 is expected to set OPENSHELL_SANDBOX to the sandbox name, and does so at the container level, but in the interactive connect shell OPENSHELL_SANDBOX is the boolean 1, which fails the allowlist and falls back to <name>.
The security hardening itself works — the operation token (add/remove verbatim, else <operation>) and channel token (discord/slack/teams/telegram/wechat/whatsapp verbatim, else <channel>) are allowlisted correctly, and hostile input does not leak (e.g. openclaw channels add "$(cat /etc/shadow)" renders <channel>, no file content). Only the sandbox-name rendering is affected.
Platform scope: Reproduced on DGX Station GB300 (aarch64, Ubuntu 24.04) with NemoClaw v0.0.96 + OpenShell 0.0.85 only; not believed platform-specific (connect-shell env behavior).
Regression: Unknown — this is the name-rendering half of the in-sandbox channels denial-hint hardening.
Environment
Device: DGX Station GB300
OS: Ubuntu 24.04.4 LTS
Architecture: aarch64
Node.js: v22.23.1
Docker: 29.6.1
OpenShell CLI: 0.0.85
NemoClaw: v0.0.96
OpenClaw: 2026.7.1
Steps to Reproduce
- Onboard an OpenClaw sandbox
<sandbox>. nemoclaw <sandbox> connect- Inside the sandbox shell:
openclaw channels add discord - Observe the sandbox-name token in the denial hint. Compare the env:
- inside the connect shell:
echo $OPENSHELL_SANDBOX→1 - at the container level:
docker exec <container> bash -lc 'echo $OPENSHELL_SANDBOX'→<sandbox>
- inside the connect shell:
Expected Result
The hint renders the real, validated sandbox name: Run 'nemoclaw <sandbox> channels add discord' on the host.
Actual Result
Error: 'openclaw channels add' cannot modify channels inside the sandbox.
Changes inside the sandbox do not persist across rebuilds.
Run 'nemoclaw <name> channels add discord' on the host.
<name> is the literal placeholder — it appears for every add/remove because OPENSHELL_SANDBOX is 1 in the connect shell.
Activity
yanyunl1991 commentedon Jul 29, 2026
Thanks for the report — reproduced and fixed on my side. One correction to the diagnosis, since it changes where the fix has to live.
Root cause
The hint helper reads
OPENSHELL_SANDBOX, and the premise that OpenShell >= 0.0.44 makes the sandbox name available in-sandbox does not hold. OpenShell records the name on the container, but every process it spawns inside the sandbox gets a rebuilt environment in which the variable is the boolean1— thenemoclaw-startentrypoint included, not just the connect shell. Measured on our DGX Spark aarch64 test host (GB10 GPU) against a sandbox freshly onboarded frommain:The real value survives only in the sandbox supervisor's own PID 1 environment, which is root-owned; the entrypoint runs as the unprivileged
sandboxuser and getsEACCESon/proc/1/environ. The container hostname is the container ID, and no other in-container source carries the name. So the name was genuinely unavailable inside the sandbox, and the allowlist was correctly rejecting1— as you noted, the hardening itself is fine.That also means the same defect affected the other consumer of the helper, the policy-denial logs breadcrumb, which rendered
nemoclaw <name> logs --tail 50in connect shells too. Both hints' tests passed only because they setOPENSHELL_SANDBOXto a name directly, which never happens in a real connect shell.Fix
NEMOCLAW_SANDBOX_NAMEis an existing documented variable already injected into the sandbox startup command, but only for the deepagents image. It is now injected for every sandbox, carrying the host's already-validated name, and the entrypoint bakes it into the generated connect-shell env for the renderer to fall back to.OPENSHELL_SANDBOXkeeps priority when it does carry a usable name. The value is allowlisted against the same RFC-1123 pattern at both the bake and the render site, and the generator always emits either the export or an explicit unset, so nothing the sandbox sets itself can reach a copyable command. The operation and channel token allowlists are untouched.After the fix, in the same connect shell:
The third line is
openclaw channels add "$(cat /etc/shadow)"— the channel token still degrades to<channel>and no file content reaches the command.PR
#7802
Will land after CI is green and maintainer review. To try it locally:
git fetch origin fix/connect-shell-sandbox-label-7795 && git checkout fix/connect-shell-sandbox-label-7795, then re-run the original scenario. Note that the sandbox must be recreated or rebuilt for the new value to be injected.Verified on aarch64 only. You mention this is not believed platform-specific and the mechanism is connect-shell environment behavior rather than architecture, but if you can confirm on x86_64 that would close the gap.
If the symptom doesn't match what you saw, or you can still reproduce after this lands, reply here and I'll take another look.
fix(sandbox): name the sandbox in in-sandbox host-side hints (NVIDIA#…