safe-file-deletion
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSafe File Deletion
安全文件删除
Rule
规则
Before deleting ANY file, you MUST:
- Call with
request_file_permissionoperation: "delete" - For multiple files, use array (not multiple calls)
filePaths - Wait for response
- Only proceed if "allowed"
- If "denied", acknowledge and do NOT delete
在删除任何文件之前,你必须:
- 调用并传入
request_file_permissionoperation: "delete" - 若要删除多个文件,使用数组(不要多次调用)
filePaths - 等待响应
- 仅当返回"allowed"时才可继续操作
- 若返回"denied",则确认并禁止删除
Applies To
适用范围
- commands (single or multiple files)
rm - (directories)
rm -rf - ,
unlink,fs.rmfs.rmdir - Any script or tool that deletes files
- 命令(单个或多个文件)
rm - (目录)
rm -rf - 、
unlink、fs.rmfs.rmdir - 任何会删除文件的脚本或工具
Examples
示例
Single file:
json
{
"operation": "delete",
"filePath": "/path/to/file.txt"
}Multiple files (batched into one prompt):
json
{
"operation": "delete",
"filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"]
}单个文件:
json
{
"operation": "delete",
"filePath": "/path/to/file.txt"
}多个文件(批量在一个请求中):
json
{
"operation": "delete",
"filePaths": ["/path/to/file1.txt", "/path/to/file2.txt"]
}No Workarounds
禁止规避
Never bypass deletion warnings by:
- Emptying files instead of deleting
- Moving to hidden/temp locations
- Using obscure commands
The user will see a prominent warning. Wait for explicit approval.
禁止通过以下方式绕过删除警告:
- 清空文件而非删除
- 将文件移动到隐藏/临时目录
- 使用冷门命令
用户会看到醒目的警告,请等待用户的明确批准。