feat(shell): make permissive exec the default policy#302
Conversation
Ship an open command allowlist (empty == any command runs) so an agent can use arbitrary build/test/VCS tooling (cargo, git, bash, make, node, python3, …) without per-deployment allowlisting. The fs jail (fs.host_root) plus the optional sandbox backend remain the security boundary — this worker is explicitly not a sandbox — and a catastrophic -only denylist stays as a tripwire for host-wrecking mistakes. - config.yaml: allowlist now empty (open); inherit_env: true so toolchains find their env; max_timeout_ms raised to 120000 so a real build/test isn't reaped at 30s; denylist trimmed to host-wrecking patterns only (dropped find -exec / sed -i / node -c / npm run / env <cmd> sub-exec escapes, which are pure friction once exec is open). - config.rs: replace the read-only-default unit test with one pinning the new contract — open exec permits cargo/git/bash, the catastrophic denylist still trips rm -rf /. - README: document the open default. Claude-Session: https://claude.ai/code/session_01Cy5KwY8y2NcPPnyo4LVste
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe shell worker's execution policy is relaxed: ChangesShell Worker Open-Exec Policy
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 24 skipped (no docs/).
Four for four. Nicely done. |
Satisfies CI `cargo fmt --all -- --check`; no logic change. Claude-Session: https://claude.ai/code/session_01Cy5KwY8y2NcPPnyo4LVste
What
Makes the shell worker's shipped default permissive: an empty command allowlist (which the gate treats as "open — any command runs"),
inherit_env: true, a 120s foreground timeout, and a denylist trimmed to catastrophic-only patterns.Why
The read-only default allowlist (
ls/cat/grep/…) blocks the tooling a coding agent actually needs —cargo,git,bash,make,node,python3. In practice that forces operators to allowlist commands one at a time, and a half-open list is defeated the moment any shell or interpreter is added to it. For a worker that already documents itself as "not a sandbox," the honest model is: leave exec open and rely on the real boundaries.Security posture (unchanged boundaries)
fs.host_root) still confines everyshell::fs::*op and the per-callcwd.target: { kind: "sandbox" }) is still the boundary for untrusted input.PATH/HOME/LD_*/DYLD_*and interpreter startup keys can never be set per call (DANGEROUS_ENV_KEYS).rm -rf /,dd if=,mkfs, fork bomb,shutdown/reboot,/etc/shadow.The sub-execution denylist entries (
find -exec,sed -i,node/python -c,npm run,env <cmd>) were dropped — they only existed to plug holes in a non-empty allowlist and are pure friction once exec is open.Changes
config.yaml—allowlist: [],inherit_env: true,max_timeout_ms: 120000, catastrophic-only denylist.src/config.rs— replaced theshipped_config_blocks_env_exec_escapetest withshipped_config_is_open_exec_with_catastrophic_denylist, pinning the new contract (open exec permitscargo/git/bash;rm -rf /still trips the denylist).README.md— documents the open default.Test plan
cargo test— full shell crate suite green (548 passed).config.yamlparses, is open, and the catastrophic denylist still rejectsrm -rf /.configuration::set shell— it hot-reloads, no restart.https://claude.ai/code/session_01Cy5KwY8y2NcPPnyo4LVste
Summary by CodeRabbit