[All Platforms][Security] Hermes gateway accepts raw SLACK_BOT_TOKEN env without security rejection in NemoHermes sandbox
Component
- Product: NemoClaw / NemoHermes integration
- Area: Hermes gateway startup env validation (runtime secrets guard)
Environment
- Host: DGX Spark
- NemoClaw / NemoHermes version: v0.0.60
- Hermes container:
openshell-hermes-…(ID fromdocker ps) - Inside container:
- Hermes CLI:
/usr/local/bin/hermes - Hermes source:
/opt/hermes(no/opt/hermes/start.shpresent)
- Hermes CLI:
Summary
The NemoHermes security test plan expects Hermes gateway startup to refuse raw secret-shaped env vars (e.g. SLACK_BOT_TOKEN=xoxb-real-1234567890) with a [SECURITY] message and non-zero exit. In the current NemoHermes sandbox, starting the gateway via hermes gateway run with such an env var produces no security warnings or rejections; the process starts normally, and /tmp/hermes-runtime.log contains no [SECURITY] lines.
Steps to Reproduce
1. Identify the Hermes container:
HERMES_CONTAINER=$(docker ps -q --filter name=openshell-hermes)
echo "$HERMES_CONTAINER"
# Example: 160da56dc993
2. Ensure Hermes gateway is not currently running:
docker exec -u sandbox "$HERMES_CONTAINER" pgrep -fl 'hermes gateway' || echo "no hermes gateway"
3. Start Hermes gateway inside the container with a raw Slack-shaped token in the environment (no real token required):
docker exec -u sandbox \
-e HOME=/sandbox \
-e SLACK_BOT_TOKEN=xoxb-real-1234567890 \
"$HERMES_CONTAINER" \
hermes gateway run 2>&1 | head -40 | tee /tmp/hermes-runtime.log
Let it print some output, then interrupt with Ctrl+C.
4. Inspect the captured log for security messages:
cat /tmp/hermes-runtime.log
grep -F "[SECURITY]" /tmp/hermes-runtime.log || echo "no SECURITY rejection found"
Result:
no SECURITY rejection found
No [SECURITY] lines and no mention of SLACK_BOT_TOKEN in the log, despite the env containing a secret-shaped value.
Expected Behavior
When launching hermes gateway with a raw token like SLACK_BOT_TOKEN=xoxb-real-1234567890 in the environment:
- Startup should be refused with a clear
[SECURITY]message, e.g.:[SECURITY] Refusing Hermes startup because raw secret-shaped values are present in the runtime environment [SECURITY] SLACK_BOT_TOKEN - Hermes gateway should exit with a non-zero status and must not bind its port.
- Only allow-listed keys (such as
OPENCLAW_GATEWAY_TOKEN) and placeholder forms (xoxb-OPENSHELL-RESOLVE-ENV-*) should be accepted without security warnings.
Actual Behavior
Running hermes gateway run with SLACK_BOT_TOKEN=xoxb-real-1234567890 and HOME=/sandbox:
docker exec -u sandbox \
-e HOME=/sandbox \
-e SLACK_BOT_TOKEN=xoxb-real-1234567890 \
"$HERMES_CONTAINER" \
hermes gateway run 2>&1 | head -40 | tee /tmp/hermes-runtime.log
grep -F "[SECURITY]" /tmp/hermes-runtime.log || echo "no SECURITY rejection found"
Yields:
no SECURITY rejection found
The gateway starts (or attempts to start) with the raw, secret-shaped env var. There is no [SECURITY] message and no mention of SLACK_BOT_TOKEN in the startup output. This contradicts the test specification that raw secret-shaped values in the runtime environment should cause Hermes startup to be refused and logged as a security event.
Notes / Related Gaps
- The original NemoHermes test steps reference
/opt/hermes/start.shand--dry-validate-only, but this NemoHermes image does not provide that script, andhermes gatewaydoes not support--dry-run. Only thehermesCLI and itsgatewaysubcommand are available. - Earlier attempts using
hermes gatewaywithoutHOME=/sandboxfailed with aPermissionErroron/root/.hermes/.env, which is not mentioned in the test plan (it assumes a differentHOME/ownership layout for Hermes state). - These discrepancies suggest the current NemoHermes integration and Hermes build do not yet implement the documented "runtime env secret guard" path, or implement it only for a different entrypoint.
Confirmed and fixed in #4981.
Root cause: the runtime-env secret boundary is enforced by the nemoclaw-start entrypoint (and the host-side recovery path), but not by the hermes gateway command itself, so a direct docker exec … hermes gateway run bypasses it — matching the "implemented only for a different entrypoint" note here.
The PR wraps the hermes CLI so the existing validator runs for the gateway subcommand regardless of how it is invoked; all other subcommands are unaffected. Verified on Ubuntu 24.04 that this exact repro is now refused (non-zero exit, [SECURITY], gateway never starts) while legitimate placeholder-based startup is unchanged.
✨ Related open PRs:
Verified on v0.0.63, closing the bug.
local-mercl@2u2g-gen-0690:~$ HERMES_CONTAINER=$(docker ps -q --filter name=openshell-my-hermes) local-mercl@2u2g-gen-0690:~$ echo $HERMES_CONTAINER f8a1c53f9b7b local-mercl@2u2g-gen-0690:~$ docker exec -u sandbox "$HERMES_CONTAINER" pgrep -fl 'hermes gateway' || echo "no hermes gateway" no hermes gateway
local-mercl@2u2g-gen-0690:~$ docker exec -u sandbox \ -e HOME=/sandbox \ -e SLACK_BOT_TOKEN=xoxb-real-1234567890 \ "$HERMES_CONTAINER" \ hermes gateway run 2>&1 | head -40 | tee /tmp/hermes-runtime.log Error response from daemon: No such container: -e
local-mercl@2u2g-gen-0690:~$ docker exec -u sandbox -e HOME=/sandbox -e SLACK_BOT_TOKEN=xoxb-real-1234567890 "$HERMES_CONTAINER" hermes gateway run 2>&1 | head -40 | tee /tmp/hermes-runtime.log [SECURITY] Refusing Hermes startup because the process environment contains raw secret-shaped values. Store credentials in OpenShell providers and keep only openshell resolver placeholders in the sandbox. [SECURITY] SLACK_BOT_TOKEN
local-mercl@2u2g-gen-0690:~$ cat /tmp/hermes-runtime.log | grep -F "[SECURITY]" /tmp/hermes-runtime.log || echo "no SECURITY rejection found" [SECURITY] Refusing Hermes startup because the process environment contains raw secret-shaped values. Store credentials in OpenShell providers and keep only openshell resolver placeholders in the sandbox. [SECURITY] SLACK_BOT_TOKEN local-mercl@2u2g-gen-0690:~$