Skip to content

[All Platforms][Security] dcode startup secret detection returns exit code 0 instead of 2 when refusing to start #8137

Description

@hulynn

Description

When a raw secret-shaped value (e.g. an API key) is present in
/sandbox/.deepagents/.env, dcode correctly detects it and refuses to
start with the message "dcode: refusing to start — .env contains a
secret-shaped value in OPENAI_API_KEY." However, it returns exit code 0
instead of exit code 2.

This undermines security guardrails — callers checking exit code to
detect secret leaks will miss the rejection.

Platform scope: Reproduced on ubuntu22, ubuntu26-gpu, dgx-station;
other platforms not tested but likely same behavior
(CLI code path is platform-independent).
Regression: Yes — worked in v0.0.73 (exit code 2), broken in v0.0.81
(exit code 0).

Environment

Device:        CI runners (Ubuntu 22.04, Ubuntu 26.04, DGX Station)
OS:            Ubuntu 22.04 / Ubuntu 26.04 / DGX Station
Architecture:  x86_64
Node.js:       v22.23.1
npm:           10.9.2
Docker:        29.x
OpenShell CLI: 0.0.72
NemoClaw:      v0.0.81
OpenClaw:      N/A (dcode agent)

Steps to Reproduce

  1. Install NemoClaw v0.0.81
  2. Onboard a dcode sandbox: nemoclaw onboard --agent dcode --name test-dcode --non-interactive
  3. Write a secret-shaped value to .env:
    nemoclaw test-dcode exec -- bash -c 'echo "OPENAI_API_KEY=sk-live-XXXXXXXXXXXXX" > /sandbox/.deepagents/.env'
  4. Run: nemoclaw test-dcode exec -- bash -c 'dcode -n "Reply with PING." 2>&1; echo "EXITCODE:$?"'
  5. Observe the exit code

Expected Result

Exit code should be 2 (as observed in v0.0.73 day0 testing).
The rejection message is printed correctly, so the detection logic works
— only the exit code is wrong.

Actual Result

dcode: refusing to start — /sandbox/.deepagents/.env contains a
  secret-shaped value in OPENAI_API_KEY.
  Remove it from the environment, or use 'nemoclaw credentials' to
  register provider keys.
EXITCODE:0

The rejection message is correct but exit code is 0 instead of 2.

Logs

AssertionError: expected 'dcode: refusing to start — /sandbox/...'
  to contain 'EXITCODE:2'
  - Expected: EXITCODE:2
  + Received: dcode: refusing to start — /sandbox/.deepagents/.env
    contains a secret-shaped value in OPENAI_API_KEY.
    Remove it from the environment, or use 'nemoclaw credentials'
    to register provider keys.
    EXITCODE:0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

NV QABugs found by the NVIDIA QA Teamarea: securitySecurity controls, permissions, secrets, or hardeningintegration: dcodeLangChain Deep Code integration behaviorneeds: infoWaiting on author for missing details

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions