Workpen
Workpen runs one untrusted command in a project directory. By default the child cannot read secret files, cannot read your home directory, cannot use the network, and cannot write outside that directory. The parent is trusted. This is not a VM.
Install
Library:
= { = "0.7", = ["gc", "nono"] }
CLI:
cargo binstall fetches the GitHub release archive. 0.7.4 ships Linux and macOS, on x86_64 and arm64. The file inside each archive is workpen.
Git pin:
= { = "https://github.com/workpen/workpen", = "v0.7.4", = ["gc", "nono"] } <!-- x-release-please-version -->
MSRV is 1.95.
CLI
After cargo install workpen-cli --locked, paste this in a terminal:
&& &&
.env is dest-deny. notes.txt is a hardlink of .env, so dest-deny
too. workpen run on .env refuses and does not print the secret.
notes.md is ordinary: why prints allowed, run prints
hello notes. From this repo, bash examples/dest-deny.sh is the
same commands.
workpen run checks dest-deny before it starts the child. By default
the network is off. $HOME is not a workspace and not an extra root.
--extra-root is an explicit extra directory with read-write access,
so a write outside the workspace is possible only when you pass that
flag. PathGuard still refuses / and $HOME as either root.
agent.lock in the workspace adds dest-deny globs on top of the
built-in list. One glob per line. A line that starts with # is a
comment. Blank lines are skipped. A missing file means the built-in
denies only. A file that is only comments does not turn those denies
off.
# extra dest-deny globs, one per line
# secrets/**
Unix --tty gives the child a PTY. Windows --tty refuses. A
spawn-only run is examples/run-echo.sh. On
Linux, if the kernel cannot hide secret names, workpen run does not
start the child.
Commands: why, run, policy, gc, init, doctor. workpen --help prints usage. workpen doctor reports whether this machine can jail a child and does not start one.
workpen gc --max-age 7d looks under .workpen-worktrees. --dry-run prints what it would remove and does not delete. It does not clean target/.
Library
use Path;
use ;
let policy = default;
assert!;
Kernel jail (feature nono): process_jail then run_child. PathGuard
refuses / and $HOME as the workspace or extra-root. Leftover
worktree GC is feature gc.
Crate rustdoc is canonical: workpen::threat_model. The same contract
in one page is docs/threat-model.md.
Limits
- On Linux, if the kernel cannot hide secret names,
workpen rundoes not start the child. Libraryrun_childstill starts the child (RemountSkipped) unless you opt intowith_require_dest_hide. - Nested Linux post-create (
mkdir x && touch x/.env) is a launch snapshot. Workspace-root missing dest-deny names are occupied when remount applies. - Windows WFP without admin is skipped (
WfpSkipped). AppContainer with no network capabilities is the unelevated net deny.
Contributing
See CONTRIBUTING.md. DCO sign-off required. Security: SECURITY.md.
License
MIT OR Apache-2.0.