Skip to content

feat: integrate fail-closed gVisor Docker execution provider - #350

Merged
Maplemx merged 10 commits into
devfrom
codex/gvisor-provider-integration
Aug 17, 2026
Merged

feat: integrate fail-closed gVisor Docker execution provider#350
Maplemx merged 10 commits into
devfrom
codex/gvisor-provider-integration

Conversation

@Maplemx

@Maplemx Maplemx commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Retains all six original commits from contributor @drscrewdriver's feat: add gVisor (runsc) runtime support to DockerExecutionResourcePr… #345 (the successor to gvisor docker runtime 1/2 reuse docker provider way #335).
  • Merges current dev on top of that preserved history, then corrects the integration without rewriting contributor commits.
  • Moves gVisor/runsc behavior into a dedicated optional gvisor provider/resource subtype; generic Docker remains mechanism-neutral.
  • Fails closed when Docker cannot report a valid registered runsc runtime or when the bounded runtime execution probe fails.
  • Reports the verified active runtime in handle and code-execution result metadata, and removes uncollected script evidence in favor of pytest-collected tests.
  • Documents explicit sandbox="gvisor" behavior in English and Chinese.

Root cause addressed

#345 treated host runsc binary presence as proof that Docker could run the selected runtime, and placed mechanism-specific behavior in the generic Docker provider. That could report readiness for an unregistered or invalid Docker runtime.

Attribution and follow-up

This branch preserves the original commits and authors from #345. It does not close #345. After this PR merges, close #345 as superseded with a link to this PR, per #342.

Related: #342, #335, #345.

Validation

  • python -m pytest -q — 2550 passed, 28 skipped (Agently-Stage 0.3.8).
  • Focused provider and regression checks with RuntimeWarning-as-error — 129 passed, 1 prerequisite-specific gVisor integration skip.
  • The real gVisor test is pytest-collected and skips only when Docker/runsc/image prerequisites are unavailable.

drscrewdriver and others added 9 commits August 1, 2026 20:33
…ovider

- Add runtime parameter to DockerExecutionResource (default: runc) - Add runtime parameter to create_resource() factory - Inject --runtime flag in _container_base_args after security hardening - Add _inspect_runsc_availability() for fail-closed gVisor - inspect_availability() checks runsc when runtime != runc - async_probe/async_ensure/async_health_check reflect container_runtime - _normalize_code_sandbox accepts gvisor - register_*_sandbox_action maps sandbox=gvisor to docker_runtime=runsc
When gVisor/runsc is selected, the Sentry user-space kernel enforces
strict syscall filtering regardless of default_args. The static
_isolation_capabilities() method cannot detect this, so we now
override the isolation report in async_probe() when runtime != 'runc'.

Changes:
- Override isolation['syscalls_restricted'] = True for gVisor
- Override isolation['mechanism'] = 'gvisor_container'
- Add isolation['container_runtime'] = 'gvisor/runsc'
- Add 20 tests across 6 categories (Docker regression, fail-closed,
  isolation capabilities, pipeline integration, cleanup/lifecycle,
  health/probe/ensure consistency)
- Update conftest.py to include agently_stage_stub for test env
@Maplemx
Maplemx marked this pull request as ready for review August 17, 2026 05:27
@Maplemx
Maplemx merged commit 4abbbcd into dev Aug 17, 2026
1 check passed
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.

2 participants