Skip to content

feat: introduce sandbox traits#4

Open
ericksoa wants to merge 9 commits intoNVIDIA:mainfrom
ericksoa:feat/sandbox-traits
Open

feat: introduce sandbox traits#4
ericksoa wants to merge 9 commits intoNVIDIA:mainfrom
ericksoa:feat/sandbox-traits

Conversation

@ericksoa
Copy link

@ericksoa ericksoa commented Mar 4, 2026

Summary

  • Introduces traits/ as a top-level directory for cross-cutting capabilities that compose into any sandbox
  • Moves sandboxes/capability-ratchet/traits/capability-ratchet/ (clean git mv, history preserved)
  • Adds trait.yaml manifest convention declaring exports, startup, ports, network policy, and inference routing
  • Adds TRAITS.md spec document with full usage guide and concrete openclaw example
  • Extends CI workflow to discover and build trait images (pushed to ghcr.io/.../traits/<name>)
  • Updates README.md and CONTRIBUTING.md with traits documentation

Depends on #3 — merge that first, then this PR will show only the traits changes.

What are traits?

Traits are cross-cutting capabilities you add to any sandbox — not sandboxes themselves. "Give me openclaw with capability ratcheting." Each trait ships as a Docker image; you compose it into your sandbox via COPY --from at build time.

What this does NOT do

  • No openshell sandbox create --with <trait> (OpenShell core work, future)
  • No policy merge tooling (manual for now, convention-documented)
  • No runtime trait injection (composition is build-time via Dockerfile)

Test plan

🤖 Generated with Claude Code

ericksoa and others added 4 commits March 4, 2026 13:02
Add a per-request, stateless HTTP proxy sidecar that prevents AI agent
data exfiltration by dynamically revoking capabilities when private or
untrusted data enters the conversation context.

Implementation:
- Axum 0.8 HTTP server: /v1/chat/completions proxy + /health endpoint
- Taint detection from tool results (has-private-data, has-untrusted-input)
- 2x2 revocation matrix mapping taint flags to forbidden capabilities
- Three API format normalizers: Chat Completions, Anthropic, Responses API
- bash-ast Unix socket client for AST-based command analysis
- Recursive bash -c unwrapping with shlex fallback
- OS-level sandbox rewriting (unshare --net / sandbox-exec)
- Tool analysis pipeline: capability detection, reversibility, URL extraction
- User approval flow via X-Ratchet-Approve header
- Shadow mode for log-only deployment
- Multi-stage Docker build producing a single static binary
- 44 unit and integration tests

Tech stack matches NemoClaw core: Axum, Tokio, Reqwest, serde, tracing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
Update all references across the repo from the old NemoClaw branding
to OpenShell, including Docker image names, CLI commands, config files,
documentation, and source code comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix all 38 clippy pedantic/nursery warnings (manual_let_else,
  missing_errors_doc, option_if_let_else, or_fun_call, too_many_lines,
  significant_drop_tightening, iter_on_single_items, unnecessary_wraps,
  type_complexity, needless_continue, missing_panics_doc, etc.)
- Run cargo fmt across all source files
- Fix shellcheck SC2034 warning (unused loop variable in ratchet-start.sh)
- Fix grammar: "A OpenShell" → "An OpenShell" in README
- Add #[allow(dead_code)] to unused test helper sample_config()
- Extract helpers to reduce function line counts (server.rs, normalize.rs)
- Use static defaults to avoid or_fun_call with temporary references

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ericksoa ericksoa force-pushed the feat/sandbox-traits branch from 15d2bae to eca62ed Compare March 13, 2026 14:42
- Only force stream:false on tainted requests (non-tainted pass through)
- Add force_non_streaming parameter to forward_to_backend
- Add X-Ratchet-Stream-Blocked response header when streaming is disabled
- Document why the ratchet exists vs Docker --network=none
- Add honest Limitations section to README

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ericksoa ericksoa force-pushed the feat/sandbox-traits branch from eca62ed to 59c7968 Compare March 13, 2026 15:13
ericksoa and others added 4 commits March 13, 2026 12:13
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…aits/

Traits are cross-cutting capabilities you compose into any sandbox —
not sandboxes themselves. This moves capability-ratchet from sandboxes/
to traits/ as the first trait, adds the trait.yaml manifest convention,
TRAITS.md spec, CI support for building trait images, and updates
README.md and CONTRIBUTING.md.

Depends on #3.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update all references across the repo from the old NemoClaw branding
to OpenShell, including Docker image names, CLI commands, container
registry paths, config files, documentation, and source code comments.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix wrong npm package name in TRAITS.md example (@anthropic/openclaw-cli → openclaw)
- Add SPDX license headers to TRAITS.md and traits/capability-ratchet/README.md
- Remove redundant knownSafe entries that overlap with tools declarations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ericksoa ericksoa force-pushed the feat/sandbox-traits branch from 59c7968 to 01a3f6d Compare March 13, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant