Skip to content

feat(dcode): allow explicit thread-scoped autorun in managed sandboxes #6478

Description

@jyaunches

Problem Statement

NemoClaw v0.0.77 intentionally disables Deep Agents Code's upstream thread-wide auto-approval behavior. In an interactive dcode session, selecting Auto-approve for this thread displays:

Auto-approval is disabled in NemoClaw-managed sandboxes.

The restriction is enforced in several places: the TUI approval menu, application toggle handlers, CLI argument parsing, the managed wrapper, and direct-module execution. As a result, a user must manually approve every tool-call batch even after explicitly choosing auto-approval.

This prevents Deep Code from running sustained, interactive autonomous workflows such as repository research, implementation, and verification that require multiple rounds of shell and network tool calls. The existing dcode -n path is not an equivalent workaround: it is a one-shot headless boundary that auto-approves non-shell tools while shell execution remains disabled.

The managed posture should remain safe by default, but users should be able to make an explicit, informed choice to enable thread-scoped autorun inside an OpenShell sandbox. OpenShell policy, network controls, credential isolation, and the other NemoClaw-managed Deep Code restrictions should remain in force.

Proposed Design

Add a NemoClaw-managed Deep Code auto-approval capability with two modes:

  • disabled — current behavior and the default.
  • thread-opt-in — allows the user to select Deep Agents Code's upstream Auto-approve for this thread action after an explicit warning/confirmation.

In thread-opt-in mode:

  1. Auto-approval applies only to the current Deep Code thread/session and is not silently persisted across sessions or rebuilds.
  2. The TUI status bar must clearly indicate that auto-approval is active.
  3. NemoClaw should present a warning that tool calls, including shell commands, may execute without further confirmation inside the sandbox.
  4. OpenShell remains the enforcement boundary for filesystem/process isolation, network policy, and credential mediation.
  5. All unrelated managed restrictions remain unchanged: managed inference routing, credential-store rejection, update/install blocking, MCP projection integrity, model/rubric restrictions, nested sandbox restrictions, interpreter/startup-command blocking, hooks restrictions, and observability controls.

The capability should be controlled through a NemoClaw-owned setting rather than an ambient sandbox environment variable. A root-owned runtime capability file or equivalent host-generated managed projection would prevent an untrusted child process from silently enabling it. The exact host CLI surface can be finalized during design, but it should support inspecting and explicitly changing the mode for a named Deep Code sandbox.

Areas that need updates

Managed Deep Agents Code patch

  • agents/langchain-deepagents-code/patch-managed-deepagents-code.py
    • Conditionalize the --auto-approve parser rejection and forced args.auto_approve = False assignment.
    • Conditionalize the overrides for DeepAgentsApp._on_auto_approve_enabled and DeepAgentsApp.action_toggle_auto_approve.
    • Allow ApprovalMenu._handle_selection option 1 to invoke upstream behavior only when the managed capability is enabled.
    • Keep the fail-closed behavior when the capability is absent, malformed, or unreadable.

Wrapper and runtime capability

  • agents/langchain-deepagents-code/dcode-wrapper.sh
    • Conditionalize rejection of -y / --auto-approve based on the managed capability.
  • agents/langchain-deepagents-code/managed-dcode-runtime.py
    • Validate and expose the root-owned auto-approval capability to patched Python entrypoints.
  • agents/langchain-deepagents-code/Dockerfile, dcode-launcher.sh, and start.sh
    • Install and propagate the root-owned default capability without trusting ambient environment overrides.
  • Host-side sandbox configuration/state
    • Add a supported command or configuration path to inspect and change the capability for a Deep Code sandbox.
    • Define whether changing it requires a sandbox restart or rebuild.

Tests

  • Update test/langchain-deepagents-code-direct-module-patch.test.ts to cover both disabled and enabled modes.
  • Update test/langchain-deepagents-code-managed-entrypoints.test.ts for conditional -y / --auto-approve behavior.
  • Update image/patch shape tests so upstream drift still fails closed.
  • Add a TUI-level regression test proving that Auto-approve for this thread remains denied by default and activates only in thread-opt-in mode.
  • Add live/E2E coverage showing that autorun can execute repeated shell and non-shell tool rounds while OpenShell network and credential policies are still enforced.

Documentation and security review

  • Update the Deep Agents Code quickstart and security best practices with the new mode, warning, scope, and rollback instructions.
  • Update the model capability audit to distinguish interactive manual approval, interactive thread autorun, and headless dcode -n.
  • Document the threat-model decision: auto-approval removes the inner human confirmation layer but does not disable OpenShell enforcement.
  • Include the change in release notes because it changes a security-sensitive default/opt-in boundary.

Brev/launchable validation

  • No launchable terminal transport change should be required because the launchable already invokes plain dcode.
  • Rebuild the Deep Code sandbox image and launchable machine image after the NemoClaw change.
  • Validate the setting from the embedded launchable terminal, including status display, session-only behavior, and reset on a new thread/session.

Acceptance Criteria

  • Fresh and upgraded Deep Code sandboxes continue to deny thread-wide auto-approval by default.
  • An operator can explicitly enable thread-opt-in for a named Deep Code sandbox through a supported NemoClaw interface.
  • After enabling it, selecting Auto-approve for this thread allows subsequent tool-call batches to proceed without repeated prompts for that thread.
  • Starting a new thread/session returns to manual approval unless the user explicitly opts in again.
  • Disabling the capability restores the current warning and denial behavior.
  • Managed credential, inference, MCP, update/install, model, sandbox, and OpenShell policy boundaries remain enforced in both modes.
  • The behavior works in the NemoClaw Brev launchable's embedded Deep Code terminal.

Alternatives Considered

  • Use dcode -n: insufficient for interactive, multi-turn coding workflows and intentionally disables shell execution.
  • Approve each batch manually: preserves the current posture but prevents unattended multi-step workflows.
  • Remove the NemoClaw patch entirely: too broad; it would remove the safe default and expose auto-approval through every entrypoint without a managed capability or explicit risk acknowledgment.
  • Use only an environment variable: easy to bypass or inject inside the sandbox and therefore unsuitable for a security-sensitive managed capability.

Category

Feature

Checklist

  • I searched existing issues and this is not a duplicate
  • This is a design proposal, not a "please build this" request

Activity

  1. added
    needs: triage
    on Jul 8, 2026
  2. jyaunches commented on Jul 8, 2026

    @jyaunches
    ContributorAuthor

    @wscurran, could you take a look at this request and help prioritize it for v0.0.78 / Sprint 8? The proposal keeps auto-approval disabled by default while adding an explicit, thread-scoped opt-in that preserves NemoClaw and OpenShell security controls.

  3. self-assigned this
    on Jul 8, 2026
  4. cjagwani commented on Jul 8, 2026

    @cjagwani
    Collaborator

    Progress update:

    Remaining acceptance:

    • Build and deploy a live GCP Brev launchable using the selected NemoClaw release.
    • Validate that the embedded DCode terminal reports thread-opt-in.
    • Exercise TUI activation and warning, repeated tool rounds, new-session reset, and disable/revoke.

    Keeping this issue open until that live Brev embedded-terminal acceptance is recorded. If it will not be completed for v0.0.78, the remaining work should move to v0.0.79.

  5. added
    area: sandbox
    integration: dcode
    needs: design
    and removed
    needs: triage
    on Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: sandboxintegration: dcodeneeds: design

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions