Skip to content

HF runtime: dedicated sandbox execution mode#948

Draft
zkwentz wants to merge 1 commit into
rfc008-06-clifrom
rfc008-07-hf-runtime
Draft

HF runtime: dedicated sandbox execution mode#948
zkwentz wants to merge 1 commit into
rfc008-06-clifrom
rfc008-07-hf-runtime

Conversation

@zkwentz

@zkwentz zkwentz commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

What & Why

Official and author-isolated validation require a dedicated HF Sandbox execution mode rather than a same-user pool. This PR adds dedicated lifecycle, flavor, timeout, token-forwarding, and file-transfer support to HFSandboxProvider.

Risk & Review Guidance

  • Risk level: HIGH — remote execution, credentials, and lifecycle cleanup
  • Task class: security
  • Review focus: src/openenv/core/containers/runtime/hf_sandbox_provider.py:320 for provider mode selection and teardown; tests/test_core/test_hf_sandbox_provider.py for dedicated-vs-pooled behavior
  • Blast radius: A mistake can forward credentials, reuse an unsafe trust domain, leak a Sandbox, or run on unintended hardware.

Decisions & Alternatives

  • Dedicated mode is explicit — pools remain available only for same-user trusted workloads.
  • Token forwarding defaults off for isolated work — the control-plane token should not enter subject processes.
  • Provider owns teardown — rejected relying on caller garbage collection.

Verification

  • PASS: PYTHONPATH=src:envs .venv/bin/python -m pytest tests/ -q -m 'not integration' — 1,559 passed, 114 skipped, 31 external integration tests deselected on the complete stack.
  • PASS: Fork whole-stack CI — 7/7 checks passed, including Python 3.11/3.12, lint, docs, lock validation, and package smoke tests.
  • NOT verified: No live HF Sandbox smoke test was run because this machine has no HF token.

Scope & Non-Goals

  • This provider mode alone does not make a run official; policy locking is added in the next PR.

Stack

PR 7 of 17; depends on #947.

Full 17-PR stack
  1. #942 RFC 008: Spec-neutral local and remote validation architecture
  2. #943 Validation foundation: spec-neutral contracts and adapters
  3. #944 Validation policy: spec-aware check registry and planner
  4. #945 Validation executor: hardened shared reports and eligibility
  5. #946 Local validation API: execution-model-aware profiles
  6. #947 CLI: validation profiles and shared reports
  7. #948 HF runtime: dedicated sandbox execution mode ← current
  8. #949 HF certification: enforce trusted dedicated isolation
  9. #950 [RFC 008] Define remote author validation and publish gating
  10. #951 Validation: unify CLI reports and add a strict publish profile
  11. #952 Validation: add structured author diagnostics and remediation
  12. #953 Validation: run author validation in dedicated HF Sandboxes
  13. #954 Validation: isolate submitted code in author Sandboxes
  14. #955 Validation: bind author reports to policy and source
  15. #956 CLI: scaffold publish requirements
  16. #957 CLI: gate pushes on staged remote validation
  17. #958 Docs: explain local, remote, and publish validation

All upstream PRs remain draft while RFC 008 is under review.

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