Skip to content

worker_threads isolate executor#3

Merged
ThomasHartDev merged 1 commit into
mainfrom
thomas/feat/worker-isolate
Jul 21, 2026
Merged

worker_threads isolate executor#3
ThomasHartDev merged 1 commit into
mainfrom
thomas/feat/worker-isolate

Conversation

@ThomasHartDev

Copy link
Copy Markdown
Owner

adds runInWorker, a stronger tier under the same verified-run contract that runs untrusted source in a worker_threads isolate instead of an in-process vm context. the worker gets its own V8 heap and thread, starts with an empty process.env and frozen globals, and takes an optional heap cap that comes back as an out-of-memory result. the nice part is it closes the in-process gap we pinned last time: the constructor walk that reaches the host realm now only reaches the worker realm, which has no host credentials, and there's an escape-attempt test that puts a secret in process.env and shows the sandbox still can't see it. the deadline hard-kills the thread so a sync spin and a never-settling promise are both handled, not just abandoned. one tradeoff worth knowing, grant values and return values cross by structured clone so you pass data, not live functions, for now.

@ThomasHartDev
ThomasHartDev merged commit 791fffe into main Jul 21, 2026
1 check passed
@ThomasHartDev
ThomasHartDev deleted the thomas/feat/worker-isolate branch July 21, 2026 17:37
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