Skip to content

feat(sandbox-mgmt): phase 1 MVP — shields, config get, audit logging#1849

Draft
ericksoa wants to merge 9 commits intomainfrom
feat/sandbox-management-commands
Draft

feat(sandbox-mgmt): phase 1 MVP — shields, config get, audit logging#1849
ericksoa wants to merge 9 commits intomainfrom
feat/sandbox-management-commands

Conversation

@ericksoa
Copy link
Copy Markdown
Contributor

Summary

Draft implementation of Phase 1 MVP from the Sandbox Management
Commands RFC
(v0.1, 2026-04-13). Ready to circulate alongside the
RFC for review — merge blocked until the RFC is finalized.

What's implemented

  • nemoclaw shields down/up/status — time-bounded policy
    relaxation with auto-restore timer, policy snapshot capture,
    and append-only JSONL audit trail
  • nemoclaw config get — read-only sandbox config inspection
    with credential redaction and dotpath extraction
  • /nemoclaw shields — read-only shields status slash command
  • /nemoclaw config — read-only config display slash command

Security invariants enforced

  • Sandbox never writes its own config (slash commands read-only)
  • Sandbox never lowers its own shields (host-initiated only)
  • Credentials never appear in CLI output, logs, or audit trails
  • Shields-down always time-bounded (max 30 minutes)
  • Policy restore uses exact captured snapshot, not assumed default

New files

Path Purpose
src/lib/shields.ts Host CLI shields logic
src/lib/shields-timer.ts Detached auto-restore process
src/lib/shields-audit.ts JSONL audit logger
src/lib/duration.ts Duration parser (5m, 30m)
src/lib/sandbox-config.ts Host CLI config get
src/lib/credential-strip.ts Shared credential stripping
nemoclaw/src/commands/shields-status.ts Slash command
nemoclaw/src/commands/config-show.ts Slash command

Open RFC questions (not blocking this draft)

  1. Timer reliability on host reboot (Phase 2)
  2. Per-sandbox state files for multi-sandbox (Phase 2)
  3. Named policy tiers: network-only, fs-only (Phase 2)
  4. Config schema versioning location

Test plan

  • 59 new tests across 7 test files — all passing
  • Plugin builds cleanly (tsc --noEmit)
  • CLI type-checks (tsconfig.cli.json)
  • All pre-commit/pre-push hooks pass
  • E2E: shields down/up cycle against live sandbox
  • E2E: config get from running sandbox

ericksoa and others added 5 commits April 13, 2026 06:15
…NEMOCLAW_PREFERRED_API override

Backends like SGLang expose /v1/responses and pass the existing non-streaming
validation probe, but their streaming mode only emits lifecycle events
(created/in_progress/completed) without the granular content deltas OpenClaw
requires (output_text.delta, etc.). This causes runtime failures after
onboarding succeeds.

Changes:
- Add runStreamingEventProbe() in http-probe.ts that sends a stream:true
  request and verifies the SSE event stream includes response.output_text.delta
- Integrate the streaming probe into probeOpenAiLikeEndpoint for custom
  endpoints (probeStreaming: true) — falls back to /chat/completions when
  streaming events are incomplete
- Add shouldForceCompletionsApi() in validation.ts checking
  NEMOCLAW_PREFERRED_API env var so users can bypass /responses entirely
- Wire both into validateCustomOpenAiLikeSelection
- Add unit tests for the new functions (11 new test cases)
- Document NEMOCLAW_PREFERRED_API, the NEMOCLAW_INFERENCE_API_OVERRIDE
  workaround, and a troubleshooting entry for the runtime failure scenario

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
…file ARG precedence

NEMOCLAW_INFERENCE_API_OVERRIDE only patches openclaw.json at container
startup — it does not update the Dockerfile ARG baked into the image. On
recreate-sandbox the baked value wins. The reliable fix is a fresh
nemoclaw onboard which re-probes and rebakes the image.

Updated all three doc pages to recommend nemoclaw onboard instead of the
override env var, and added a note explaining the limitation.

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
- Distinguish transport failures from missing-events in streaming probe
  fallback: only fall back to /chat/completions when missingEvents is
  non-empty; surface transport errors as hard validation failures
- Make shouldForceCompletionsApi() pure by accepting the preferred API
  value as a parameter instead of reading process.env directly, keeping
  validation.ts free of I/O per its module contract
- Fix passive voice and second-person wording in docs

Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Implements shields down/up/status, config get, and audit
logging from the Sandbox Management Commands RFC.

Security invariants enforced:
- Host-only mutations
- Credential redaction
- 30-minute max timeout
- Exact policy snapshot restore

RFC: NemoClaw Sandbox Management Commands v0.1
Signed-off-by: Test User <test@example.com>
Signed-off-by: Test User <test@example.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 377635d3-5f4b-4982-84c2-1e5376b6ee5d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/sandbox-management-commands

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🚀 Docs preview ready!

https://NVIDIA.github.io/NemoClaw/pr-preview/pr-1849/

@ericksoa ericksoa changed the title feat(sandbox-mgmt): Phase 1 MVP — shields, config get, audit logging feat(sandbox-mgmt): phase 1 MVP — shields, config get, audit logging Apr 13, 2026
ericksoa and others added 2 commits April 13, 2026 17:06
Hermes caches skill slash-commands in a module-global dict on first
scan, making skills installed after gateway startup invisible. This
adds a nemoclaw_reload_skills tool that clears the cache and re-scans,
plus auto-refresh on session start, so new skills are available without
a gateway restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Brev E2E (all): PASSED on branch feat/sandbox-management-commandsSee logs

Instance e2e-pr-1849 is still running. To SSH in:

brev refresh && ssh e2e-pr-1849

When done, delete it: brev delete e2e-pr-1849

@github-actions
Copy link
Copy Markdown

Brev E2E (all): PASSED on branch feat/sandbox-management-commandsSee logs

Instance e2e-pr-1849 is still running. To SSH in:

brev refresh && ssh e2e-pr-1849

When done, delete it: brev delete e2e-pr-1849

@github-actions
Copy link
Copy Markdown

Brev E2E (all): FAILED on branch feat/sandbox-management-commandsSee logs

Instance e2e-pr-1849 is still running. To SSH in:

brev refresh && ssh e2e-pr-1849

When done, delete it: brev delete e2e-pr-1849

@github-actions
Copy link
Copy Markdown

Brev E2E (all): PASSED on branch feat/sandbox-management-commandsSee logs

Instance e2e-pr-1849 is still running. To SSH in:

brev refresh && ssh e2e-pr-1849

When done, delete it: brev delete e2e-pr-1849

@wscurran wscurran added security Something isn't secure priority: high Important issue that should be resolved in the next release NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). enhancement: feature Use this label to identify requests for new capabilities in NemoClaw. labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement: feature Use this label to identify requests for new capabilities in NemoClaw. NemoClaw CLI Use this label to identify issues with the NemoClaw command-line interface (CLI). priority: high Important issue that should be resolved in the next release security Something isn't secure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants