sandlock icon indicating copy to clipboard operation
sandlock copied to clipboard

Feature request: Expand checkpoint/restore compatibility

Open nnWhisperer opened this issue 4 months ago • 1 comments

SandLock already supports persistent checkpoints and restoring an OS-level process image into a fresh sandbox. Could this be extended into a generally usable checkpoint/fork facility?

Requested improvements:

  • Restore normal glibc programs that use the vDSO.
  • Restore, reconnect, or explicitly remap skipped FDs such as pipes, sockets, memfds, and PTYs.
  • Document whether COW filesystem state is included and how one checkpoint can safely seed multiple independent writable branches.
  • Add a stable checkpoint format/version and compatibility checks.
  • Optionally support caller-provided operation IDs for idempotent save and restore requests.

Ideal result:

cp = sandbox.checkpoint()
cp.save("checkpoint")

left = Sandbox.restore("checkpoint")
right = Sandbox.restore("checkpoint")

Both restored sandboxes should begin from the documented process, memory, filesystem, and policy state, then execute independently. Partial restoration should return structured diagnostics rather than silently weakening confinement.

nnWhisperer avatar Jul 30 '26 21:07 nnWhisperer

We could just use E2B's api as an inspiration

nnWhisperer avatar Jul 30 '26 21:07 nnWhisperer