A runtime permission model that restricts filesystem and network access, read carefully and left off.
$ node --permission --allow-fs-read=./src --allow-fs-write=./dist build.mjs
# what it protects against: a compromised dependency
# reading ~/.ssh or posting to an unexpected host.
# why not enabled:
# the build script legitimately reads node_modules,
# writes three directories, and shells out to a
# binary — which needs --allow-child-process, and
# that permits everything the child does.
# the flag list ended up permitting most of what it
# was meant to restrict.
A sandbox that has to be opened far enough for the workload is a sandbox that documents the workload rather than constraining it. The exercise was worth doing to find out that our build genuinely needs broad access, which is itself a finding — and the place this model will pay is a script with a narrow job, which we do not have yet.