safe-file-deletion

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Safe File Deletion

安全文件删除

Rule

规则

Before deleting ANY file, you MUST:
  1. Call
    request_file_permission
    with
    operation: "delete"
  2. For multiple files, use
    filePaths
    array (not multiple calls)
  3. Wait for response
  4. Only proceed if "allowed"
  5. If "denied", acknowledge and do NOT delete
在删除任何文件之前,你必须:
  1. 调用
    request_file_permission
    并传入
    operation: "delete"
  2. 若要删除多个文件,使用
    filePaths
    数组(不要多次调用)
  3. 等待响应
  4. 仅当返回"allowed"时才可继续操作
  5. 若返回"denied",则确认并禁止删除

Applies To

适用范围

  • rm
    commands (single or multiple files)
  • rm -rf
    (directories)
  • unlink
    ,
    fs.rm
    ,
    fs.rmdir
  • Any script or tool that deletes files
  • rm
    命令(单个或多个文件)
  • rm -rf
    (目录)
  • unlink
    fs.rm
    fs.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.
禁止通过以下方式绕过删除警告:
  • 清空文件而非删除
  • 将文件移动到隐藏/临时目录
  • 使用冷门命令
用户会看到醒目的警告,请等待用户的明确批准。