feat(sandbox): publish E2B and Cube Session files - #169
Merged
Conversation
yanpgwang
added a commit
that referenced
this pull request
Aug 21, 2026
## Problem Custom Skills were closed-loop only on Docker. Sessions using E2B, CubeSandbox, OpenSandbox, or Daytona could not materialize their immutable Skill Version trees, which prevented the same Agent workflow from running across the supported remote sandbox backends. ## Solution - add one provider-neutral remote Skill materializer over the existing official SDK file data planes - validate the canonical archive with the same bounded extraction and SHA-256 checks used by Docker - upload a sibling staging tree, restore executable bits, remove write bits, and publish with rollback - isolate primary/self and roster Agent Skill paths - reconcile the adapter marker and `SKILL.md` bytes before relevant tool steps - deny ordinary write/edit operations beneath `/workspace/skills` while preserving read and shell execution - repair corrupt, partial, directory, and symlink marker states through staged marker publication - self-heal Mango-owned Skill directories after permission, symlink, or non-directory drift - preserve provider command diagnostics when Daytona returns combined output - advertise the capability for E2B, CubeSandbox, OpenSandbox, and Daytona and document the remote-copy trust boundary - restore the E2B and CubeSandbox FileResources and SessionOutputs registry flags implemented and documented in #169 but omitted from the command registry; this PR does not introduce those underlying capabilities ## Acceptance criteria - all four remote adapters import, execute, attach, and repair the same immutable Skill bundle contract - interrupted archive imports are not visible - equal Skill names in primary and child Agent scopes do not collide - executable helpers retain execution mode even when the provider upload SDK ignores modes - marker, main-instruction, and adapter-owned directory drift is detected and repaired without following existing symlink targets - Runtime Skill reads use the canonical absolute sandbox path, including Daytona - non-zero remote commands retain useful provider diagnostics ## API and migration impact No HTTP route, schema, database migration, or LLM adapter change. The existing `/v1` Skill contract is extended to additional sandbox capabilities. ## Security and durability Archive validation rejects traversal, absolute paths, links, duplicate entries, and invalid canonical roots. Remote adapters publish only validated regular files. Marker and tree cleanup unlinks symlinks without recursively changing their targets. The canonical object-store archive remains immutable. Remote providers do not expose a native read-only bind mount, so sufficiently privileged sandbox shell code can change the hardened copy; the documented pre-tool reconciliation repairs detectable `SKILL.md` and layout damage. ## Design provenance The current public Claude Managed Agents Skills design was reviewed for version-pinned filesystem bundles, `SKILL.md`, progressive disclosure, and trust-boundary lessons. Mango keeps its own self-hosted lifecycle and rejects Anthropic headers, authentication, hosted catalogs, rollout identifiers, and hosted-runtime dependencies. The adopted and rejected decisions are recorded in `docs/provenance.md`. ## Verification - `make verify` - `make docs-check` - `make security` - targeted remote Skill conformance and race tests - focused Claude Opus review of the final repair diff The opt-in live provider suite is wired for all four adapters but was not run because it requires external credentials and billable sandboxes. ## Non-goals Environment Worker activation, Memory Store expansion, hosted catalog integration, and LLM/model adapter changes are intentionally outside this slice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem, rationale, and scope
E2B and CubeSandbox preserve durable Session workspaces and run package-configured tools, but they reject File-backed Session Resources and
/mnt/session/outputs. Switching an otherwise identical cloud Environment to either provider therefore removes input and deliverable workflows that Docker, OpenSandbox, and Daytona already support.Acceptance criteria:
/mnt/session/outputs, and idle publication receives a repeatable validated archive.Non-goals: streaming E2B/Cube SDK transfers, read-only remote copies, remote Skills or Memory, heterogeneous-worker routing, Environment Work, or changing the Files HTTP API.
What changed
Verification
make verifymake docs-checkmake securitymake local-configmake image-smokemake test-serviceAPI and migration impact
No route, JSON shape, OpenAPI schema, database schema, or migration changes. On the existing
/v1contract, cloud Environments backed by E2B or Cube now admit File Session Resources and publish Session outputs instead of returning an unsupported-capability error. Mango remains pre-release, so this capability change is made in place.Durability and security
Design provenance
This change reuses Mango existing File Resource and Session Output contracts rather than adding provider-shaped public fields. The CubeSandbox Go SDK and E2B-compatible envd filesystem API are implementation data planes only. Adopted behavior, provider-specific buffering, and rejected compatibility obligations are recorded in
docs/provenance.mdanddocs/sandboxes.md.Checklist