Skip to content

fix(sandbox): require local runtime opt-in#3092

Open
he-yufeng wants to merge 1 commit into
eosphoros-ai:mainfrom
he-yufeng:fix/sandbox-local-runtime-opt-in
Open

fix(sandbox): require local runtime opt-in#3092
he-yufeng wants to merge 1 commit into
eosphoros-ai:mainfrom
he-yufeng:fix/sandbox-local-runtime-opt-in

Conversation

@he-yufeng

Copy link
Copy Markdown

Summary

Fixes #3082.

The sandbox runtime factory used to fall back to LocalRuntime when no container runtime was available. That path runs submitted code on the host, so this changes the default behavior to fail closed unless host-local execution is explicitly enabled.

Changes

  • leave SANDBOX_RUNTIME unset by default so runtime selection can auto-detect container runtimes
  • require SANDBOX_ALLOW_LOCAL_RUNTIME=true before LocalRuntime can be selected
  • add focused coverage for the no-container fail-closed path and explicit local opt-in path

To verify

  • PYTHONPATH=packages/dbgpt-sandbox/src python -m pytest packages/dbgpt-sandbox/tests/test_runtime_factory.py -q
  • git diff --check
  • PYTHONPATH=packages/dbgpt-sandbox/src python -m py_compile packages/dbgpt-sandbox/src/dbgpt_sandbox/sandbox/config.py packages/dbgpt-sandbox/src/dbgpt_sandbox/sandbox/execution_layer/runtime_factory.py packages/dbgpt-sandbox/tests/test_runtime_factory.py

@github-actions github-actions Bot added the fix Bug fixes label May 31, 2026
@he-yufeng he-yufeng force-pushed the fix/sandbox-local-runtime-opt-in branch from ce34bf9 to 79663d9 Compare May 31, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [Module Name] Sandbox API silently falls back to LocalRuntime and executes code on host

1 participant