Read both switches together.
nativeOrdinary tools route through their registered policy and sandbox seams.
code / bothrun_code executes a TypeScript body in the loaded code runtime.
read-only / workspace-writeConstrains capability paths that call the sandbox policy.
A fresh thread is still inside the Host process and user authority.
Make one explicit deployment choice.
Unset DSH_TOOLS_MODE, restart the Host, and verify that run_code is absent.
Use a disposable VM or constrained container with only the intended workspace, no host secrets or sockets, and independent egress policy.
Inspect; do not run an escape proof.
- EnvironmentRecord
DSH_TOOLS_MODEandDSH_PERMISSION_MODE. - CompositionRun
dsh --profile web --dump-config. - RuntimeIdentify whether the loaded backend is
worker-thread. - CatalogConfirm whether
run_codeis visible in a fresh Session.
Do not mistake reliability controls for authority.
env: {}removes inherited variables
filesystem isolation
heap + time capsbound resource use
≠process policy
approval promptsgate registered effects
≠kernel enforcement
If untrusted input already reached Code Mode.
Primary evidence.
- Public upstream security report #3245
- Worker-thread trust statement
- Worker construction
- Code Mode tool contract
Keep the deployment checklist.
The canonical guide includes shell and PowerShell checks, outer-boundary requirements, incident response, and a reusable decision record.
Read and star on GitHub