{"versions":{"0.1.0":{"name":"dsh-safety-net","version":"0.1.0","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"dependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6","@deepseek-ai/cordis":"^4.0.1"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"8dcbdd98080b4df040f0928e032606387cc83a65","_id":"dsh-safety-net@0.1.0","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-K9f3jACCEGJ3nHdFxkPNYoPyZUqNtN+WR79lB6yfVYhi2tfFB26/rQ9SGgkAEUeg8NyyqBJqoaows59O312M2g==","shasum":"e6a2767843273bdd9c808da21e9bfe337fc8c287","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.0.tgz","fileCount":10,"unpackedSize":35501,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDbMLR31TYW37WXEHstn3aQnICupdPL6sDzueWDZKf2zgIhAJXNshmNPWn2pekNr5W4UKsBFvBQJRcNVAGw5/SoaW4s"}],"size":13354},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.0_1786962264435_0.2666326442120426"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T10:24:24.584Z","publish_time":1786962264584,"_source_registry_name":"default","contributors":[]},"0.1.1":{"name":"dsh-safety-net","version":"0.1.1","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"dependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6","@deepseek-ai/cordis":"^4.0.1"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"3c729a03dce830a89ffd76687ea19d1ecdc3a91e","_id":"dsh-safety-net@0.1.1","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-mLkTtR2Ve+51tgYpi+7sAS3smK65RQIkE+dhM66cy1cqrTPDX87qj7h7yOP8TzgAr/GoRXoHMopWFvTvjh/Mbw==","shasum":"6a44d2e737c1ae027711d15ea124809424cc8701","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.1.tgz","fileCount":10,"unpackedSize":41942,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAdruB98SmKXj5YYHswA+xD/7VLfdPQ2/uAHzDmn249cAiEAuFSDeJDVA7KlvRciLjVk95dfYrZGc69HF+bIM/XoR0w="}],"size":15338},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.1_1786964072990_0.8707477119494837"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T10:54:33.150Z","publish_time":1786964073150,"_source_registry_name":"default","contributors":[]},"0.1.2":{"name":"dsh-safety-net","version":"0.1.2","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"0f18f79a718b0bb998041ba2f0b9b5d2ad70ddae","_id":"dsh-safety-net@0.1.2","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-8MwuniVkTrBQEDQrqoDZkbOzgQoPP3naFW99xPDAn8tMRepXoeky42JCEzsYOC4akD6uZyLkPaRBN9RzG7M89Q==","shasum":"75c211ca8f9350972b03b15552071257f011b92b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.2.tgz","fileCount":10,"unpackedSize":42680,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFLu7/7QG2FneuOft1LslSTfWl7lgtONE8N7CqbS3UFfAiAu9Y1tZFCEoU3T6J5BAYmwUEMptj7XN8iRfDA5F3QGOQ=="}],"size":15635},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.2_1786964925511_0.6941784023763535"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:08:45.676Z","publish_time":1786964925676,"_source_registry_name":"default","contributors":[]},"0.1.3":{"name":"dsh-safety-net","version":"0.1.3","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","dsh-plugin","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"438390e1f5411cdf778e9df5299247435c6a87c1","_id":"dsh-safety-net@0.1.3","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-CdS1gSDmmlHTCDaNJIUPSkfQdOLkX212cOZfISGC8BgfgzRl13V/nSHtu91jA62RUonxQCsE2XsH+u+BMRjZaA==","shasum":"7bd09bc99a47489f35cd45251abee93093ea5246","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.3.tgz","fileCount":10,"unpackedSize":42698,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBYacQXpXzfMgBLRGoh9WZra1cRVxFyFEfyQm2KIOGsbAiEAv+7a8t4OYkCpLYog/7O393Urax4vleE9tAFFvgmCMV4="}],"size":15644},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.3_1786965122673_0.1649839339344903"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:12:02.836Z","publish_time":1786965122836,"_source_registry_name":"default","contributors":[]},"0.1.4":{"name":"dsh-safety-net","version":"0.1.4","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","dsh-plugin","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"devDependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"a95eb408f4adb24525ec0e9a132c2e1316faa0b0","_id":"dsh-safety-net@0.1.4","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-BDISesVM0fZMcOai1AgE40O5eSjTQC1xQg3wF74d78C+gtv9tkc8tmEy8U6iMRV6GiaRU1IDRUds+qTyfFQ3hQ==","shasum":"b9b553cf5651c5409ee9d62b140c0863715f4a9a","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.4.tgz","fileCount":10,"unpackedSize":43503,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCTaUA1qzq0aqs6hrxfKErY4TGSDYOUVj41GyjrooiqmgIhAJR/krFhP5GpxDZMctxrUw4DXf+lUGVNlD8tN3oW5LaU"}],"size":15955},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.4_1786965718796_0.36575301921591663"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:21:58.950Z","publish_time":1786965718950,"_source_registry_name":"default","contributors":[]},"0.1.5":{"name":"dsh-safety-net","version":"0.1.5","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","dsh-plugin","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"devDependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"3276d2fa6d1862618fa88983b43d1c14bb68b2d5","_id":"dsh-safety-net@0.1.5","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-nCpLpshLR+wztq4K71dw9jy3DfVRpikoZuS7AvOsikrEM5XEhL2ZLvEYsNEivAnjKQ+54Bh+htzDxFFIwm5azQ==","shasum":"795306b69d9e6a41e28e7132d90505a1d19efddf","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.5.tgz","fileCount":10,"unpackedSize":45663,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGJ6frKZysekIDNY4hw3mDP7I87EnCzlnoz5tOylXxP8AiBF/utDieFNRnbxnxWzVN5LOjCH/ANHTXOhP45kEXavpA=="}],"size":16630},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.5_1786966318530_0.27314974449329243"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:31:58.676Z","publish_time":1786966318676,"_source_registry_name":"default","contributors":[]},"0.1.6":{"name":"dsh-safety-net","version":"0.1.6","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","dsh-plugin","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"devDependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"126975de355adccfb92545f55d272eb18d42c481","_id":"dsh-safety-net@0.1.6","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-V7FK9xok/pUjX3GGNW1b7uSesTz5f5ZtwH+bJRHH2H7gu0syJO+t1LS1/5O6HjdMdOPjLbK+qRghBgEJ7uj+Hg==","shasum":"8e9f128b815b29c45b0417d402ff52c8c148d8d3","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.6.tgz","fileCount":10,"unpackedSize":46628,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCJO6Hs2wrSx2mqQCdYVlcY6vMyMBfTRqWKRH/r/ugJEgIhANAdTobrQlOQLritybSJ/RmyJF3YBKv7KHcYCuTvcw0p"}],"size":16879},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.6_1786966823427_0.1331450195711743"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-17T11:40:23.567Z","publish_time":1786966823567,"_source_registry_name":"default","contributors":[]},"0.1.7":{"name":"dsh-safety-net","version":"0.1.7","description":"Self-protection guardrails for the DeepSeek Harness: protected-path interception, backup-before-destroy, CLI self-recovery commands, and strict sandbox defaulting","private":false,"type":"module","main":"lib/index.js","exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MIT","keywords":["dsh","dsh-plugin","deepseek-harness","plugin","safety","guardrails"],"author":{"name":"Asuna486-desuwa"},"repository":{"type":"git","url":"git+https://github.com/Asuna486-desuwa/dsh-safety-net.git"},"homepage":"https://github.com/Asuna486-desuwa/dsh-safety-net#readme","bugs":{"url":"https://github.com/Asuna486-desuwa/dsh-safety-net/issues"},"engines":{"node":">=20"},"scripts":{"test":"node --test tests/*.test.mjs"},"peerDependencies":{"@deepseek-ai/dsh-fs":">=0.0.1-rc.1","@deepseek-ai/cordis":">=4.0.1"},"devDependencies":{"@deepseek-ai/dsh-fs":"^0.1.0-rc.6"},"dsh":{"bundle":{"patch":"./cordis.patch.yml"}},"gitHead":"63e979112cbb635790e46d38aa85b86112e073c9","_id":"dsh-safety-net@0.1.7","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-JQC7PsfQdfUQd1i82vFxkhiUdZMVmyVCVJgGnb5L0pOxeEc5rZuy/sea3KCpueloWDWrP8DeydctQ/TjZKXz/w==","shasum":"f04fff36eac081a0f75546941c1e3470751c49e7","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/dsh-safety-net/-/dsh-safety-net-0.1.7.tgz","fileCount":10,"unpackedSize":47626,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFkl6xiagU/h7lHfsTKGcDL9IBhpRvZ9cZYo3JecIFnZAiEAz5dKpGpb8h46VHnLt4f0kncfeA/8dD9QOjD1XtIIK8w="}],"size":17120},"_npmUser":{"name":"anonymous","email":"3440666797@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"3440666797@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-safety-net_0.1.7_1787053201285_0.8846143493517278"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-08-18T11:40:01.414Z","publish_time":1787053201414,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"0.1.7"},"name":"dsh-safety-net","time":{"created":"2026-08-17T10:24:35.594Z","modified":"2026-08-18T11:40:13.660Z","0.1.0":"2026-08-17T10:24:24.584Z","0.1.1":"2026-08-17T10:54:33.150Z","0.1.2":"2026-08-17T11:08:45.676Z","0.1.3":"2026-08-17T11:12:02.836Z","0.1.4":"2026-08-17T11:21:58.950Z","0.1.5":"2026-08-17T11:31:58.676Z","0.1.6":"2026-08-17T11:40:23.567Z","0.1.7":"2026-08-18T11:40:01.414Z"},"readme":"# dsh-safety-net\n\nSelf-protection guardrails for the DeepSeek Harness (DSH). When an agent runs\nautonomously, a wrong write can silently destroy the harness itself — this\nplugin makes that damage **impossible by default** and **reversible by\ncommand**.\n\n> 中文文档见 [README.zh-CN.md](./README.zh-CN.md) · Chinese docs live in\n> [README.zh-CN.md](./README.zh-CN.md)\n\n## Why this plugin exists\n\nDSH's own runtime state lives in plain files under `~/.dsh` (profiles,\nsession state, patches) and under the plugin data directory. An agent that\nmisreads its sandbox boundaries can `write`/`edit` those files, corrupt the\nharness, and leave you unable to start DSH at all. `dsh-safety-net` is the\nseatbelt: it hard-blocks mutations on DSH critical assets, snapshots files\nbefore refusing, and keeps a CLI recovery channel that works even when the\nGUI is gone.\n\n## The four guardrails\n\n### 1. Protected-path guard (hard interception)\n\n`fs/write-intent` and `fs/edit-intent` waterfall listeners hard-block any\nmutation that targets a DSH critical path. Protected by default:\n\n| Rule id        | Path                                                |\n| -------------- | --------------------------------------------------- |\n| `dsh-home`     | `~/.dsh` (the DSH data root, `$DSH_HOME` override)  |\n| `plugin-data`  | `~/.claude/plugins/data/dsh-deepseek-dsh`           |\n| `profile-manifest` / `profile-patch` | `~/.dsh/profiles` (profile manifests & patches) |\n| `session-state`| `~/.dsh/state` (session state)                      |\n\nA blocked mutation raises an `FS_POLICY_DENIED` error — the agent cannot\nsilently retry its way past it. Extra paths can be added via\n`safetyNet.extraProtectedPaths` (see [Configuration](#configuration)).\n\n### 2. Backup before destroy\n\nBefore a protected path is refused, the original file is snapshotted into the\nbackup store. Nothing is ever destroyed: every blocked write/edit leaves a\nrestorable copy behind (unless the snapshot itself fails), so the worst case\nis one command away from being undone.\n\n### 3. CLI self-recovery channel\n\nFive slash commands, registered on the DSH CLI surface, work even when the\nGUI is down:\n\n- `/safety-net-status` — guardrail health report (protected rules, backups, strict mode)\n- `/safety-net-backup` — manual full snapshot of protected assets\n- `/safety-net-restore` — list backups, or restore one by id\n- `/safety-net-repair` — detect missing critical files and print recovery instructions\n- `/safety-net-approve <path>` — one-time approval to write a protected path (grants a single bypass, then the guard is re-armed)\n\nSee [Commands](#commands) for details.\n\n### 4. Strict privilege tiering\n\nStrict mode is **on by default**: safety-net *declares* a read-only default\nsandbox mode and warns when the host sandbox default is wider\n(`workspace-write` / `danger-full-access`). The declaration is advisory —\nactual enforcement stays with the host sandbox backend, which safety-net\ncannot force. Turn strict off only if you understand the trade-off\n(`safetyNet.strict: false`).\n\n## Installation\n\nRequires Node.js ≥ 20 and a running DeepSeek Harness (DSH) host.\n\n> **Dependencies**: `@deepseek-ai/cordis` and `@deepseek-ai/dsh-fs` are declared\n> as **peer dependencies** — they are provided by the DSH host runtime itself\n> and are not fetched from the public npm registry (the `dsh-fs` version DSH\n> ships may not exist on public npm). Install this plugin *inside* a DSH\n> profile; do not `npm install` it standalone.\n\n**From npm**:\n\n```bash\ndsh plugin add dsh-safety-net\n```\n\n**From git**:\n\n```bash\ndsh plugin add git+https://github.com/Asuna486-desuwa/dsh-safety-net.git\n```\n\n**Manual mount**: clone the repository and wire it into your DSH plugin flow\nas usual — `cordis.patch.yml` already declares the bundle patch, and\n`package.json` carries the `dsh.bundle` metadata.\n\n## Configuration\n\nAll options live under the `safetyNet` key:\n\n```yaml\nsafetyNet:\n  # Strict mode: declares a read-only default and warns if the host sandbox\n  # default is not tightened. Default: true\n  strict: true\n  # Additional paths to protect (beyond the built-in DSH critical paths)\n  extraProtectedPaths: []\n  # Reserved — retention-based pruning wiring lands in a later release. Default: 30\n  backupRetention: 30\n```\n\n| Key                    | Type     | Default         | Description                                              |\n| ---------------------- | -------- | --------------- | -------------------------------------------------------- |\n| `safetyNet.strict`     | boolean  | `true`          | Declares a read-only default sandbox mode; warns when the host sandbox default is wider (`workspace-write` / `danger-full-access`). |\n| `safetyNet.extraProtectedPaths` | string[] | `[]`   | Extra paths treated as DSH critical assets.              |\n| `safetyNet.backupRetention` | number | `30`        | Max snapshots kept in the backup store before pruning (reserved; pruning wiring lands in a later release). |\n| `safetyNet.dshHome`    | string   | env `DSH_HOME` or `~/.dsh` | Override the DSH data root (used by the guard, the backup store and the status report alike). |\n| `safetyNet.pluginDataRoot` | string | `~/.claude/plugins/data` | Override the plugin data root (mainly for tests/injection). |\n\nThe backup store is created under `<DSH_HOME>/safety-net/backups/`.\n\n## Commands\n\nCommand names are registered without a slash (`safety-net-status`, ...) and\nare shown below with a leading `/` as they appear in the DSH UI/CLI.\n\n| Command                          | Behavior                                                                 |\n| -------------------------------- | ------------------------------------------------------------------------ |\n| `/safety-net-status`             | Reports guardrail health: number of protected rules, stored backups, strict mode, and the resolved DSH home. |\n| `/safety-net-backup`             | Manually snapshots every protected asset into the backup store.          |\n| `/safety-net-restore`            | With no argument, lists all backups (newest first).                      |\n| `/safety-net-restore <id>`       | Restores the files of the given backup id to their original locations.   |\n| `/safety-net-repair`             | Detects missing critical files and prints recovery instructions (never auto-modifies anything). |\n| `/safety-net-approve <path>`     | Grants a one-time write bypass for a protected path (calls `guard.approveOnce`); the next matching mutation passes, then the guard re-arms. |\n\n## Unblocking a false positive\n\nIf a legitimate write is blocked — e.g. you really need to modify a file under\na protected path — keep this in mind:\n\n- **one-time bypass**: `/safety-net-approve <path>` grants a single write\n  approval for that path; the next matching mutation passes, then the guard\n  re-arms. (This wires `guard.approveOnce` into the CLI.)\n- paths you added via `safetyNet.extraProtectedPaths` are **add-only at\n  runtime**: to stop protecting one, remove the entry from the config and\n  restart DSH;\n- the built-in rules (`~/.dsh`, profiles, state, plugin data) cannot be\n  removed through configuration. `strict` only *declares* the sandbox posture\n  and does **not** lift path interception. To modify a built-in protected\n  file, unload this plugin first (`dsh plugin remove dsh-safety-net`), do the\n  edit, then re-add it.\n\nA runtime one-time approval channel (`approveOnce`, already unit-tested on the\nguard) is planned for v0.2; until then the blocked error message points at the\ntwo options above.\n\n## Backup layout\n\n```\n<DSH_HOME>/safety-net/backups/\n└── <timestamp-id>/          # e.g. 1750000000000-a1b2c3\n    ├── _meta.json           # maps each snapshot file back to its EXACT original path\n    └── <relative-path>      # original path, drive letter stripped, '/' separators\n```\n\nEach snapshot is one directory named by a time-based id; the original relative\npath is preserved beneath it, and `_meta.json` records the full original path\n(drive letter included) so restore writes every file back to exactly where it\ncame from — even across Windows drive letters.\n\n## Scope & disclaimer\n\nThis plugin intentionally does **not**:\n\n- provide a GUI panel — recovery lives in the CLI, where it still works when\n  the GUI is down;\n- sync backups to the cloud — backups are local files under\n  `<DSH_HOME>/safety-net/backups/`;\n- restore file *content* diffs — restore is whole-file, snapshot-point based;\n- intercept operations on non-critical paths — only DSH critical assets and\n  paths you explicitly add are protected.\n\n## Development & testing\n\n```bash\nnode --test tests/*.test.mjs\n```\n\nTests run against an injected fake fs adapter and injected `dshHome` /\n`pluginDataRoot` overrides — they never touch your real `~/.dsh`.\n\n## License\n\nMIT","users":{}}