Agent shell execution ran rm -rf after a failed && chain (; semantics) - no dry-run or guard, caused real data loss
#1729
LangLang03
started this conversation in
General
Replies: 2 comments
|
这类“一个 dsh plugin --profile web add pi2dsh@0.11.0
dsh plugin --profile web add pi-approval-guardian可以直接复用 DSH 已配置的 reviewer 模型,例如启动前设置: export PI_APPROVAL_GUARDIAN_MODEL=deepseek-official/deepseek-v4-flash
export PI_APPROVAL_GUARDIAN_POLICY='拒绝递归删除、不可恢复删除,以及失败链之后仍会无条件执行的破坏性命令。'
dsh web
... && ...; rm -rf cpp/build cpp && ...会在真正调用 shell 前被看到,而不是等前半段失败以后再补救;通过后的 tool input 还会被锁定,避免“审的是 A、执行成 B”。 这条链路我们在真实 DSH runtime 里验证过 allow 和 deny 两侧:普通命令放行,危险的 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
What happened
While running a move command through the agent's Bash tool, the model issued:
The first
mvfailed (one source path was wrong — the file lived elsewhere), so the whole&&chain was skipped. But the;-separatedrm -rf cpp/build cppstill executed unconditionally, deleting the entire project source tree plus ~1.8 GB of training data in a single command. The attached screenshot shows the exact command and the aftermath.The harness executes agent shell commands verbatim via
bash -cwith no simulation/parsing and no guard on destructive operations. One;vs&&mistake — by the model or by the human reviewing the command — turns a routine directory migration into permanent data loss.Suggested safeguards
rm -rf,mvoverwrites,>redirects,dd,mkfs.rm -rf/rm -fr/ overwritingmv— at minimum when they target the session workspace.rm(or snapshot the workspace before each run) so deletions stay recoverable.;following a failing&&chain, or surface exit codes so a partially failed chain is obvious before the destructive tail runs.Impact in our case
orphan_file— no inode-based recovery was possible).Happy to provide more detail. Thanks for considering!
All reactions