Skip to content

feat(sandbox): support --cap-drop / capability scoping on sandbox create #1452

Closed

Description

@cjagwani

Summary

Requesting support for --cap-drop (or equivalent capability-set scoping) on openshell sandbox create so consumers can reduce the OCI bounding set of sandbox containers at creation time.

Context

NemoClaw isolates agents inside OpenShell sandboxes and drops dangerous capabilities from the agent process tree via capsh + setpriv in its entrypoint (NemoClaw PRs #3328 + #3329). That hardens the agent code path but does NOT reduce the container's OCI bounding set itself.

When users nemoclaw sandbox connect, the runtime spawns a shell outside the agent process tree. That shell sees the container's OCI bounding set, which still contains:

  • CAP_SYS_ADMIN
  • CAP_NET_RAW
  • CAP_NET_BIND_SERVICE
  • CAP_SYS_PTRACE
  • CAP_DAC_OVERRIDE
  • CAP_FOWNER
  • CAP_SETUID
  • CAP_SETGID

Verified from inside a v0.0.43 sandbox with capsh --print: NVIDIA/NemoClaw#3280

Why NemoClaw can't fix this alone

openshell sandbox create doesn't accept --cap-drop or any capability-scoping flag, and the OpenShell policy schema has no capability section. The OCI bounding set is set by OpenShell at container-create time, so NemoClaw has no way to reduce it.

Asks

One of:

  1. --cap-drop / --cap-add flags on openshell sandbox create — matches Docker semantics, smaller surface change
  2. capabilities: section in the OpenShell policy schema with allow/drop lists translated to the OCI bounding set at container-create time — more declarative, tracks better with existing policy-driven model

Either works for NemoClaw's use case.

Consumer / blocker

NemoClaw issue #3280 (priority: high, NV QA) is blocked on this. Scope is shell-scope cap tightening for sandbox connect shells.

Activity

  1. cjagwani commented on Jun 11, 2026

    @cjagwani
    ContributorAuthor

    Hey OpenShell team, pinging this for visibility. NemoClaw issue #3280 is partially blocked on this.

    NemoClaw can drop dangerous bounding-set caps from the agent process tree via setpriv/capsh --drop when CAP_SETPCAP is available. On hosts where the container's create-time bounding set lacks CAP_SETPCAP (Colossus Ubuntu 24.04, Docker Desktop on Windows, WSL), no in-container drop is possible. That leaves dangerous caps visible to anything that exec's into the sandbox, which our QA team flagged as a security regression.

    The only fix is --cap-drop (or a capabilities: policy section) at openshell sandbox create time, which is what this issue tracks.

    Is this on the roadmap? Happy to open a PR if you can sketch the desired shape (CLI flag vs policy YAML, defaults). I have the implementation bandwidth and the QA repro to validate against.

  2. added and removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Jun 12, 2026
  3. johntmyers commented on Jun 12, 2026

    @johntmyers
    Collaborator

    @alangou Could you take a look at this? Sounds like we have some privilege-regain risk we need to classify. Not sure if a user-facing flag is the right approach here, mostly because I don't know if there is a use case where we should allow these caps to be available for exec sessions.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions