Skip to content

Track follow-ups from the review of the owned-sandboxes stack (#6414 to #6417) #6703

Backlog

Description

@hemildesai

Tracks what is left from the review of the owned-sandboxes stack: #6414 → #6415 → #6416 → #6417.

The stack gives every server one component, OwnedSandboxes (self.sandboxes), to start, lend, checkpoint and stop the sandboxes it owns, a typed network rule on the sandbox block, and borrow() for the agent that is lent a sandbox. It was reviewed, then restacked onto main and fixed, and reviewed again over three rounds, and reverified on the current heads. The review comments and the verification records are on the four pull requests; the two documents attached to this issue explain the design and the checks visually.

Attached

  • Owned sandboxes explainer (HTML): the stack at a glance, owner and borrower, the life of one sandbox key, the network rule results, what was verified, what is open.
  • State charts (Markdown): three simplified state charts from a TLA+ model checked with TLC, with the models and views that produce them.

Open items

Open after the third round (none blocks the stack):

Fixed in the third round:

Fixed in earlier rounds:

Verified on the current heads

Check #6414 c46c9f4ea1 #6415 3a0fda7e61 #6416 782842baff #6417 4e713144c5
pre-commit on the PR's files pass pass pass pass
Live OpenSandbox checks 19 of 19 pass 16 of 16 pass 33 of 33 pass 18 of 18 pass
deepswe_external1 live server run not run on this commit not run on this commit not run on this commit 16 of 16 pass

The live checks start real sandboxes on OpenSandbox through the public API and confirm afterwards that none is left. The live server run drives the real deepswe_external1 resources server through its HTTP routes with a null run (reward 0) and a golden run (reward 1), and checks that its sandboxes are stopped at verify, at close and at shutdown. No model was called anywhere, and gym env start was not used. The local Docker check of no_network was not rerun on these heads.

The state charts were made again for #6415 at 3a0fda7e61: the model of one key was rewritten for that head and checked with TLC, and both attachments carry the new charts.

Activity

  1. added
    area:sandbox
    on Nov 24, 2026
  2. yaoyu-33 commented on Nov 24, 2026

    @yaoyu-33
    Contributor

    Where each open item stands after the push to the stack (heads: #6414 0f019e64f0, #6415 143865a2a6, #6416 9c2612e0b5, #6417 ff29e50899).

    Item Outcome
    #6414: SandboxSessionCheckpointer Alias added: nemo_gym.server_runtime.SandboxSessionCheckpointer resolves to OwnedSandboxes with a deprecation warning, removed in 0.10.0 (_moved_paths.py, test in test_moved_paths.py). b6f2750
    #6415: get() and in Fixed: they now agree with access() and export. A sandbox still starting, or one whose start and stop both failed, is none of theirs; keys still lists it, so a stop or aclose stops it. 02096a9
    #6415: one deadline for stop() Kept as documented, no single deadline. One deadline would leave the provider's stop only what the lock wait left, and a stop cut short leaves the sandbox running. Each wait is bounded on its own, and the shutdown sweep has its own overall budget (SANDBOX_SHUTDOWN_TIMEOUT_S).
    #6415: owner_concurrency in the glossary Added ("Owner concurrency"). 02096a9
    #6415: other servers' tests of a failed start CI's server suite ran all 315 server test folders on ad6bb5143d and they passed. The agentic_mme and browsecomp_advanced_harness tests assert a failed stop at retire or close, not a failed start, so the start-error change does not reach them.
    #6416: startup check by name suffix Replaced: a server lists the blocks it starts through self.sandboxes in owned_sandbox_blocks, each with the config field naming its provider. Startup checks each listed block against that provider, and refuses a restricted rule in any other SandboxConfig of the config, nested ones too. a60f895
    #6416: allowed_hosts Validated at load: a host name, *. and a domain, or an IP address or CIDR block. A URL, port, path, *, loopback or 0.0.0.0/0 is refused. a60f895
    #6416: network vs network_access network stays: partner_if already names a sandbox block's egress that way, and the rule lives on the block. The per-server network_access and sandbox_network_access fields are deprecated as each server moves onto its block's rule; the glossary says so. a60f895
    #6417: "the one way" The module says the refusals are advisory, the raw .provider included, and that the repository check follows once agents use borrow(). abdc90e
    stack: a create that outlasts the settle wait Kept as documented, with no code change. Such a create has outlived its own ready_timeout_s plus the stop limit, so the provider call is stuck. Finishing it in the background would leave a task that may never end, and shutdown would still have to cut it short.

    Also fixed in this push: the three findings of the review bot on #6414. A server's other provider field shared a snapshot index with a server named <server>.<field>. A provider was built before an index check that can fail. A provider close that failed or was cancelled could not be retried. The fix commit is 0f019e6. Also fixed: my own inline asks on the four PRs, each answered in its thread.

    Follow-ups, not in this stack:

    • Fold LentSandboxes (8 resources servers) and BaseEnvironmentServerWithTools.start_episode_sandbox onto self.sandboxes. single_agent_turn lending its attempt sandbox (feat(environment): start and lend a sandbox for each single-agent-turn attempt #6700) is the first server on it.
    • Move agents from AsyncSandbox.connect to borrow() (Stirrup first), then add the repository check that keeps connections inside borrow() and OwnedSandboxes.
    • Deprecate network_access and sandbox_network_access server by server, as each moves onto its sandbox block's network.

    Checks on the final heads: the unit tests of the touched packages show the same failures as a main tree in the same venv (missing optional SDK extras and no Docker on the node), and nothing new. pre-commit passes on each PR's files. The Enroot lifecycle smoke passes on the #6417 head with nothing left behind (create, lend, borrow, borrower refusals, a second borrow reading the agent's file, stop, cancel mid-exec and mid-create, restricted rule refused, aclose).

  3. yaoyu-33 commented on Nov 24, 2026

    @yaoyu-33
    Contributor

    Follow-ups from checking the stack against the sandbox ownership rule. The rule: the Environment Server starts the sandbox for each attempt, lends it, and stops it. The agent and the Resources Server only borrow it.

    Already supported:

    • An Environment Server owns the sandbox through self.sandboxes and lends it with access().
    • A Resources Server can borrow that sandbox for /verify with borrow(), though it never started it. It finds the provider by the block name in the access. A new test in feat(sandbox): borrow lent sandboxes and share harness configuration #6417 covers this.
    • An Environment Server with no sandbox_provider starts nothing and passes the startup check, so an attempt that opts out needs nothing from this stack.

    Fixed in this round:

    New follow-ups:

    1. Egress per container. A rule per sidecar, and grading with egress cut. Today network is one rule per sandbox and fixed at start. See the inline comment on feat(sandbox): apply typed network rules through owner capabilities #6416.
    2. Startup refusal for a block a server only describes. When the Resources Server declares what the attempt's sandbox holds, a declaration kept as a config block with a restricted rule is refused at its startup. See the inline comment on feat(sandbox): apply typed network rules through owner capabilities #6416.
    3. Wiring outside this stack, in feat(environment): start and lend a sandbox for each single-agent-turn attempt #6700.
      • The server that lends is single_agent_turn, not the base Environment Server class.
      • It starts the sandbox after the Resources seed, and the seed request carries no access. So a Resources Server cannot prepare the task in the sandbox. It first gets access at /verify, through the ng_sandbox_access body key.

    Already listed above, and still open: borrow() refusals stay advisory until providers enforce scope, so "only borrow" is a convention until then.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Rolloutarea:sandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions