DSH Safekeep: Windows File Recovery Protection in Unattended DSH Workflows

Preface

When granting high privileges to an Agent in DeepSeek Harness (DSH) and letting it modify code unattended for long periods, a common risk is the accidental deletion or overwriting of files. Manual confirmation for every step interrupts automation, while having no protection at all can turn accidents into irreversible losses. DSH Safekeep is a community-maintained, unofficial Windows plugin. Its goal is to make common file accidents recoverable wherever possible without adding per-operation confirmation, and to refuse execution when it identifies dangerous operations such as permanent deletion.

The following introduces its positioning, capability boundaries, installation steps, and daily usage. Facts are subject to the GitHub repository README and Release notes. The current public preview version is 0.1.0-rc.1, released under the MIT License and maintained by SPX43JL. The plugin is categorized as admin-security in the SkillHub directory.

What is this

DSH Safekeep’s one-sentence positioning: An unofficial Windows plugin for high-privilege, unattended DSH workflows, aiming to make common file accidents recoverable.

For ordinary edits, it saves the old bytes first before allowing subsequent operations to proceed; when it identifies dangerous operations like permanent deletion, it refuses execution and provides a recoverable removal tool, allowing the Agent to continue working within existing authorizations. It is not a sandbox, a full backup, or an absolute guarantee against deletion: writes within scripts, unmatched tools, and direct PTC filesystem API calls may remain completely unobserved; the single-file snapshot limit is 64 MiB; and the local recovery library cannot handle the loss of the entire disk. You should read the Coverage Statement in the repository before use.

Verified Environment and Support Scope

The verified environment declared in the initial README is as follows:

  • Windows 11 x64, local NTFS
  • Node.js 24.14.0, PowerShell 7.6.5
  • DSH 0.1.5-rc.2, Web / headless
  • Native read / write / edit / pwsh tool modes

Write operations by the native recovery tool require the current DSH to be in danger-full-access mode; the plugin will not switch permission modes. The project does not claim support for macOS/Linux or DSH Desktop/ACP/Teams; other Windows/Node/PowerShell/DSH version combinations must be re-validated by yourself. See Compatibility and Maintenance and Validation Report for details.

Core Features

Pre-edit Snapshots and Dangerous Operation Interception

  • Overwrite-type edits: Retains old file content before proceeding (single-file old content limit of 64 MiB).
  • Dangerous operations like permanent deletion: Refuses execution and allows recoverable removal via recycle-type tools.
  • No new per-operation confirmation: Normal reading, editing, dependency installation, and testing continue to follow the original flow.

Agent-Callable Tools

The Agent can directly call the following tools without relying on additional installations on the PATH:

Tool Purpose
data_safety_status Version, fingerprint, counts, storage status, and coverage boundaries of the current instance and session
data_safety_snapshots list / inspect / verify / restore; default restore is a side-by-side new file
data_safety_trash move / list / verify / restore; accepts only verified absolute paths, no purge
data_safety_temp create / list / retire; retirement also goes through recoverable recycling

Storage and Offline CLI

Default storage is located at .dsh-safekeep in the user’s home directory. It retains file content, original paths, timestamps, and session/tool identifiers, but does not record full conversations or full shell commands. Recovery data may contain sensitive content and should not be committed to Git. The directory ACL is restricted to the current account, SYSTEM, and Administrators.

When DSH cannot be started, you can extract the downloaded tgz of the same version and use the CLI inside the package. It shares the same library as the native tools and requires no DSH or network connection.

Installation and Enablement

The plugin will not install or upgrade DSH, switch models, or configure credentials. Prepare Node 24, PowerShell 7, pnpm, and a working DSH 0.1.5-rc.2, and verify the environment with the following commands first:

node --version
pwsh --version
pnpm --version
dsh --version

This project has not yet published an npm package; do not guess installation using @latest. Please download the exact version from the v0.1.0-rc.1 Release.

  1. Obtain dsh-safekeep-0.1.0-rc.1.tgz, SHA256SUMS, and BUILD-INFO.json from the Release, and compare the full hash using Get-FileHash -Algorithm SHA256. Keep the tgz, as it also provides the offline recovery CLI. The GitHub auto-generated Source code zip is not a DSH installation package.
  2. Quit the DSH profile you intend to modify. Back up that profile’s package.json, pnpm-lock.yaml, cordis.yaml (if present), and the previous tgz to a private directory.
  3. Place the tgz in a path containing no spaces or shell metacharacters, for example C:\DSHPackages (this is due to current DSH Windows plugin→pnpm forwarding path constraints; workspace paths can still contain spaces and Chinese characters).
  4. Web and headless are two independent profiles; installing one will not protect the other. Execute according to your actual entry point:
dsh plugin --profile web add C:\DSHPackages\dsh-safekeep-0.1.0-rc.1.tgz --save-exact --ignore-scripts --config.auto-install-peers=false
dsh plugin --profile headless add C:\DSHPackages\dsh-safekeep-0.1.0-rc.1.tgz --save-exact --ignore-scripts --config.auto-install-peers=false

Restart the corresponding profile after installation. No global installation is required; there are no postinstalls, network telemetry, or background services. For Web scenarios, use the authentication address output by DSH at startup, keep loopback monitoring, and do not publicize the token.

Confirming Effectiveness in the Current Session

In DSH, request a call to data_safety_status. Confirm that loaded: true, storage.ok: true, the version matches the codeHash in the Release attachment BUILD-INFO.json, and check the currentSessionId. If the tool does not exist, storage fails, or the fingerprint differs, you cannot consider the system protected.

Then, run the First-installation Canary pointed to by the README: perform a read→edit sample within a newly registered directory, verify that currentSession.snapshots increases, locate the snapshot, verify it, and restore the old bytes; for a file that was never created, attempt a deletion negative test only once, confirming rejection and that the count increases. A package name in the config or a single green status cannot replace this verification. This should be redone after every upgrade, profile modification, or DSH update.

Typical Usage and Recovery

Recovery via Tools Within a Session

Use data_safety_snapshots to list, verify the UUID, and then execute restore; use data_safety_trash to handle recoverable moves. When encountering uncertain paths, links, oversized old files, or unidentifiable write paths, switch to explicit paths, native editing tools, or new version output; you cannot bypass rejections that have already occurred.

CLI When DSH is Unavailable

Extract the tgz to a new directory (example path C:\DSHRecovery) and execute:

node C:\DSHRecovery\package\bin\dsh-safekeep.mjs doctor
node C:\DSHRecovery\package\bin\dsh-safekeep.mjs snapshots --path C:\Work\project\notes.txt
node C:\DSHRecovery\package\bin\dsh-safekeep.mjs snapshots verify SNAPSHOT_UUID
node C:\DSHRecovery\package\bin\dsh-safekeep.mjs snapshots restore SNAPSHOT_UUID
node C:\DSHRecovery\package\bin\dsh-safekeep.mjs trash list

doctor checks the local CLI/storage/history receipts and explicitly does not claim that the current DSH is loaded. For upgrades, uninstallation, and troubleshooting, see the Recovery Manual.

Use Cases and Notes

Who it is for: Developers who have actively granted high privileges to DSH on Windows, need the Agent to modify files unattended for long periods, and want a means to recover from common accidental deletions/overwrites. It is not suitable to treat this plugin as a full-disk backup, encrypted custody, or absolute protection against deletion for all write paths.

Permissions and Security: The plugin runs with the permissions of the current DSH process; you should read the source code, MIT License, and NOTICE yourself before installation. DSH Safekeep is an unofficial community project; the Official Community Discussion Display does not represent DeepSeek official review or endorsement. Community directories such as SkillHub are independent sites and have no official affiliation with DeepSeek / High-Flyer.

Conclusion

In the DSH “everything is a plugin” ecosystem, DSH Safekeep fills the gap of file recovery and dangerous deletion interception for Windows unattended scenarios. Its capabilities have clear limits, and after installation, you must verify actual effectiveness using data_safety_status and the canary test.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye