Repository navigation
Replies: 3 comments 1 reply
|
English version Hi treesess, I'm contacting you because I experienced a very similar incident with DeepSeek Harness on November 16, 2026. While the agent was working on an AI project on my Windows computer, a destructive operation apparently deleted a large part of my environment, with an estimated 98 GB of data lost. Several applications and project files disappeared, including parts of DeepSeek itself. During the investigation, I also found indications of a recursive deletion command ("rmdir /s /q"). I'd like to compare our experiences to determine whether we encountered the same bug. Could you tell me:
Regarding the last question, you can answer publicly or privately, whichever you prefer. Neither of us needs to disclose confidential project details. A general description would be enough. I've preserved crash logs and would be happy to compare relevant technical details privately, after removing any sensitive information. Thank you for sharing your experience. I hope we can identify the cause and help prevent this from happening to others. 中文版本(简体) 你好,treesess! 我联系你是因为我在2026年11月16日使用 DeepSeek Harness 时,也遇到了非常相似的严重数据丢失事故。 当时,AI 代理正在我的 Windows 电脑上开发一个人工智能项目,随后发生了破坏性删除操作,估计导致约 98 GB 的数据丢失。多个应用程序、项目文件以及 DeepSeek 自身的部分组件都消失了。 在调查过程中,我还发现了递归删除命令("rmdir /s /q")的相关迹象。 我希望与你比较这两次事故,以确定是否遇到了相同的软件问题。 我想请教几个问题:
关于最后一个问题,你可以选择公开或私下回复。我们都不需要公开任何机密的项目细节,简单描述即可。 我保留了一些崩溃日志,愿意在删除敏感信息后,与你私下比较相关技术细节。 感谢你分享自己的经历。希望我们能够找到问题的原因,避免其他用户遭遇同样的事故。 |
|
Two-day follow-up: a correction to my own report, and one finding that matters more than the original bug. When I filed this I wrote that everything was recovered. That was wrong, and the correction makes the case stronger, not weaker. 1. "Recovered" was only size-and-count recovery. The files came back with exact original sizes and byte totals — and 78+ of them had entirely zeroed content (15 completely destroyed). The zero runs are 4 KB page-aligned. This turns out to be a known Windows VSS defect: shadow copies can return NULL blocks with no error at all, same file size, nothing in the event log. It reproduces from Windows 8.1 through Windows 11 25H2 (Microsoft support case 115060812822144 was closed as a confirmed bug; a 2026-10-31 report reproduces it on 25H2). So "I have shadow copies" is not a recovery plan. 2. Timeline correction. The command was issued at 19:02:16 and killed at 19:04:23 — an upper bound of 127 seconds, not "2–3 minutes". Damage was first observed at 19:05:25. The approval policy was switched to "ask" at 19:04:16 — two minutes after the destructive command was already running. By the time a human could have been asked, the folder was gone. 3. The part that actually matters for the runtime design. At 19:00:11 — 125 seconds before the fatal command — a review subagent I had spawned delivered a P0 finding:
The agent received it and acted on it: 59 seconds later it rewrote both scripts and added the missing guard, specifically in response to that review. That part worked. Then it validated the new guard by running So this was not "the agent ignored a warning". The warning arrived, was understood, and was implemented. The failure was in how a safety guard gets tested. 4. Updated asks.
I have a full post-mortem (Traditional Chinese) with the millisecond timeline, the recovered source of the two scripts, and the evidence trail, plus a small scanner that detects zeroed content by page alignment. Happy to share either. References
My own data point: Windows 11 25H2, build 26200.8457 — 78+ files with exact original sizes and |
|
Follow-up: we tried to reproduce the zeroing, and it did not reproduce. Since my last comment I ran a controlled decoy experiment on the same machine. The question was simple: does deleting a file make a VSS snapshot read back zeros?
So TRIM, the delete API, and mass deletion up to 1 GB are not sufficient to explain the zeroing. The documented VSS NULL-block behaviour is still the best available explanation — but it is not confirmed, and I should have said that more carefully the first time. Two number corrections while I am here:
One operational detail: after a reboot Windows reassigns shadow device numbers (my S22/S23 became The lesson I would keep is narrower than "VSS is broken": a shadow copy is a recovery mechanism, not a backup, and "restored" must be verified by content. The test method is documented in |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR — In
danger-full-access, apwshtool call ran a script whose path argument(
-Dest "C:\") passed its own guards unnormalized, and the script executedcmd /c rd /s /q "C:\". It deleted 1.75 GB / 1,372 files of my working folder before Ikilled it. I recovered everything from a VSS shadow copy taken 6 hours earlier — most users
do not have that safety net. DSH 0.2.2-rc.1 (app 44.7.0), Windows 11.
What happened (2 minutes, 4 facts)
pwsh -File uninstall.ps1 -Dest "C:\" -Force.The destructive verb lived inside the script, not on the tool's command line.
[IO.Path]::GetFullPath("C:\")(→C:\, trailingseparator kept) against the user profile — it can never match, so the drive root passed;
a
-Forceflag then skipped the last leaf-name check.rd /s /q "C:\"ran for 2–3 minutes; the shell tool had no reason to stop it, thesandbox had no say (full access), and the approval layer is
neverunder this preset —no one was asked, nothing was logged, no restore point was created.
vssadmin list shadows→ mountedHarddiskVolumeShadowCopy23(6 h earlier) →robocopy /E /COPYALLrestored 143 dirs / 1,372 files / 1.744 GB, verified byte-for-byte.Why every existing layer was bypassed
danger-full-accesspreset = approval policynever; not asked, by designpwsh -File script.ps1; the delete verb was inside the script-Forceskipped the last checkWhat I built (all MIT, public): https://github.com/treesess/agent-safety
safedelete/— PowerShell module: canonicalize + protected-path denylist + junction-safedelete + command-line scanner; 76 tests (the incident command is rejected with
DriveRoot).dsh-guard/— a DSH host plugin prototype that hookstools/pre-execute(
@deepseek-ai/dsh-tools/lib/pipeline.js:386) and answersdeny/askfor destructiveshell commands; 27 tests + a real-Cordis 4.1 integration check; still a parameter-level
speed bump, not a sandbox.
docs/— feasibility study with file/line evidence, incident review, and a concretefeature request (acceptance criteria included).
Proposal — what would actually prevent this in DSH itself
(
rd /s,rmdir /s,Remove-Item -Recurse,del /s /q,rm -rf) and mirror/formatverbs (
robocopy /MIR,Format-Volume,diskpart clean); canonicalize the target; ifit is a drive root, the user profile,
.dsh, the install/runtime dirs, or outside theworkspace → require approval (or deny with a clear reason). Also scan called script files
when the command is
pwsh -File/cmd /c *.bat, and treat unparsable commands asrisky.
to a trash dir) instead of delete; optionally a VSS/APFS/shadow snapshot. If the
checkpoint fails, fail closed — do not delete.
@deepseek-ai/dsh-experimental-auto-review(a model checks each call against the requestand holds denied calls for approval). For destructive calls it should not be optional,
or at least should be on by default with a deterministic pre-filter.
safe_deletetool so the model has a safe path instead ofhand-writing
rd /s /q.The full write-up with acceptance criteria and non-goals is in
docs/dsh-feature-request.md;the interception feasibility study is in
docs/dsh-guard-feasibility.md(it documents
tools/pre-executebehaviour, theask→denybehaviour undernever, andscope handling — all read from the 0.2.2-rc.1 asar).
I am happy to turn any of this into a PR (e.g. a deterministic pre-filter + quarantine
hook), or to keep it as a third-party plugin if you prefer to keep core minimal. The one
thing I would ask: please do not let "full access" mean "no approval for irreversible
mass deletion" — that is the gap this incident walked through.
繁中摘要
在
danger-full-access下,pwsh工具執行了一支腳本,腳本的路徑參數(-Dest "C:\")未經正規化就通過自己的防護,接著執行
cmd /c rd /s /q "C:\",刪掉我 1.75 GB / 1,372 個檔案的工作資料夾;靠 6 小時前的 VSS 影子複本完整救回。多數使用者沒有這種安全網。
既有的每一層都失效了:full access 的 approval policy 是
never(不會問);沙箱只管檔案效果、full access 直接繞過;shell 工具只看到
pwsh -File script.ps1,刪除動詞在腳本裡;Auto review 預設關閉;腳本自己的防護是模型寫的,漏了 canonicalize 與磁碟根。
我做了 MIT 授權的公開 repo(https://github.com/treesess/agent-safety):
SafeDelete(PowerShell 模組,76 測試)、dsh-guard(DSH host plugin 原型,掛
tools/pre-execute,27 測試+真 Cordis 整合)、以及含檔案行號證據的可行性研究與feature request。
建議(優先級):① 破壞性工具呼叫一律要求批准(即使 full access),目標為磁碟根/使用者
目錄/
.dsh/workspace 外時尤其;② 刪除前先建立可還原點(quarantine 最便宜),失敗就fail closed;③ 把 Auto review 變成這類呼叫的最低標;④ 提供官方
safe_delete工具。我可以配合改為 PR。
All reactions