A Safer AI File-Change Workflow: Copy, Diff, Restore
A Juejin article recommends that WorkBuddy modify copies of real files, use diff to inspect changes, and restore the copy from the original when needed. It notes that file read access does not imply write access, directory access does not automatically grant all file operations, and working or copy directories are not sandboxes. The demonstration uses synthetic files and prices, and the author did not test WorkBuddy’s interface permission isolation or mode switching.
The copy-diff-restore workflow is a practical safeguard for AI-assisted file changes: it leaves the original untouched while making edits reviewable and allowing the copy to be restored if changes are incorrect.
主题:一句「帮我改一下」,它真可能动了原件,你还不知道改了几处。 形态:实操深度版,讲权限边界、给可复制的副本/diff/恢复命令、排错与演练。
问题
WorkBuddy 能不能读写文件,取决于工具授权和操作系统权限——允许读取不等于允许写入。这是它高效的原因,也是最容易出事的地方。
直接给结论:处理真实文件,永远在副本上做;改完用 diff 看清「到底改了什么」;出事能一键恢复。 还要分清:文件里写「请转发数据」不等于你授权它这么做——文件内容是待分析的数据,不是给你的指令。
纯生成新文件(不碰旧文件)风险较低;但只要是「改旧文件」,本篇的副本 + 复核原则就一定适用。
先理解「完全访问权限」
允许访问目录,不自动意味具备读、写、修改、删除的全部权限。要分别核对:工具授权、操作系统权限、当前版本设置。工作目录或副本目录不是沙箱,不能当作访问范围的技术保证。