Skip to content

feat: add OpenShell sandbox provider extension#3469

Closed
zanetworker wants to merge 1 commit into
openai:mainfrom
zanetworker:feat/openshell-sandbox-extension
Closed

feat: add OpenShell sandbox provider extension#3469
zanetworker wants to merge 1 commit into
openai:mainfrom
zanetworker:feat/openshell-sandbox-extension

Conversation

@zanetworker

@zanetworker zanetworker commented May 20, 2026

Copy link
Copy Markdown

Summary

Add NVIDIA OpenShell as a sandbox provider extension. OpenShell is an open-source, self-hosted sandbox runtime for AI agents with declarative YAML network policies, credential isolation, and GPU support.

The extension wraps the openshell Python SDK (sync gRPC client) via run_in_executor, following the Modal provider pattern. It implements BaseSandboxClient / BaseSandboxSession with:

  • Gateway discovery via SandboxClient.from_active_cluster() or explicit endpoint
  • Command execution via gRPC ExecSandbox RPC
  • File I/O via exec + base64 (OpenShell has no native file API)
  • Tar-based workspace persistence
  • Local path normalization (OpenShell rejects newline characters in command arguments, so the remote runtime helper cannot be used; OpenShell enforces its own filesystem policy inside the sandbox)

Files:

  • src/agents/extensions/sandbox/openshell/__init__.py — re-exports
  • src/agents/extensions/sandbox/openshell/sandbox.py — 4 classes: OpenShellSandboxClient, OpenShellSandboxSession, OpenShellSandboxClientOptions, OpenShellSandboxSessionState
  • src/agents/extensions/sandbox/__init__.py — lazy import block
  • pyproject.toml — optional openshell dependency + mypy override
  • tests/extensions/sandbox/test_openshell.py — 27 tests
  • examples/sandbox/extensions/openshell_runner.py — session-level and agent-level integration example

Test plan

  • uv run pytest tests/extensions/sandbox/test_openshell.py -v — 27/27 pass
  • make format — clean
  • make lint — clean
  • make typecheck — zero openshell-related errors
  • make tests — 4406 pass, zero openshell regressions
  • Live integration tested against a local OpenShell gateway (Docker driver): sandbox creation, exec, file read/write, workspace persistence, shutdown all verified

Issue number

Closes #3468

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@zanetworker
zanetworker force-pushed the feat/openshell-sandbox-extension branch from 6664a4e to a97447e Compare May 20, 2026 11:48
@zanetworker

Copy link
Copy Markdown
Author

@seratch would appreciate your review on this when you get a chance

@zanetworker
zanetworker force-pushed the feat/openshell-sandbox-extension branch 4 times, most recently from 45b29d6 to 1bafc83 Compare May 26, 2026 09:19
@zanetworker
zanetworker force-pushed the feat/openshell-sandbox-extension branch from 1bafc83 to 721f588 Compare May 30, 2026 16:59
Add NVIDIA OpenShell as a sandbox provider, wrapping the `openshell`
Python SDK (sync gRPC client) via run_in_executor. Implements the
standard BaseSandboxClient/BaseSandboxSession contracts with gateway
discovery, tar-based workspace persistence, and file I/O via exec.

Closes openai#3468
@zanetworker
zanetworker force-pushed the feat/openshell-sandbox-extension branch from 721f588 to 9473f88 Compare June 6, 2026 14:45
@seratch

seratch commented Jul 16, 2026

Copy link
Copy Markdown
Member

Thanks for putting this together, and for the substantial work that went into the implementation.

At this time, we're not actively adding new third-party sandbox provider implementations directly to the SDK. We would prefer provider-specific integrations like this one to live in a separate package maintained by the provider team, so they can evolve and be released alongside the underlying service.

Given this direction, we're going to close this PR. Thanks again for the contribution and for your understanding.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add OpenShell sandbox provider extension

2 participants