casualjim / dsh-heimdall-sandbox
DSH sandbox provider delegating confinement to the heimdall-sandbox binary: mode-to-policy-JSON mapping over the pi-heimdall policy fragment format
About this plugin
Written by the registry from verified metadata, not from the README.
dsh-heimdall-sandbox is a DSH plugin published from the dsh-heimdall-sandbox package in the casualjim/dsh-plugins repository.
Capabilities and topics
dsh-heimdall-sandbox
DSH sandbox provider (ctx.sandbox) delegating confinement to the
heimdall-sandbox binary
(>= 0.1.45).
Mapping
| DSH mode | heimdall policy |
|---|---|
read-only | declared-empty filesystem block — reads kept, writes denied except platform temps + /dev/null |
workspace-write | filesystem.writable: [session-cwd, ...configured]; platform temps granted by profile defaults |
danger-full-access | never reaches the provider |
filesystem.deny passes through in pi-heimdall's own syntax (~/x,
absolute, ordered !negations); denied beats writable.
Config
The config format is the pi-heimdall policy fragment, verbatim — the same property names across agent harnesses, no renamed aliases.
- id: sandbox
name: dsh-heimdall-sandbox
config:
binaryPath: "" # empty: npm wrapper, then PATH
filesystem:
writable: [] # beyond the session workspace
deny: [] # verbatim pi-heimdall deny syntax
virtual: {} # in-sandbox path -> host path mounts
network: host # "host" (default) or "none"
proc: default # "default" or "none"
env: # parent env filter
allow: []
deny: []
sshAgent: false # mount agent sockets (linux bwrap)
gpgAgent: false
ageAgent: false
projects: # per-workspace overrides, longest key wins
/path/to/project:
filesystem:
writable: []
deny: []
Layers
Policy layers, each merging over the previous (lists append, scalars take the most specific layer, absent fields stay at binary defaults):
~/.config/heimdall/default.jsonc— GENERATED deny corpus, regenerated by dsh-heimdall's loader on every load. Byte-identical to pi-heimdall's generated file; never hand-edit it.useDefaultFilesystemDeny: falsein user/workspace config strips the generated deny list (explicit entries stay).- plugin definition
cordis.patch.yml— deployment baseline only (binaryPath); the deny corpus is NOT embedded here. ~/.dsh/profiles/<profile>/cordis.patch.yaml— the DSH loader merges 1+2 into the provider config the plugin receives~/.config/heimdall/config.json(c)—sandboxsection, user-global (user-owned overrides)<workspaceRoot>/.config/heimdall.json(c)—sandboxsection, per-workspace
The projects map lives in layers 1–2 (deployment config) and is matched by
workspace root between the config layers and the file layers.
Every policy field (except binaryPath) is valid inside a projects entry
and inside all files' sandbox sections. The files are multi-plugin: they
may also carry other plugins' sections (e.g. dsh-heimdall's
commandPolicies); this provider reads only sandbox. The workspace file's
sandbox section is the opt-in — committing it lets that repo widen its own
writables to any path not covered by the deny corpus. Deny still beats every
writable. Malformed JSON fails loudly.
Layers 0, 3, and 4 are read through dsh-heimdall's shared config loader
(dsh-heimdall/config): one parser (JSONC), one representation
(SandboxOptions), one schema-driven merge (mergeSandboxOptions), and one
migrate-and-delete pass that moves legacy .pi/.omp/.dsh heimdall files into
the universal locations before anything is read. This package owns no parser,
no merge, and no deny corpus of its own — the same corpus definition feeds
pi-heimdall, omp, and DSH.
Notes
- One policy JSON file per
confine()call under a fresh private temp dir; removed when the provider stops. A crashed server leaks small files until OS temp sweeps. - The in-process fs fence (
read/write/edittools) still enforces DSH's own workspace containment and does not seefilesystem.deny/extras — only spawned processes go through this provider. - Enforcement reported
full(Seatbelt on macOS, bubblewrap on Linux).
Badge
Listed here? Link back with this badge — paste the snippet into your repository README.
[](https://dsh-plugin.com/plugins/casualjim/dsh-plugins/dsh-heimdall-sandbox)